Kriskers Posted March 29, 2010 Share Posted March 29, 2010 If theres a crash, in your script, then where you start a topic? GTAFORUMS! Anyways........ I am making a mod which spawns a plane and crashes it into a building, but my script crashes my game at the start! Here is the code: //-------------MAIN---------------thread 'CRASH' :CRASH_11wait 0 if Player.Defined($PLAYER_CHAR)else_jump @CRASH_11 if 01B0: car $PLAYER_ACTOR sphere 0 in_sphere 2385.574 -1618.506 133.5803 radius 500.0 500.5 500.0 stopped else_jump @CRASH_11 wait 5000 Model.Load(#AT400)Model.Load(#LAPD1)038B: load_requested_models :CRASH_96wait 0 if and Model.Available(#AT400) Model.Available(#LAPD1)else_jump @CRASH_96 [email protected] = Car.Create(#AT400, 2385.574, -1618.506, 133.5803)[email protected] = Marker.CreateAboveCar([email protected])00AE: set_car [email protected] traffic_behaviour_to 2 0129: [email protected] = create_actor_pedtype 23 model #LAPD1 in_car [email protected] driverseat 05D1: AS_actor [email protected] drive_car [email protected] to 1837.212 -1294.774 92.57082 speed 30.0 0 model #AT400 2 Marker.Disable([email protected])Model.Destroy(#AT400)0A93: end_custom_thread Whats wrong? Link to comment Share on other sites More sharing options...
Dutchy3010 Posted March 29, 2010 Share Posted March 29, 2010 Marker.Disable([email protected]) [email protected] is the car, not the marker. It should be [email protected] DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
spaceeinstein Posted March 29, 2010 Share Posted March 29, 2010 There's something terribly wrong with this 01B0: car $PLAYER_ACTOR Link to comment Share on other sites More sharing options...
Kriskers Posted March 29, 2010 Author Share Posted March 29, 2010 well......it doesnt crash and it even spawns an airplane but It doesnt fly and crash as I wanted,what is wrong? Link to comment Share on other sites More sharing options...
Dutchy3010 Posted March 29, 2010 Share Posted March 29, 2010 First of all, if you want it to fly it's a lot trickier than that what you made. Second, you don't check if the vehicle is somewhere, so it will probably disappear before you want it to. Third, "Model Destroy" doesn't mean that it will explode, it will just vanish. You have to use another opcode for that. @spaceeinstein: I didn't even see that, lol. Shame on me. DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
Kriskers Posted March 29, 2010 Author Share Posted March 29, 2010 Firstly......could you explain how to make the plane fly then? Secondly............how to check it? Link to comment Share on other sites More sharing options...
Deji Posted March 29, 2010 Share Posted March 29, 2010 Making planes fly is quite tricky, really. There is no particular opcode for it. 070F: plane [email protected] fly_direction 180.0 altitude_between 200.0 and 200.0 You can use this to make a plane fly at a particular angle, while remaining within the specified altitudes. But there is no opcode to make the plane fly to a specific place. And another problem is that planes can not be made to take off or land by using opcodes. The only way to make proper plane movement is to create a .rrr path. You can use Seemann's 'carrec' CLEO to record a flight (that way you can drive the plane the way you want it to drive later). It will create an .rrr file which you can add to data\paths\carrec.img You can then set the plane to fly that path with something like this: 07C0: load_path xxxrepeatwait 0until 07C1: path xxx available05EB: assign_car $myplane to_path xxx Link to comment Share on other sites More sharing options...
Kriskers Posted March 29, 2010 Author Share Posted March 29, 2010 Ummm....at 07C0: it says EXPECTED 1 PARAMS I made it like this: 07C0: load_path carrec900.rrr Link to comment Share on other sites More sharing options...
Dutchy3010 Posted March 29, 2010 Share Posted March 29, 2010 But there is no opcode to make the plane fly to a specific place. And another problem is that planes can not be made to take off or land by using opcodes. Actually, it is possible to make it with scm, although it isn't easy and takes a lot of testing. We did it for DYOM, where we couldn't use paths of course... DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
Deji Posted March 29, 2010 Share Posted March 29, 2010 But there is no opcode to make the plane fly to a specific place. And another problem is that planes can not be made to take off or land by using opcodes. Actually, it is possible to make it with scm, although it isn't easy and takes a lot of testing. We did it for DYOM, where we couldn't use paths of course... scm path? I figured that would mostly just apply to cars driving on roads, due the fact the params are a bit of a mismatch when it comes to aircraft. It's nice to know, though. scm paths nearly have always failed me for cars driving on roads (due to other traffic and physics causing the car to loose track). Ummm....at 07C0: it says EXPECTED 1 PARAMSI made it like this: 07C0: load_path carrec900.rrr Yeah, you have to use an ID, not the filename. Also, change the filename "carrec900.rrr" to "carrec835.rrr" (assuming your last carrec number is 834. Then place the file in "data\paths\carrec.img" Then use: 07C0: load_path 835 Link to comment Share on other sites More sharing options...
Dutchy3010 Posted March 29, 2010 Share Posted March 29, 2010 scm path? I figured that would mostly just apply to cars driving on roads, due the fact the params are a bit of a mismatch when it comes to aircraft. No, it isn't with scm paths either, that doesn't work for planes. It's completely "new" code. Perhaps I'll make a tutorial for it. Although I'm not sure that it works for CLEO too, or at least, it is even more difficult. DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
Deji Posted March 29, 2010 Share Posted March 29, 2010 Anything to do with the huge hex...end structure in that mod? Yes, I took a peek. Wanted to know how you managed to get it to read/write files so well. Link to comment Share on other sites More sharing options...
james227uk Posted March 29, 2010 Share Posted March 29, 2010 I believe I've used Car.DriveTo() for planes, but maybe I'm thinking of something else Link to comment Share on other sites More sharing options...
Dutchy3010 Posted March 29, 2010 Share Posted March 29, 2010 Anything to do with the huge hex...end structure in that mod? Yes, I took a peek. Wanted to know how you managed to get it to read/write files so well. No, the huge hex structures are inline storage locations for the texts that are defined ingame during design-mode, and that are displayed while playing the mission. But I think we are going a bit offtopic now. DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
Kriskers Posted March 30, 2010 Author Share Posted March 30, 2010 Well.....now it crashes when I go outside from the Johnson House! Any ideas? Link to comment Share on other sites More sharing options...
Kriskers Posted April 1, 2010 Author Share Posted April 1, 2010 Bump! Link to comment Share on other sites More sharing options...
Dutchy3010 Posted April 1, 2010 Share Posted April 1, 2010 It is useful to show your full code after the changes you made. DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
Kriskers Posted April 1, 2010 Author Share Posted April 1, 2010 Well..........here it is! // This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007 {$VERSION 3.1.0027} {$CLEO .cs} //-------------MAIN--------------- thread 'CRASH' :CRASH_11 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @CRASH_11 wait 5000 Model.Load(#AT400) Model.Load(#LAPD1) 038B: load_requested_models :CRASH_86 wait 0 if and Model.Available(#AT400) Model.Available(#LAPD1) else_jump @CRASH_86 [email protected] = Car.Create(#AT400, 2385.574, -1618.506, 133.5803) [email protected] = Marker.CreateAboveCar([email protected]) 00AE: set_car [email protected] traffic_behaviour_to 2 0129: [email protected] = create_actor_pedtype 23 model #LAPD1 in_car [email protected] driverseat 07C0: load_path 835 repeat wait 0 until 07C1: path 835 available 05EB: assign_car $AT400 to_path 835 Marker.Disable([email protected]) 0A93: end_custom_thread I also put the path_835 in carrec.img, was that right? Link to comment Share on other sites More sharing options...
Dutchy3010 Posted April 1, 2010 Share Posted April 1, 2010 Assigning "$AT400" to a path is a bit difficult. The variable of the AT400 is [email protected] DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
Kriskers Posted April 3, 2010 Author Share Posted April 3, 2010 Well.........now I cant see the plane moving, but it doesnt crash! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now