baclaine Posted December 31, 2022 Share Posted December 31, 2022 Hi I'm starting to learn scripts it works but always crashes after loading the 45 car. Any ideas? I {$CLEO .cs} 0000: NOP 0004: $41 = 400 :WACHT 0001: wait 90 0A90: is_hid_pressed 15 004D: jump_if_false @WACHT 0A90: is_hid_pressed 12 004D: jump_if_false @WACHT 0002: jump @START :TRST 0249: release_model $41 01C3: remove_references_to_car [email protected] 00A6: destroy_car [email protected] :START 0001: wait 90 0247: load_model $41 0001: wait 0 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 -0.33 :CAR 0001: wait 90 0248: model $41 available 004D: jump_if_false @START 00A5: [email protected] = create_car $41 at [email protected] [email protected] [email protected] :ACTION0 0001: wait 0 03E5: show_text_box 'TEXT1' 0A90: is_hid_pressed 63 004D: jump_if_false @VOL1 0002: jump @NEXT :VOL1 0A90: is_hid_pressed 12 004D: jump_if_false @VOL2 0002: jump @ENDE :VOL2 0002: jump @ACTION0 :NEXT 0001: wait 0 000A: $41 += 1 0039: $41 == 612 004D: jump_if_false @WHY 0039: $41 == 400 :WHY 0002: jump @TRST :ENDE 0001: wait 0 01C3: remove_references_to_car [email protected] 0002: jump @WACHT Link to comment Share on other sites More sharing options...
LeeC22 Posted January 1 Share Posted January 1 11 hours ago, baclaine said: Hi I'm starting to learn scripts it works but always crashes after loading the 45 car. Any ideas? I {$CLEO .cs} 0000: NOP 0004: $41 = 400 :WACHT 0001: wait 90 0A90: is_hid_pressed 15 004D: jump_if_false @WACHT 0A90: is_hid_pressed 12 004D: jump_if_false @WACHT 0002: jump @START :TRST 0249: release_model $41 01C3: remove_references_to_car [email protected] 00A6: destroy_car [email protected] :START 0001: wait 90 0247: load_model $41 0001: wait 0 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 -0.33 :CAR 0001: wait 90 0248: model $41 available 004D: jump_if_false @START 00A5: [email protected] = create_car $41 at [email protected] [email protected] [email protected] :ACTION0 0001: wait 0 03E5: show_text_box 'TEXT1' 0A90: is_hid_pressed 63 004D: jump_if_false @VOL1 0002: jump @NEXT :VOL1 0A90: is_hid_pressed 12 004D: jump_if_false @VOL2 0002: jump @ENDE :VOL2 0002: jump @ACTION0 :NEXT 0001: wait 0 000A: $41 += 1 0039: $41 == 612 004D: jump_if_false @WHY 0039: $41 == 400 :WHY 0002: jump @TRST :ENDE 0001: wait 0 01C3: remove_references_to_car [email protected] 0002: jump @WACHT This is the GTAV section and your post is tagged SA, you might want to self-report your post to get it moved into the correct section of the forums. baclaine 1 Link to comment Share on other sites More sharing options...
ArmanCan Posted January 1 Share Posted January 1 @baclaine at first i would like to say.. "$41" represents as a "useless IMPEXPM flag" and it's a "Global Variable".. you musn't use Global Variable or you should convert it to a "Local Variable" 0004: $41 = 400 I don't know what is the value "400" but if you are trying to use model ID "41" than you should write like this.. "#HFYST".. If your model ID is "400" than you should write this.. "#LANDSTAL" For the car creation you need to "Load" the car/s first.. and than you can request your car/s.. Some local variables needs some "Definition" between "Const.. end" and it must be placed at the beginning of this script for example like this.. {$CLEO .cs} // RTSM_Player_Skills_Final.txt { Real Time Status Monitor - Player Skills by OrionSR & ArmanCan Jan 11, 2022 } {Header - Configuring Sanny Builder} const {Internal} is_right_panel = [email protected] // passed when launched int_val = [email protected] dec_part = [email protected] left_x_pos = [email protected] right_x_pos = [email protected] centered_x_pos = [email protected] title_x_pos = [email protected] y_pos = [email protected] box_x_pos = [email protected] box_y_pos = [email protected] box_width = [email protected] box_height = [email protected] right_panel_disabled = [email protected] Key_O = 79 // For Left Panel Key_P = 80 // For Right Panel Font_Pricedown = 0 Font_Aharoni = 1 Font_Gothic = 2 Font_Beckett = 3 end üb dich weiter und beginnt Schritt bei Schritt.. Viel Glück und ich wünsche dir ein Frohes neues Jahr.. baclaine 1 Link to comment Share on other sites More sharing options...
Spider-Vice Posted January 2 Share Posted January 2 On 1/1/2023 at 10:14 AM, LeeC22 said: This is the GTAV section and your post is tagged SA, you might want to self-report your post to get it moved into the correct section of the forums. Moved baclaine 1 GTANet | Red Dead Network | black lives matter | stop Asian hate | trans lives = human lives the beginning is moments ago, the end is moments away Link to comment Share on other sites More sharing options...
ZAZ Posted January 2 Share Posted January 2 On 1/1/2023 at 2:07 PM, ArmanCan said: üb dich weiter und beginnt Schritt bei Schritt.. baclaine ist Belgier, nicht deutsch ArmanCan 1 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
OrionSR Posted January 2 Share Posted January 2 (edited) On 12/31/2022 at 2:43 PM, baclaine said: Any ideas? {$CLEO .cs} - Cleo script for PC. {$CLEO .csa} - Auto-run cleo script for Android. {$CLEO .csi} - Menu launched cleo script for Android. 0A90: is_hid_pressed 15 - This is a mobile opcode. With only 1 parameter, Sanny wouldn't let you compile this script unless the SA Mobile edit mode is active. The edit mode can be changed using the icon in the lower-right corner of SB's main window. 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 -0.33 Always make sure the player is playing (player is defined) before using player based opcodes. $41 - Global variable in a cleo script - bad practice in most cases. :NEXT 0001: wait 0 000A: $41 += 1 0039: $41 == 612 004D: jump_if_false @WHY 0039: $41 == 400 :WHY 0002: jump @TRST 0039: $41 == 400 0039: is a condition check, not an assignment. 0004: $41 = 400 Should use a local variable, which have different opcodes. 0006: [email protected] = 400 //0039: $41 == 612 // wrong! 0038: $41 == 612 0039: [email protected] == 612 You are using 0039 with a global argument. Omitting the IF commands makes the script more difficult to read. Save this trick for when saving a few bytes is necessary. 03E5: show_text_box 'TEXT1' Please include a comment with the text displayed. Edited January 3 by OrionSR ArmanCan 1 Link to comment Share on other sites More sharing options...
baclaine Posted January 5 Author Share Posted January 5 (edited) removed Edited January 5 by baclaine Link to comment Share on other sites More sharing options...
baclaine Posted January 6 Author Share Posted January 6 (edited) Hi, Script is for the definitive edition. I use opcode 0A90 because this script is for steam deck and controllers. But still crashes after changing the value+- 20 times This is how it looks in game: https://imgur.com/a/4O0RnPc {$CLEO .cs} 0000: NOP 0006: [email protected] = 417 :WACHT 0001: wait 90 0A90: is_hid_pressed 15 004D: jump_if_false @WACHT 0A90: is_hid_pressed 12 004D: jump_if_false @WACHT 0002: jump @START :TRST 0249: release_model [email protected] 01C3: remove_references_to_car [email protected] 00A6: destroy_car [email protected] :START 0001: wait 90 0247: load_model [email protected] 0001: wait 0 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 -0.33 :CAR 0001: wait 90 0248: model [email protected] available 004D: jump_if_false @START 00A5: [email protected] = create_car [email protected] at [email protected] [email protected] [email protected] :ACTION0 0001: wait 0 03E5: show_text_box 'TEXT1' 0A90: is_hid_pressed 63 004D: jump_if_false @VOL1 0002: jump @NEXT :VOL1 0A90: is_hid_pressed 12 004D: jump_if_false @VOL2 0002: jump @ENDE :VOL2 0002: jump @ACTION0 :NEXT 0001: wait 0 000A: [email protected] += 1 0039: [email protected] == 445 004D: jump_if_false @WHY 0002: jump @FAILED :WHY 0002: jump @TRST :FAILED 0004: [email protected] = 400 0002: jump @TRST :ENDE 0001: wait 0 01C3: remove_references_to_car [email protected] 0002: jump @WACHT Edited January 6 by baclaine Link to comment Share on other sites More sharing options...
OrionSR Posted January 6 Share Posted January 6 (edited) 7 hours ago, baclaine said: Script is for the definitive edition. Ah, that clears up the initial questions, and is critical information when posting scripting issues. There are still a couple of wrong opcodes; global version used instead of local version. //0004: [email protected] = 400 0006: [email protected] = 400 //000A: [email protected] += 1 000B: [email protected] += 1 Note that for math and conditional commands that include a constant, if the opcode is omitted then SB can figure out the proper opcode for you. I'm not sure if this would cause a crash or not, but... There doesn't appear to be any kind of trap to prevent a routine from executing multiple times while a HID is pressed. Make sure the player is defined before executing player based commands. 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 -0.33 Edited January 6 by OrionSR Link to comment Share on other sites More sharing options...
baclaine Posted January 6 Author Share Posted January 6 Hi I fixed it my biggest fault was release model after the number changed so I released a model which hasn't been spawned and flooded the ram probably. Script work now next step is removing the RC vehicles from my spawner but that shouldn't be so hard. And define player more. Thanks for your help. Script now: {$CLEO .cs} 0000: NOP 0006: [email protected] = 400 :WACHT 0001: wait 90 0A90: is_hid_pressed 15 004D: jump_if_false @WACHT 0A90: is_hid_pressed 12 004D: jump_if_false @WACHT 0002: jump @START :START 00A6: destroy_car [email protected] 0001: wait 90 0247: load_model [email protected] 038B: load_requested_models 0001: wait 0 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 -0.33 :CAR 0001: wait 90 0248: model [email protected] available 004D: jump_if_false @START 00A5: [email protected] = create_car [email protected] at [email protected] [email protected] [email protected] 0249: release_model [email protected] :ACTION0 0001: wait 0 03E5: show_text_box 'TEXT1' 0A90: is_hid_pressed 63 004D: jump_if_false @VOL1 0002: jump @NEXT :VOL1 0A90: is_hid_pressed 12 004D: jump_if_false @VOL2 0002: jump @ENDE :VOL2 0002: jump @ACTION0 :NEXT 0001: wait 0 000B: [email protected] += 1 0039: [email protected] == 611 004D: jump_if_false @WHY 0002: jump @FAILED :WHY 0002: jump @START :FAILED 0006: [email protected] = 400 0002: jump @START :ENDE 0001: wait 0 01C3: remove_references_to_car [email protected] 0002: jump @WACHT OrionSR 1 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