Jump to content

Need help with CLEO mission script (game crashes)


serabella

Recommended Posts

Hello!

I'm back to modding after a long time and need some help. I'm trying to create a cleo mission but I can't get it to work (the game crashes shortly after the mission starts.)

This is the code which is supposed to start the mission:

{$CLEO .cs}thread 'HOMIES' :STARTwait 0 if    Player.Defined($PLAYER_CHAR)jf @STARTif   $ONMISSION == 0 jf @STARTif 00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 1279.9764 -831.1151 83.1406 radius 2.0 2.0 2.0 on_foot jf @STARTif    Player.Controllable($PLAYER_CHAR)jf @START$ONMISSION = 1 00BA: show_text_styled GXT 'TXT_01' time 3000 style 2 0A94: start_custom_mission "MEETTHEHOMIES"  :CHECKwait 0 if    Player.Defined($PLAYER_CHAR)jf @CHECK if   $ONMISSION == 0 jf @CHECK wait 10000 jump @START

I guess this part of the code works since the mission starts just fine.

This is the mission script:

{$CLEO .cm}thread "HOMIES" gosub @LOAD if wasted_or_busted jf @JUMPTOFAIL gosub @FAIL:JUMPTOFAILgosub @CLEANUP end_thread :LOADincrement_mission_attempts $ONMISSION = 1 Player.WantedLevel($PLAYER_CHAR) = 0Model.Load(#BMOST)Model.Load(#TEC9)Model.Load(#BLADE)023C: load_special_actor 'FORELLI' as 1 // models 290-299 023C: load_special_actor 'ROSE' as 2 // models 290-299 023C: load_special_actor 'SWEET' as 3 // models 290-299 :CHECKwait 0 if and   Model.Available(#BMOST)   Model.Available(#TEC9)   Model.Available(#BLADE)jf @CHECK:SPECACTORSif or823D:   not special_actor 1 loaded 823D:   not special_actor 2 loaded 823D:   not special_actor 3 loaded jf @SPAWNCAR wait 0 023C: load_special_actor 'FORELLI' as 1 // models 290-299 023C: load_special_actor 'ROSE' as 2 // models 290-299023C: load_special_actor 'SWEET' as 3 // models 290-299  jump @SPECACTORS :SPAWNCARActor.StorePos($PLAYER_ACTOR, 10@, 11@, 12@)00A5: 0@ = create_car #BLADE at 1371.963 -855.7698 42.4129 0175: set_car 0@ Z_angle_to 210.00186: 1@ = create_marker_above_car 0@0570: 2@ = create_asset_radar_marker_with_icon 0 at 1371.963 -855.7698 42.4129   //Bilen man ska köra i början plus ikoner för den.009A: 3@ = create_actor_pedtype 4 model #SPECIAL01 at 1574.6372 -1335.698 16.48440173: set_actor 3@ Z_angle_to 315.0   //Dmitri009A: 4@ = create_actor_pedtype 4 model #SPECIAL02 at 2252.8687 -1031.1582 56.41110173: set_actor 4@ Z_angle_to 225.0   //Bull Douglas009A: 5@ = create_actor_pedtype 4 model #SPECIAL03 at 2555.7424 -959.9698 82.68260173: set_actor 5@ Z_angle_to 185.0    //Langos03BC: 6@ = create_sphere_at 1582.6256 -1327.9235 16.4844 radius 2.0  //Dmitris hus03BC: 7@ = create_sphere_at 2267.332 -1042.5715 51.0092 radius 2.0   //Bull Douglas hus03BC: 8@ = create_sphere_at 2556.5618 -967.0579 82.5945 radius 2.0   //Langos huswait 50000BB: show_text_lowpriority GXT 'TXT_10' time 3000 flag 1 wait 1000:INCARif00DB:   actor $PLAYER_ACTOR in_car 0@jf @INCAR0570: 9@ = create_asset_radar_marker_with_icon 0 at 1582.6256 -1327.9235 16.4844 //Markör vid Dmitri skapas.00BB: show_text_lowpriority GXT 'TXT_11' time 3000 flag 1 wait 1000:INDMITRISPHEREif 00F1:   actor $PLAYER_ACTOR sphere 0 near_point 1582.6256 -1327.9235 16.4844 radius 2.0 2.0 stopped_in_carjf  @INDMITRISPHERE05D3: AS_actor 3@ goto_point 10@ 11@ 12@ mode 4 time 3000 ms wait 3000036A: put_actor 3@ in_car 0@wait 50000BB: show_text_lowpriority GXT 'TXT_12' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_13' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_14' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_15' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_16' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_17' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_18' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_19' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_20' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_21' time 3000 flag 1 wait 3000               //Dmitri går in i bilen och dom konversalerar lite.0570: 13@ = create_asset_radar_marker_with_icon 0 at 2267.332 -1042.5715 51.0092   //Skapa ikon vid Bull Douglas.:INDOUGLASSPHEREif 00F1:   actor $PLAYER_ACTOR sphere 0 near_point 2267.332 -1042.5715 51.0092 radius 2.0 2.0 stopped_in_carjf  @INDOUGLASSPHERE05D3: AS_actor 4@ goto_point 10@ 11@ 12@ mode 4 time 3000 ms wait 3000036A: put_actor 4@ in_car 0@wait 50000BB: show_text_lowpriority GXT 'TXT_22' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_23' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_24' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_25' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_26' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_27' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_28' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_29' time 3000 flag 1 wait 3000 //Bull Douglas hoppar in i bilen och ytterliggare en konversation.0570: 14@ = create_asset_radar_marker_with_icon 0 at 2556.5618 -967.0579 82.5945   //Skapa ikon vid Langos.:INLANGOSSPHEREif 00F1:   actor $PLAYER_ACTOR sphere 0 near_point 2267.332 -1042.5715 51.0092 radius 2.0 2.0 stopped_in_carjf  @INLANGOSSPHERE05D3: AS_actor 5@ goto_point 10@ 11@ 12@ mode 4 time 3000 ms wait 3000036A: put_actor 5@ in_car 0@wait 50000BB: show_text_lowpriority GXT 'TXT_30' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_31' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_32' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_33' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_34' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_35' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_36' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_37' time 3000 flag 1 wait 3000 //Langos hoppar in i bilen och ytterliggare en konversation.0570: 15@ = create_asset_radar_marker_with_icon 0 at 2556.5618 -967.0579 82.5945   //Skapa ikon vid Grove Street.009A: 16@ = create_actor_pedtype 4 model #BMOST at 2495.3616 -1685.6663 13.51320173: set_actor 16@ Z_angle_to 356.0 03BC: 17@ = create_sphere_at 2495.0933 -1682.2645 13.3388 radius 2.0   //Här ska vi hustla!:ATTHEGROVEif 00F1:   actor $PLAYER_ACTOR sphere 0 near_point 2267.332 -1042.5715 51.0092 radius 2.0 2.0 stopped_in_carjf  @ATTHEGROVE00BB: show_text_lowpriority GXT 'TXT_38' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_39' time 3000 flag 1 wait 5903BC: 18@ = create_sphere_at 2494.96 -1684.6082 13.5108 radius 1.0   //Sphere precis vid killen vi ska prata med.:THEDEALif 0102:   actor $PLAYER_ACTOR in_sphere 2494.96 -1684.6082 13.5108 radius 1.0 1.0 1.0 sphere 1 stopped_on_footjf  @THEDEAL00BB: show_text_lowpriority GXT 'TXT_01' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_02' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_03' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_04' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_05' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_06' time 3000 flag 1 0109: player $PLAYER_CHAR money += 1000wait 300000BC: show_text_highpriority GXT 'TXT_08' time 3000 flag 1 //De pratar och vi säljer droger och får pengar.wait 300000BC: show_text_highpriority GXT 'TXT_40' time 3000 flag 1 //De pratar och vi säljer droger och får pengar.:INCARAGAINif00DB:   actor $PLAYER_ACTOR in_car 0@jf @INCARAGAIN00BB: show_text_lowpriority GXT 'TXT_41' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_42' time 3000 flag 1 wait 300000BB: show_text_lowpriority GXT 'TXT_43' time 3000 flag 1 wait 30000633: AS_actor 3@ exit_carwait 5000634: AS_actor 3@ attack_using_weapon_actor 16@ flags 4 perform_actions_after_time 20000 chance_of_action 100wait 300005E2: AS_actor 3@ kill_actor 16@wait 1000:WIN_CHECKifActor.Dead(16@)jf @WIN_CHECKwait 50jump @PASS:FAIL00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1return :PASS01E3: show_text_1number_styled GXT 'M_PASS' number 100 time 5000 style 1  Player.Money($PLAYER_CHAR) += 100Player.ClearWantedLevel($PLAYER_CHAR)0394: play_music 1 030C: progress_made = 1 return :CLEANUP0296: unload_special_actor 10296: unload_special_actor 20296: unload_special_actor 3009B: destroy_actor 3@009B: destroy_actor 4@009B: destroy_actor 5@009B: destroy_actor 16@00A6: destroy_car 0@

The mission starts and I can see the text in the beginning and how an Icon is created on the radar but shortly after, the game crashes. Could a kind soul help a fellow modder out? :)

Link to comment
Share on other sites

There're 8 mini loops which need a wait

 

first one:

:INCARwait 0if00DB:   actor $PLAYER_ACTOR in_car 0@jf @INCAR
:INCAR <-- is a "Loop adress"wait 0  <---- need a wait time as following of a "Loop adress"if00DB:   actor $PLAYER_ACTOR in_car 0@jf @INCAR <-- jumps to a previous adress, so :INCAR is a "Loop adress"

second one:

:INDMITRISPHEREwait 0if 00F1:   actor $PLAYER_ACTOR sphere 0 near_point 1582.6256 -1327.9235 16.4844 radius 2.0 2.0 stopped_in_carjf  @INDMITRISPHERE

3th, 4th, 5th, 6th, 7th and 8th do you have to find by yourself

 

and the cleanup block must end with return:

:CLEANUP0296: unload_special_actor 10296: unload_special_actor 20296: unload_special_actor 3009B: destroy_actor 3@009B: destroy_actor 4@009B: destroy_actor 5@009B: destroy_actor 16@00A6: destroy_car 0@return//  <----------------------------- !!!
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.