goodModsRcool Posted December 16, 2014 Share Posted December 16, 2014 I started putting together this car bomb CLEO and got it pretty much how I want it but there is a bug I can't seem to fix. I need a way for the script to jump to the beginning and remove references from car if Player is wasted or busted. It causes a game crash after being wasted or busted because the references to car are still in memory, I tried many ways but I don't know how to fix this. Here it is. {$CLEO .cs} //-------------MAIN--------------- 0000: NOP :NONAME_6 wait 0 if and Player.Defined($PLAYER_CHAR) 00E0: player $PLAYER_CHAR driving 847E: not player $PLAYER_CHAR driving_a_motorbike 05EE: key_pressed 45 //VK_insert else_jump @NONAME_6 03C1: [email protected] = player $PLAYER_CHAR car 03E2: actor $PLAYER_ACTOR exit_car 018C: play_sound 16 at 0.0 0.0 0.0 03E5: text_box 'bombON' jump @NONAME_59 :NONAME_125 01C3: remove_references_to_car [email protected] // Like turning a car into any random car jump @NONAME_6 :NONAME_59 wait 0 if 8442: not player $PLAYER_CHAR in_car [email protected] else_jump @NONAME_59 jump @NONAME_77 :NONAME_77 wait 225 if 00E1: key_pressed 0 4 else_jump @NONAME_77 jump @check :check wait 0 if 8112: not wasted_or_busted else_jump @NONAME_125 jump @NONAME_121 :NONAME_121 wait 0 018C: play_sound 16 at 0.0 0.0 0.0 wait 65 020B: explode_car [email protected] 0407: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset 0.0 1.5 0.0 020C: create_explosion_with_radius 2 at [email protected] [email protected] [email protected] 0407: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset 0.0 1.5 0.0 wait 30 020C: create_explosion_with_radius 1 at [email protected] [email protected] [email protected] 0407: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset 0.0 1.5 0.0 wait 200 020C: create_explosion_with_radius 3 at [email protected] [email protected] [email protected] 0407: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset 0.0 1.5 0.0 020C: create_explosion_with_radius 4 at [email protected] [email protected] [email protected] jump @NONAME_6 Link to comment Share on other sites More sharing options...
JohnDoe4444 Posted December 16, 2014 Share Posted December 16, 2014 (edited) damn it!!!!! i'm trying to fix it when i finished and if it works i'll show you Edited December 16, 2014 by 4sinayousefi Link to comment Share on other sites More sharing options...
goodModsRcool Posted December 16, 2014 Author Share Posted December 16, 2014 Thanks, the struggle is real HAHA, this is definitely one of the more rediculous bugs I've encountered in a simple script, because you would think there should be a simple way to tell the script to remove references and restart at the beginning if wasted or busted. I was awake until almost sunrise trying to figure this out with no luck. Drove me mad! HAHA Link to comment Share on other sites More sharing options...
JohnDoe4444 Posted December 16, 2014 Share Posted December 16, 2014 ummm....... i'm not good at scripting so much so i should test some strange codes. sorry mate!!!! because my GTA VC crashes because of some mapping edits Link to comment Share on other sites More sharing options...
ZAZ Posted December 16, 2014 Share Posted December 16, 2014 (edited) 8112: not wasted_or_busted works only in mission scripts, for cleo only in cm files use Player.Defined($PLAYER_CHAR) in normal threads to check if player died or got arrested, use it always, in every loop Edited December 16, 2014 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
goodModsRcool Posted December 16, 2014 Author Share Posted December 16, 2014 (edited) I have tried Player.Defined($PLAYER_CHAR) to make this work but the bug still existed. It may just be a matter of me not knowing the proper spot to put that check. I tried many variations...seemed no matter where i tried to put the check, the bug still happened. Edited December 16, 2014 by goodModsRcool Link to comment Share on other sites More sharing options...
Jack Posted December 16, 2014 Share Posted December 16, 2014 (edited) You don't need 01c3 opcode. The car is already marked as not needed by the scrypt: STORE_CAR_PLAYER_IS_IN_NO_SAVE is the command name of the 03c1. Key word is NO_SAVE. I haven't looked at the rest of the code... Edited December 16, 2014 by Jack Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
goodModsRcool Posted December 16, 2014 Author Share Posted December 16, 2014 Even without using 01c3 it still crashes. Link to comment Share on other sites More sharing options...
ZAZ Posted December 16, 2014 Share Posted December 16, 2014 (edited) i stripped it a little bit, works for me without bug {$CLEO}thread 'CARBOMB' :CARBOMB_6 wait 0 if Player.Defined($PLAYER_CHAR)else_jump @CARBOMB_6 if and00E0: player $PLAYER_CHAR driving847E: not player $PLAYER_CHAR driving_a_motorbike 05EE: key_pressed 66// b key else_jump @CARBOMB_603C1: [email protected] = player $PLAYER_CHAR car03E2: actor $PLAYER_ACTOR exit_car018C: play_sound 16 at 0.0 0.0 0.0//03E5: text_box 'bombON' 03E5: text_box 'FEM_ON' :CARBOMB_59wait 0 if Player.Defined($PLAYER_CHAR)else_jump @CARBOMB_6if8119: not car [email protected] wreckedelse_jump @CARBOMB_6 if and8442: not player $PLAYER_CHAR in_car [email protected]: key_pressed 0 4// action key /Radio else_jump @CARBOMB_59 wait 0018C: play_sound 16 at 0.0 0.0 0.0wait 65020B: explode_car [email protected]: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset 0.0 1.5 0.0 020C: create_explosion_with_radius 2 at [email protected] [email protected] [email protected]: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset 0.0 1.5 0.0wait 30 020C: create_explosion_with_radius 1 at [email protected] [email protected] [email protected]: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset 0.0 1.5 0.0wait 200 020C: create_explosion_with_radius 3 at [email protected] [email protected] [email protected]: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset 0.0 1.5 0.0 020C: create_explosion_with_radius 4 at [email protected] [email protected] [email protected] jump @CARBOMB_6but it's not recommended to create_coordinate from_car after explode_car because the game removes wrecked cars from scriptable state Edited December 16, 2014 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
goodModsRcool Posted December 16, 2014 Author Share Posted December 16, 2014 Is it possible that after being wasted or busted, car [email protected] is destroyed (does not exist anymore), and so on the keypress 0 4 when it jumps to :NONAME_121 it is trying to explode a car that does not exist anymore, and that is what is causing the crash? If so is there a way around this? Link to comment Share on other sites More sharing options...
goodModsRcool Posted December 16, 2014 Author Share Posted December 16, 2014 ZAZ, it now works like a charm, thank you so much. 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