Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Summer Special
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
n4z1_f0rum

Cleo3-New Mission Structure.

Recommended Posts

n4z1_f0rum

With a system of its kind (it is a simple diagram):

 

File CS:

<mission1>

<mission2>(after Mission1)

<mission3>(after Mission2)

<mission4>(after Mission3)

<mission5>(after Mission4)

<mission6>(after Mission5)

<mission7>(after Mission6)

<mission8>(after Mission7)

 

File CM <mission1>

File CM <mission2>

File CM <mission3>

File CM <mission4>

File CM <mission5>

File CM <mission6>

File CM <mission7>

File CM <mission8>

 

After savinging the start always mission1, or remember where it is

? (Of course if everything is done well...) smile.gif

And if so, has already been done, perhaps? smile.gif

Share this post


Link to post
Share on other sites
ZAZ

is it a quest or what? can you describe what you mean?

Share this post


Link to post
Share on other sites
ATM Money Man

Well these kinds of things I've gotten globals to work, just make sure its something thats not in the main.scm

 

This is basically what you should do. (not tested)

 

 

// code for mission [email protected] = 9 // change this variable to the max ammount of missions that can be passed:STARTif $MISSION_PASSED_VARIABLE == 1thenjump @MISSION2endjump @NEXT1:MISSION2// mission 2 code:NEXT1if $MISSION_PASSED_VARIABLE == 2then jump @MISSION3endjump @NEXT2:MISSION3// I think you get it now// at the end add this before the end thread opcodeif $MISSIONS_PASSED_VARIABLE == [email protected] jump @ENDendgoto @START:ENDend_custom_thread // just get the opcode yourself, I'm not using Sanny right now

 

Share this post


Link to post
Share on other sites
n4z1_f0rum

But this unique file must be .cs or .cm?... smile.gif

 

 

 

is it a quest or what? can you describe what you mean?

So, I have 8 missions, such as this (although it is still only a test):

 

 

{$CLEO}0000://-------------MAIN---------------03A4: name_thread 'TEST'0247: load_model #ARMYwait 500 ms0247: load_model #COLT45wait 500 ms:STARTwait 100 if andPlayer.Defined($PLAYER_CHAR)else_jump @[email protected] = 420.0 [email protected] = [email protected] = 16.502A8: $RADAR_3 = create_marker 26 at 420.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 26 at 420.0 2500.0 16.5 :MISSION1wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 420.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION1$ONMISSION = 1wait 1000164: disable_marker $RADAR_30164: disable_marker [email protected] 003E5: show_text_box 'MCES05A' // Changed in 'Kill Enemy 1!'009A: [email protected] = create_actor_pedtype 6 model #ARMY at 410.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 22 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION1wait 100 if Actor.Dead([email protected])else_jump @ACTION12Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 500$ONMISSION = 0jump @END:ACTION12wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION1Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START:END0A93: end_custom_thread

 

 

Now is a .cs file, so if its completion is saved, when restart the game, .cs restart from beginning (obviously).

So I thought to 8 .cm, with 8 missions, and in the .cs file to run them in series.

 

I found this example (no longer find the thread, I apologize to the author) so I thought it might work:

 

Trigger:

 

{$CLEO .cs}03A4: name_thread 'mstart'0A95: enable_thread_saving0AB3: var 12 = 002A8: [email protected] = create_marker 55 at 354.982 2442.75 16.1:MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTrigger00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEndcheck0AB4: [email protected] = var 12if  and0039:   [email protected] ==  000FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTriggerEndcheck0164: disable_marker [email protected] 0004: $ONMISSION = 10A94: start_custom_mission "missions\ammo1"0002: jump @MissionTrigger:MissionTriggerEndcheck0AB4: [email protected] = var 12if0039:   [email protected] ==  1004D: jump_if_false @MissionTrigger0A93: end_custom_thread

 

 

Mission:

 

{$CLEO .cm}:AMMO103A4: name_thread 'AMMO1'0050: gosub @AMMO1_main_100D6: if0112:   wasted_or_busted004D: jump_if_false @AMMO1_20050: gosub @AMMO1_fail:AMMO1_20050: gosub @AMMO1_cleanup004E: end_thread:AMMO1_main_10317: increment_mission_attempts0001: wait 0 ms0006: [email protected] =  00247: load_model #FORKLIFT038B: load_requested_models:AMMO1_main_20001: wait 0 ms0248:   model #FORKLIFT available004D: jump_if_false @AMMO1_main_200A5: [email protected] = create_car #FORKLIFT at -1957.82 2382.72 48.99530175: set_car [email protected] Z_angle_to 140.0018A: [email protected] = create_checkpoint_at -2478.39 2291.02 4.440186: [email protected] = create_marker_above_car [email protected]: show_on_radar [email protected] 2 0165: set_marker [email protected] color_to 1 :AMMO1_main_30001: wait 0 ms00D6: if8119:   not car [email protected] wrecked004D: jump_if_false @AMMO1_failif  and0039:   [email protected] ==  000DB:   actor $PLAYER_ACTOR in_car [email protected]: jump_if_false @AMMO1_main_40164: disable_marker [email protected]: [email protected] =  1:AMMO1_main_4if  and00DB:   actor $PLAYER_ACTOR in_car [email protected]:   actor $PLAYER_ACTOR in_sphere -2478.39 2291.02 4.44 radius 2.0 2.0 2.0 sphere 1 stopped_in_car004D: jump_if_false @AMMO1_main_3016A: fade 0 time 5000001: wait 500 ms05CD: AS_actor $PLAYER_ACTOR exit_car [email protected]  014B: [email protected] = init_parked_car_generator #FORKLIFT color -1 -1 1 alarm 0 door_lock 0 0 10000 at 355.221 2469.67 15.91 angle 140.0014C: set_parked_car_generator [email protected] cars_to_generate_to 1010AB3: var 12 = 10001: wait 2000 ms016A: fade 1 time 50001E3: show_text_1number_styled GXT 'M_PASSD' number 0 time 5000 style 10051: return:AMMO1_fail00BA: show_text_styled GXT 'M_FAIL' time 5000 style 10051: return:AMMO1_cleanupif0039:   [email protected] ==  0004D: jump_if_false @AMMO1_cleanup_20164: disable_marker [email protected]:AMMO1_cleanup_200A6: destroy_car [email protected]: release_model #FORKLIFT  0164: disable_marker [email protected]: $ONMISSION = 000D8: mission_cleanup  0051: return 

 

 

The missions did not need the main.scm, because I have everything, except the sequence of missions, precisely. smile.gif

Share this post


Link to post
Share on other sites
ATM Money Man

just convert your code (trigger) into mine, it should work then because that is how Rockstar formatted the main.

 

The"Code for mission #" comments mean thats where your triggers go.

 

The globals are saved to the save file, so thread saving isn't required.

Edited by ATM Money Man

Share this post


Link to post
Share on other sites
n4z1_f0rum

So I have to change the main.scm?...

I can not be done without change main.scm?...

Share this post


Link to post
Share on other sites
ATM Money Man

No, that was in CLEO, you can just use a single trigger file, and the code I provided acts as a second Main.scm in a .cs document.

Share this post


Link to post
Share on other sites
n4z1_f0rum

Oh, ok! biggrin.gif

But the variable $MISSION_PASSED_VARIABLE is saved?

Because in normal .cs the variable are not saved... mercie_blink.gif

Share this post


Link to post
Share on other sites
ATM Money Man

It's just like when you play through an unmodded game, the Missions Passed variables are saved to the save file. The reason normal CLEO usable variables (locals) arent saved are because that, they are local variables and are only usable by the active thread, the save game doesn't keep track of how far the game has read through the thread, everytime the game is started it starts to read at the beginning and makes checks to how much the variables are, so they can check which missions are available.

 

Globals are always saved in the save file, that is how in VCS they were able to remove Lances vehicles outside of the places you do missions for him at, they just change the numbers of cars to spawn in the spawn trigger opcode, but if you use locals, your stuck with that spawn unless you know the save game format well or use a hex editor.

Share this post


Link to post
Share on other sites
n4z1_f0rum

Thank you! biggrin.gif

Starting tomorrow and see what happens! biggrin.gif

Share this post


Link to post
Share on other sites
ATM Money Man

Just only use Globals when neccessary, if you have too many that came from a single CLEO script, it will either cause problems with other mods or the main.scm, or corrupt the file.

Share this post


Link to post
Share on other sites
Deji

I'm sure the rules are, never use named/custom variables. So instead of using $MISSION_PASSED_VARIABLE use it's respective number unless it is named in Program Files\Sanny Builder 3\data\sa\CustomVariables.ini and it doesn't have ; at the start of the line (I think you can remove it to bypass that, though) wink.gif

 

 

Never, ever try to make your own variable ($MYVARIABLE).

 

 

So, you can use numbered variables from $0 to $10947 (similar to the local variable rule).

 

You can't use custom variables ($MYBEAUTIFULTHINGYMAJIG).

 

And you can use variables defined in the CustomVariables.ini - Such as "Move_Axis_X", "Special_Axis_Y", "PLAYER_ACTOR", "Import_Panel_Row". I believe Sanny Converts these to their respective numbers upon compiling wink.gif

Share this post


Link to post
Share on other sites
ZAZ

I recomand to dont use globals. They can cause bugs and crashes.

You can not be shure that it works allways without problems.

$PLAYER_CHAR, $PLAYER_ACTOR, $ONMISSION are valid.

Also I'm sceptical for those of custom.ini.

I have experince with bugs and crashs because of globals.

But I also use sometimes globals if I need it because a local wont work.

It should be a exception and you must hope that it work without problems by other users.

 

Seeman wrote in sanny help: "you can freely use global variables names from the CustomVaribles.ini" placed in sanny install dir. But I m sceptical and avoid globals in cleo. I tested $AMMU_Seller for status bar in my mission script and got a bug as I visited Ammunation.

 

Some codes are working only with globals, like staus bar or get the zone name with 0843:

Well, I believe that its possible to use global which are really only used temporarely in the main, like

0843: get_zone_at [email protected] [email protected] [email protected] nameA_to s$Current_Shop_GXT_Name

But it needs an extensive betatesting to make it shure.

 

 

 

Now is a .cs file, so if its completion is saved, when restart the game, .cs restart from beginning (obviously).

So I thought to 8 .cm, with 8 missions, and in the .cs file to run them in series.

 

I found this example (no longer find the thread, I apologize to the author) so I thought it might work:

 

Trigger:

 

{$CLEO .cs}03A4: name_thread 'mstart'0A95: enable_thread_saving0AB3: var 12 = 002A8: [email protected] = create_marker 55 at 354.982 2442.75 16.1:MissionTrigger0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTrigger00D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTriggerEndcheck0AB4: [email protected] = var 12if  and0039:   [email protected] ==  000FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTriggerEndcheck0164: disable_marker [email protected] 0004: $ONMISSION = 10A94: start_custom_mission "missions\ammo1"0002: jump @MissionTrigger:MissionTriggerEndcheck0AB4: [email protected] = var 12if0039:   [email protected] ==  1004D: jump_if_false @MissionTrigger0A93: end_custom_thread

 

 

Thats the right way, use 0A95:, 0AB3: and 0AB4:

(you found the template here)

 

 

put all your missions into one CM file and use 0AB4: to select the script internal

exemple:

 

{$CLEO .cm}:JawsM_Missions03A4: name_thread "JAWM"  0006: [email protected] =  0  // integer values0AB4: [email protected] = var 770871: init_jump_table [email protected] total_jumps  16  0 @JawsM_MS01 jumps  0 @JawsM_MS01  1 @JawsM_1  2 @JawsM_1boat  3 @JawsM_2story  4 @JawsM_MSmariapoint  5 @JawsM_3story 6 @JawsM_AB10872: jump_table_jumps  7 @JawsM_MSLighthouse  8 @JawsM_MShomebeach  9 @JawsM_MSEsplanada  10 @JawsM_MSMarina  11 @JawsM_MSIsland  12 @JawsM_MSAquarius  13 @JawsM_MS13  14 @JawsM_MS13  15 @JawsM_MS13:JawsM_MS010004: $ONMISSION =  0004E: end_thread:JawsM_1boat00BA: text_styled 'JW_A5'  5000 ms  200A0: store actor $PLAYER_ACTOR position to [email protected] [email protected] [email protected]: [email protected] =  1  // integer values0002: jump @JawsM_1:JawsM_MSmariapoint00BA: text_styled 'JW_M3'  5000 ms  20006: [email protected] =  0  // integer values0002: jump @JawsM_1:JawsM_MSLighthouse00BA: text_styled 'JW_M5'  5000 ms  20006: [email protected] =  0  // integer values0002: jump @JawsM_1:JawsM_MShomebeach00BA: text_styled 'JW_M6'  5000 ms  20006: [email protected] =  0  // integer values0002: jump @JawsM_1:JawsM_MSEsplanada00BA: text_styled 'JW_M7'  5000 ms  20006: [email protected] =  0  // integer values0002: jump @JawsM_1:JawsM_MSMarina00BA: text_styled 'JW_M9'  5000 ms  20006: [email protected] =  0  // integer values0002: jump @JawsM_1:JawsM_MSIsland00BA: text_styled 'JW_M8'  5000 ms  20006: [email protected] =  0  // integer values0002: jump @JawsM_1:JawsM_MSAquarius00BA: text_styled 'JW_M10'  5000 ms  20006: [email protected] =  0  // integer values0002: jump @JawsM_1:JawsM_MS120002: jump @JawsM_Mission2out:JawsM_MS130002: jump @JawsM_Mission2out:JawsM_Mission2out0004: $ONMISSION =  0004E: end_thread/////-----Intro:JawsM_2story0050: gosub @JawsM_2main_1 00D6: if  00112:   wasted_or_busted004D: jump_if_false @JawsM_2end_10050: gosub @JawsM_2fail_1                    :JawsM_2end_10050: gosub @JawsM_2clep_1004E: end_threadetc.....

 

 

 

 

 

The missions did not need the main.scm, because I have everything, except the sequence of missions, precisely. smile.gif

why should it need main.scm?

 

Share this post


Link to post
Share on other sites
n4z1_f0rum

Thanks! wink.gif

 

 

why should it need main.scm?

For the initial conditions of play:

-No videos starting.

-None of the main story mission.

-Initial position of CJ on the map.

-Ability of CJ to the maximum.

-Money and weapons presets.

-Unlocked all the islands.

-All shops unlocked.

-All homes purchased.

Rather than start a new game by changing the main.scm, I think I use a save file of the end game (and relative gta_sa.set for used it, then customize).

The rest of the conditions is set by Cleo3.

 

- - -

Now I can put the opcode 0A95/0AB3/0AB4 ?...

 

TRIGGER

 

{$CLEO .cs}03A4: name_thread 'M3TRIGGER'0A95: enable_thread_saving:PlayerOfLine0001: wait 100 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @PlayerOfLine0A94: start_custom_mission "m3\m3_k_99m"0A93: end_custom_thread

 

 

MISSIONS

 

{$CLEO .cm}//==========MAIN==========:M3_K_99M03A4: name_thread 'M3MISSION'0050: gosub @MISSION10050: gosub @MISSION20050: gosub @MISSION3004E: end_thread //==========S U B==========//--------Mission 1--------:MISSION1	0247: load_model #ARMYwait 500 ms0247: load_model #COLT45wait 500 ms:START1wait 100 ifPlayer.Defined($PLAYER_CHAR)else_jump @START102A8: $RADAR_3 = create_marker 26 at 420.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 26 at 420.0 2500.0 16.5 :MISSION11wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 420.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION11$ONMISSION = 1wait 1000164: disable_marker $RADAR_30164: disable_marker [email protected] 003E5: show_text_box 'MCES05A'009A: [email protected] = create_actor_pedtype 6 model #ARMY at 410.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 22 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION1wait 100 if Actor.Dead([email protected])else_jump @ACTION11Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 500$ONMISSION = 0jump @END1:ACTION11wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION1Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START1:END1Model.Destroy(#ARMY)Model.Destroy(#COLT45)0051: return //--------Mission 2--------:MISSION20247: load_model #SWATwait 500 ms0247: load_model #DESERT_EAGLEwait 500 ms:START2wait 100 ifPlayer.Defined($PLAYER_CHAR)else_jump @START202A8: $RADAR_4 = create_marker 28 at 400.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 28 at 400.0 2500.0 16.5 :MISSION21wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 400.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION21$ONMISSION = 1wait 1000164: disable_marker $RADAR_40164: disable_marker [email protected] 003E5: show_text_box 'CAT_NC'009A: [email protected] = create_actor_pedtype 6 model #SWAT at 390.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 24 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION2wait 100 if Actor.Dead([email protected])else_jump @ACTION21Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 1000$ONMISSION = 0jump @END2:ACTION21wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION2Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START2:END2Model.Destroy(#SWAT)Model.Destroy(#DESERT_EAGLE)0051: return//--------Mission 3--------:MISSION30247: load_model #SFPD1wait 500 ms0247: load_model #CHROMEGUNwait 500 ms:START3wait 100 ifPlayer.Defined($PLAYER_CHAR)else_jump @START302A8: $RADAR_5 = create_marker 13 at 380.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 13 at 380.0 2500.0 16.5 :MISSION31wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 380.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION31$ONMISSION = 1wait 1000164: disable_marker $RADAR_50164: disable_marker [email protected] 003E5: show_text_box 'MDEN_1B'009A: [email protected] = create_actor_pedtype 6 model #SFPD1 at 370.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 25 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION3wait 100 if Actor.Dead([email protected])else_jump @ACTION31Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 5000$ONMISSION = 0jump @END3:ACTION31wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION3Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START3:END3Model.Destroy(#SFPD1)Model.Destroy(#CHROMEGUN)0051: return

 

Edited by Automan

Share this post


Link to post
Share on other sites
ZAZ

 

 

- - -

Now I can put the opcode 0A95/0AB3/0AB4 ?...

 

 

yes,

 

the mission trigger

 

{$CLEO .cs}03A4: name_thread 'MSTART'0A95: enable_thread_saving0AB3: var 12 = 0:MissionTrigger_10001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @MissionTrigger_100D6: if0038:   $ONMISSION == 0004D: jump_if_false @MissionTrigger_10AB4: [email protected] = var 12if0039:   [email protected] ==  0004D: jump_if_false @MissionTrigger_3if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 354.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTrigger_30004: $ONMISSION = 10A94: start_custom_mission "M3MISSION"0002: jump @MissionTrigger_1:MissionTrigger_3if0039:   [email protected] ==  100FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 454.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTrigger_5if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 454.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTrigger_50004: $ONMISSION = 10A94: start_custom_mission "M3MISSION"0002: jump @MissionTrigger_1:MissionTrigger_5if0039:   [email protected] ==  2004D: jump_if_false @MissionTrigger_7if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 554.982 2442.75 16.1 radius 2.0 2.0 2.0004D: jump_if_false @MissionTrigger_70004: $ONMISSION = 10A94: start_custom_mission "M3MISSION"0002: jump @MissionTrigger_1:MissionTrigger_7if0039:   [email protected] ==  3  // integer values004D: jump_if_false @MissionTrigger_10A93: end_custom_thread

 

 

 

the mission script inludes 3 mission scripts:

 

{$CLEO .cm}:M3MISSION_10AB4: [email protected] = var 12if0039:   [email protected] ==  0004D: jump_if_false @M3MISSION_20002: jump @M1_1:M3MISSION_2if0039:   [email protected] ==  1004D: jump_if_false @M3MISSION_30002: jump @M2_1:M3MISSION_3if0039:   [email protected] ==  2004D: jump_if_false @M3MISSION_40002: jump @M3_1:M3MISSION_4004E: end_thread:M1_103A4: name_thread "M1"  0050: gosub @M1_main_1 00D6: if  00112:   wasted_or_busted004D: jump_if_false @M1_end_10050: gosub @M1_fail_1                    :M1_end_10050: gosub @M1_clep_1004E: end_thread:M1_main_10317: increment_mission_attempts//here starts the missionscript0004: $ONMISSION =  1054C: use_GXT_table 'MENU2P'00BC: text_highpriority 'MENU_18'  5000 ms  1:M1_110001: wait 0 msif and02D8:   actor $PLAYER_ACTOR currentweapon == 0 00E1:   key_pressed 0 17 004D: jump_if_false @M1_11:M1_pass_10AB3: var 12 = 100BA: text_styled 'M_PASS'  5000 ms  10051: return:M1_fail_100BA: text_styled 'M_FAIL'  5000 ms  10051: return:M1_clep_10004: $ONMISSION =  000D8: mission_cleanup0051: return:M2_103A4: name_thread "M2"  0050: gosub @M2_main_1 00D6: if  00112:   wasted_or_busted004D: jump_if_false @M2_end_10050: gosub @M2_fail_1                    :M2_end_10050: gosub @M2_clep_1004E: end_thread:M2_main_10317: increment_mission_attempts//here starts the missionscript0004: $ONMISSION =  1054C: use_GXT_table 'MENU2P'00BC: text_highpriority 'MENU_18'  5000 ms  1:M2_110001: wait 0 msif and02D8:   actor $PLAYER_ACTOR currentweapon == 0 00E1:   key_pressed 0 17 004D: jump_if_false @M2_11:M2_pass_10AB3: var 12 = 200BA: text_styled 'M_PASS'  5000 ms  10051: return:M2_fail_100BA: text_styled 'M_FAIL'  5000 ms  10051: return:M2_clep_10004: $ONMISSION =  000D8: mission_cleanup0051: return:M3_103A4: name_thread "M3"  0050: gosub @M3_main_1 00D6: if  00112:   wasted_or_busted004D: jump_if_false @M3_end_10050: gosub @M3_fail_1                    :M3_end_10050: gosub @M3_clep_1004E: end_thread:M3_main_10317: increment_mission_attempts//here starts the missionscript0004: $ONMISSION =  1054C: use_GXT_table 'MENU2P'00BC: text_highpriority 'MENU_18'  5000 ms  1:M3_110001: wait 0 msif and02D8:   actor $PLAYER_ACTOR currentweapon == 0 00E1:   key_pressed 0 17 004D: jump_if_false @M3_11:M3_pass_10AB3: var 12 = 300BA: text_styled 'M_PASS'  5000 ms  10051: return:M3_fail_100BA: text_styled 'M_FAIL'  5000 ms  10051: return:M3_clep_10004: $ONMISSION =  000D8: mission_cleanup0051: return

 

Edited by ZAZ

Share this post


Link to post
Share on other sites
n4z1_f0rum

Many thanks Zaz, you are the best! wink.gif

I try to put things together. smile.gif

Share this post


Link to post
Share on other sites
n4z1_f0rum

 

TRIGGER:{$CLEO .cs}03A4: name_thread 'MSTART'0A95: enable_thread_saving0AB3: var 12 = 0(...)

 

 

But if at var 12 is always 0, does not always start the Mission 1?...

If the Mission 1 was made, and the game was saved, must begin the Mission 2 when it recharge the game...

Share this post


Link to post
Share on other sites
ZAZ

 

TRIGGER:{$CLEO .cs}03A4: name_thread 'MSTART'0A95: enable_thread_saving0AB3: var 12 = 0(...)

 

 

But if at var 12 is always 0, does not always start the Mission 1?...

If the Mission 1 was made, and the game was saved, must begin the Mission 2 when it recharge the game...

These start codes will only be read by first gameload with that script.

Making a save stores then the script state.

Following gameloads let the reading process start in this loop:

:MissionTrigger_1

0001: wait 0 ms

00D6: if

0256: player $PLAYER_CHAR defined

004D: jump_if_false @MissionTrigger_1

00D6: if

0038: $ONMISSION == 0

004D: jump_if_false @MissionTrigger_1

0AB4: [email protected] = var 12

if

0039: [email protected] == 0

004D: jump_if_false @MissionTrigger_3

...

..

The value of var 12 should change in the mission_passed script

 

 

have you seen the value change in the mission_passed part?

 

:M1_pass_10AB3: var 12 = 100BA: text_styled 'M_PASS'  5000 ms  10051: return

 

Share this post


Link to post
Share on other sites
n4z1_f0rum

Yes, I do have this doubt because in the normal programming var 12 is always 0 when it start. smile.gif

However up to now I get only a crash of the game:

 

Trigger:

 

{$CLEO .cs}03A4: name_thread 'M3_K_99'0A95: enable_thread_saving0AB3: var 12 = 0:M00AB4: [email protected] = var 12:M1if0039:   [email protected] ==  00A94: start_custom_mission "m3\m3_K_991"0002: jump @M0004D: jump_if_false @M2:M2if0039:   [email protected] ==  10A94: start_custom_mission "m3\m3_K_992"0002: jump @M0004D: jump_if_false @M3:M3if0039:   [email protected] ==  20A94: start_custom_mission "m3\m3_K_993"0002: jump @M0004D: jump_if_false @M9:M90A93: end_custom_thread

 

 

Mission 1:

 

{$CLEO .cm}0247: load_model #ARMYwait 500 ms0247: load_model #COLT45wait 500 ms:START1wait 100 ifPlayer.Defined($PLAYER_CHAR)else_jump @START102A8: $RADAR_3 = create_marker 26 at 420.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 26 at 420.0 2500.0 16.5 :MISSION11wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 420.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION11$ONMISSION = 1wait 1000164: disable_marker $RADAR_30164: disable_marker [email protected] 003E5: show_text_box 'MCES05A'009A: [email protected] = create_actor_pedtype 6 model #ARMY at 410.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 22 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION1wait 100 if Actor.Dead([email protected])else_jump @ACTION11Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 500$ONMISSION = 0jump @END1:ACTION11wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION1Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START1:END1Model.Destroy(#ARMY)Model.Destroy(#COLT45)004E: end_thread

 

 

Mission 2:

 

{$CLEO .cm}0247: load_model #SWATwait 500 ms0247: load_model #DESERT_EAGLEwait 500 ms:START2wait 100 ifPlayer.Defined($PLAYER_CHAR)else_jump @START202A8: $RADAR_4 = create_marker 28 at 400.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 28 at 400.0 2500.0 16.5 :MISSION21wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 400.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION21$ONMISSION = 1wait 1000164: disable_marker $RADAR_40164: disable_marker [email protected] 003E5: show_text_box 'CAT_NC'009A: [email protected] = create_actor_pedtype 6 model #SWAT at 390.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 24 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION2wait 100 if Actor.Dead([email protected])else_jump @ACTION21Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 1000$ONMISSION = 0jump @END2:ACTION21wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION2Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START2:END2Model.Destroy(#SWAT)Model.Destroy(#DESERT_EAGLE)004E: end_thread

 

 

Mission 3:

 

{$CLEO .cm}0247: load_model #SFPD1wait 500 ms0247: load_model #CHROMEGUNwait 500 ms:START3wait 100 ifPlayer.Defined($PLAYER_CHAR)else_jump @START302A8: $RADAR_5 = create_marker 13 at 380.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 13 at 380.0 2500.0 16.5 :MISSION31wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 380.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION31$ONMISSION = 1wait 1000164: disable_marker $RADAR_50164: disable_marker [email protected] 003E5: show_text_box 'MDEN_1B'009A: [email protected] = create_actor_pedtype 6 model #SFPD1 at 370.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 25 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION3wait 100 if Actor.Dead([email protected])else_jump @ACTION31Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 5000$ONMISSION = 0jump @END3:ACTION31wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION3Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START3:END3Model.Destroy(#SFPD1)Model.Destroy(#CHROMEGUN)004E: end_thread

 

 

This is a video to understand what I'm doing:

http://www.youtube.com/watch?v=MM3v98X_e4M

Share this post


Link to post
Share on other sites
ZAZ
Yes, I do have this doubt because in the normal programming var 12 is always 0 when it start. smile.gif

However up to now I get only a crash of the game:

 

Trigger:

 

{$CLEO .cs}03A4: name_thread 'M3_K_99'0A95: enable_thread_saving0AB3: var 12 = 0:M00AB4: [email protected] = var 12:M1if0039:   [email protected] ==  00A94: start_custom_mission "m3\m3_K_991"0002: jump @M0004D: jump_if_false @M2:M2if0039:   [email protected] ==  10A94: start_custom_mission "m3\m3_K_992"0002: jump @M0004D: jump_if_false @M3:M3if0039:   [email protected] ==  20A94: start_custom_mission "m3\m3_K_993"0002: jump @M0004D: jump_if_false @M9:M90A93: end_custom_thread

 

 

 

Whats this?

 

:M1if0039:   [email protected] ==  00A94: start_custom_mission "m3\m3_K_991"0002: jump @M0004D: jump_if_false @M2

 

Don't you know how to build a conditional check?

Please read CLEO Script Tutorial - themes:

Scripting/Writing a Thread

- Using conditional checks

- The IF - Variation

- Script structure simple

- Script structure extended

- Script exemble: Slowmotion

- Spawn a 3D model

Share this post


Link to post
Share on other sites
n4z1_f0rum

sarcasm.gif Sorry, but that comment is that? ...

What I have done with my method works and is fine:

 

 

{$CLEO .cs}0000://==========MAIN==========:M3_K_99M03A4: name_thread 'M3Missions'0A95: enable_thread_savingif $M == 00050: gosub @MISSION1else_jump @M2:M2if $M == 10050: gosub @MISSION2else_jump @M3:M3if $M == 20050: gosub @MISSION3else_jump @END:END0A93: end_custom_thread//==========S U B==========//--------Mission 1--------:MISSION1	0247: load_model #ARMYwait 500 ms0247: load_model #COLT45wait 500 ms:START1wait 100 ifPlayer.Defined($PLAYER_CHAR)else_jump @START102A8: $RADAR_3 = create_marker 26 at 420.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 26 at 420.0 2500.0 16.5 :MISSION11wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 420.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION11$ONMISSION = 1wait 1000164: disable_marker $RADAR_30164: disable_marker [email protected] 003E5: show_text_box 'MCES05A'009A: [email protected] = create_actor_pedtype 6 model #ARMY at 410.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 22 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION1wait 100 if Actor.Dead([email protected])else_jump @ACTION110AB3: var 1 = 10AB4: $M = var 1Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 500$ONMISSION = 0jump @END1:ACTION11wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION1Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START1:END1Model.Destroy(#ARMY)Model.Destroy(#COLT45)0051: return //--------Mission 2--------:MISSION20247: load_model #SWATwait 500 ms0247: load_model #DESERT_EAGLEwait 500 ms:START2wait 100 ifPlayer.Defined($PLAYER_CHAR)else_jump @START202A8: $RADAR_4 = create_marker 28 at 400.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 28 at 400.0 2500.0 16.5 :MISSION21wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 400.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION21$ONMISSION = 1wait 1000164: disable_marker $RADAR_40164: disable_marker [email protected] 003E5: show_text_box 'CAT_NC'009A: [email protected] = create_actor_pedtype 6 model #SWAT at 390.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 24 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION2wait 100 if Actor.Dead([email protected])else_jump @ACTION210AB3: var 1 = 20AB4: $M = var 1Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 1000$ONMISSION = 0jump @END2:ACTION21wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION2Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START2:END2Model.Destroy(#SWAT)Model.Destroy(#DESERT_EAGLE)0051: return//--------Mission 3--------:MISSION30247: load_model #SFPD1wait 500 ms0247: load_model #CHROMEGUNwait 500 ms:START3wait 100 ifPlayer.Defined($PLAYER_CHAR)else_jump @START302A8: $RADAR_5 = create_marker 13 at 380.0 2500.0 16.50570: [email protected] = create_asset_radar_marker_with_icon 13 at 380.0 2500.0 16.5 :MISSION31wait 100 if and00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 380.0 2500.0 16.5 radius 1.0 1.0 1.0$ONMISSION == 0jf @MISSION31$ONMISSION = 1wait 1000164: disable_marker $RADAR_50164: disable_marker [email protected] 003E5: show_text_box 'MDEN_1B'009A: [email protected] = create_actor_pedtype 6 model #SFPD1 at 370.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 25 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 0 0446: set_actor [email protected] immune_to_headshots 0 02E0: actor [email protected] aggressive05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:ACTION3wait 100 if Actor.Dead([email protected])else_jump @ACTION310AB3: var 1 = 30AB4: $M = var 1Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected] Marker.Disable([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 5000$ONMISSION = 0jump @END3:ACTION31wait 100 if Actor.Dead($PLAYER_ACTOR)else_jump @ACTION3Actor.RemoveReferences([email protected])009B: destroy_actor [email protected] 03E5: show_text_box 'M_FAIL'$ONMISSION = 0jump @START3:END3Model.Destroy(#SFPD1)Model.Destroy(#CHROMEGUN)0051: return

 

 

Is what I am trying to follow you that does not work, because your method is that I do not know, not the alphabet...

But you have not seen the video?... bored.gif

Share this post


Link to post
Share on other sites
ZAZ

Yeh, ok, it's valid.

But generally I recommand do build the conditional check as a compact script snippet

and the code which should be read by positiv passing the check below of the check.

If you have more code after passing the check the elsejump instruction falls out of its meaning.

In this case you kept it compact:

 

ifActor.Dead([email protected])else_jump @ACTION110AB3: var 1 = 10AB4: $M = var 1Actor.RemoveReferences([email protected])034F: destroy_actor_with_fade [email protected]([email protected])03E5: show_text_box 'M_PASSR'Player.Money($PLAYER_CHAR) += 500$ONMISSION = 0jump @END1

 

that makes sense or not?

 

Your new script is now normal cs thread which use gosubs in successive order

Therefor it don't need globals or 0AB3:/0AB4: to select

 

Your mission script of prevoius page are also not done in mission script style

The check, if actor $PLAYER_ACTOR sphere 0 in_sphere 420.0 2500.0 16.5 should be in the mission trigger to start the mission script.

Also the radar marker. Its used to find the mission start and so it should be managed in the trigger script.

 

Basic knowledge about gta mission scripts:

 

$ONMISSION is not only a variable to check if a mission script is running or not.

Set $ONMISSION to 1 activates a special mission mode if some important conditions are accomplished.

R*s mission scripts run allways in a subroutine which will be cancled from the exe if player is wasted or busted like reading a return code in the script.

 

1. At first it needs to set $ONMISSION equal to on_mission_flag

 

0180: set_on_mission_flag_to $ONMISSION// Note: your missions have to use the variable defined here

 

 

This code is set by default in the main part of the original main.scm

 

2. By starting the mission script must sended the reading precess with a gosub command into a subroutine for the main part of the mission script.

It must be the first gosub of the mission script.

 

 

0050: gosub @Miss_main_1

 

 

3. By starting the mission script must be activated the onmission mode with

 

 

0004: $ONMISSION =  10317: increment_mission_attempts//here starts the missionscript

 

 

 

Then the mission is running in a subroutine and dont needs to check if player is defined or dead or busted.

If player dies or get busted, the exe cancels the subroutine as like as a return code of our script is read

 

Summary:

 

:MISSION1 03A4: name_thread "M1"  0050: gosub @MISSION11//---------first gosub to run the mission 00D6: if  00112:   wasted_or_busted004D: jump_if_false @M1_end_10050: gosub @M1_fail_1                    :M1_end_10050: gosub @M1_Cleanup_1004E: end_thread:MISSION110317: increment_mission_attempts//here starts the missionscript0004: $ONMISSION =  1//----mission script sub routine//---this subroutine will be canceled from the exe in case if player is wasted or busted//--the exe cancel is eqaul to a return code in the script//-- Also you can cancel the main mission script sub routine by set the return code//-- so let the code jump to a mission passed script part which ends with a return in case if the actor is killed by player 00BA: text_styled 'M_PASSD' 5000 ms  1Player.Money($PLAYER_CHAR) += 5000051: return//--If the  main mission script sub routine ends because of 0051: return or because the exe have canceled it//---the next gosub will be read which is written in the mission script head//---but at first the code must pass the if wasted_or_busted check//--this check selects if the mission fail subroutine should be read or not//--at the end should the reading process read a cleanup script which release the created stuff from game engine// it makes sense to do it this wayAllways 3 parts- main subroutine with mission passed codes and return at the end- mission fail part- mission cleanup part// it dont need subroutines for reading a fail script or cleanup script0050: gosub @M1_fail_1 0050: gosub @M1_Cleanup_1// you can it also put it directly after the  wasted_or_busted check:MISSION1 03A4: name_thread "M1"  0050: gosub @MISSION11//---------first gosub to run the mission 00D6: if  00112:   wasted_or_busted004D: jump_if_false @M1_end_100BA: text_styled 'M_FAIL'  5000 ms  1                    :M1_end_10164: disable_marker [email protected]([email protected])0249: release_model #ARMY  0249: release_model #COLT450004: $ONMISSION =  000D8: mission_cleanup004E: end_thread:MISSION110317: increment_mission_attempts//here starts the missionscript0004: $ONMISSION =  1

 

 

 

Here is now your mission trigger and the mission script

 

trigger script:

 

{$CLEO .cs}03A4: name_thread 'M3_K_99'0A95: enable_thread_saving0AB3: var 12 = 00AB4: [email protected] = var 1202A8: [email protected] = create_marker 26 at 420.0 2500.0 16.5:M00001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @M000D6: if0038:   $ONMISSION == 0004D: jump_if_false @M00AB4: [email protected] = var 12:M1if0039:   [email protected] ==  0004D: jump_if_false @M2if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 420.0 2500.0 16.5 radius 1.0 1.0 1.0004D: jump_if_false @M20A94: start_custom_mission "M3Mission"0AB4: [email protected] = var 120004: $ONMISSION = 10002: jump @Mission_Loop:M2if0039:   [email protected] ==  1004D: jump_if_false @M3if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 400.0 2500.0 16.5 radius 1.0 1.0 1.0004D: jump_if_false @M30A94: start_custom_mission "M3Mission"0AB4: [email protected] = var 120004: $ONMISSION = 10002: jump @Mission_Loop:M3if0039:   [email protected] ==  2004D: jump_if_false @M0if00FF: actor $PLAYER_ACTOR 1 near_point_3d_on_foot 380.0 2500.0 16.5 radius 1.0 1.0 1.0004D: jump_if_false @M00A94: start_custom_mission "M3Mission"0AB4: [email protected] = var 120004: $ONMISSION = 10002: jump @Mission_Loop:Mission_Loop0001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @Mission_Loop00D6: if0038:   $ONMISSION == 0004D: jump_if_false @Mission_Loop0AB4: [email protected] = var 12if803B:   not [email protected] == [email protected] // (int) 004D: jump_if_false @M0//----jump instruction by mission fail/var 12 didn't changed/radar marker also don't changeif0039:   [email protected] ==  1004D: jump_if_false @Mission_Loop_20164: disable_marker [email protected]: [email protected] = create_marker 26 at 400.0 2500.0 16.5:Mission_Loop_2if0039:   [email protected] ==  2004D: jump_if_false @Mission_Loop_30164: disable_marker [email protected]: [email protected] = create_marker 26 at 380.0 2500.0 16.5:Mission_Loop_3if0039:   [email protected] ==  3  // integer values004D: jump_if_false @M00164: disable_marker [email protected]: end_custom_thread

 

 

the trigger starts allways M3Mission.cm (Cleo\M3Mission.cm)

 

the M3Mission.cm script:

 

{$CLEO .cm}:M3_K_99M0AB4: [email protected] = var 12if0039:   [email protected] ==  0004D: jump_if_false @M20002: jump @MISSION1 :M2if0039:   [email protected] ==  1004D: jump_if_false @M30002: jump @MISSION2:M3if0039:   [email protected] ==  2004D: jump_if_false @END0002: jump @MISSION3:END004E: end_thread:MISSION1 03A4: name_thread "M1"  0050: gosub @MISSION11 00D6: if  00112:   wasted_or_busted004D: jump_if_false @M1_end_10050: gosub @M1_fail_1                    :M1_end_10050: gosub @M1_Cleanup_1004E: end_thread:MISSION110317: increment_mission_attempts//here starts the missionscript0004: $ONMISSION =  10247: load_model #ARMY0247: load_model #COLT45:MISSION11_loadcheck0001: wait 0 msif and0248:   model #ARMY available 0248:   model #COLT45 available 004D: jump_if_false @MISSION11_loadcheck03E5: show_text_box 'MCES05A'009A: [email protected] = create_actor_pedtype 6 model #ARMY at 410.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 22 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 00446: set_actor [email protected] immune_to_headshots 005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:M1_ACTION_10001: wait 0 msifActor.Dead([email protected])004D: jump_if_false @M1_ACTION_10002: jump @M1_pass_1:M1_pass_10AB3: var 12 = 100BA: text_styled 'M_PASSD' 5000 ms  1Player.Money($PLAYER_CHAR) += 5000051: return:M1_fail_100BA: text_styled 'M_FAIL'  5000 ms  10051: return:M1_Cleanup_10164: disable_marker [email protected]([email protected])0249: release_model #ARMY  0249: release_model #COLT450004: $ONMISSION =  000D8: mission_cleanup0051: return:MISSION203A4: name_thread "M2"  0050: gosub @MISSION21 00D6: if  00112:   wasted_or_busted004D: jump_if_false @M2_end_10050: gosub @M2_fail_1                    :M2_end_10050: gosub @M2_Cleanup_1004E: end_thread:MISSION210317: increment_mission_attempts//here starts the missionscript0004: $ONMISSION =  10247: load_model #SWAT0247: load_model #DESERT_EAGLE:MISSION21_loadcheck0001: wait 0 msif and0248:   model #SWAT available 0248:   model #DESERT_EAGLE available 004D: jump_if_false @MISSION21_loadcheck03E5: show_text_box 'CAT_NC'009A: [email protected] = create_actor_pedtype 6 model #SWAT at 390.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 24 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 00446: set_actor [email protected] immune_to_headshots 005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:M2_ACTION_10001: wait 0 msifActor.Dead([email protected]) 004D: jump_if_false @M2_ACTION_10002: jump @M2_pass_1:M2_pass_10AB3: var 12 = 200BA: text_styled 'M_PASSD' 5000 ms  1Player.Money($PLAYER_CHAR) += 10000051: return:M2_fail_100BA: text_styled 'M_FAIL'  5000 ms  10051: return:M2_Cleanup_10164: disable_marker [email protected]([email protected])0249: release_model #ARMY  0249: release_model #COLT450004: $ONMISSION =  000D8: mission_cleanup0051: return:MISSION303A4: name_thread "M3"  0050: gosub @MISSION31 00D6: if  00112:   wasted_or_busted004D: jump_if_false @M3_end_10050: gosub @M3_fail_1                    :M3_end_10050: gosub @M3_Cleanup_1004E: end_thread:MISSION310317: increment_mission_attempts//here starts the missionscript0004: $ONMISSION =  10247: load_model #SFPD10247: load_model #CHROMEGUN:MISSION31_loadcheck0001: wait 0 msif and0248:   model #SFPD1 available 0248:   model #CHROMEGUN available 004D: jump_if_false @MISSION31_loadcheck03E5: show_text_box 'MDEN_1B'009A: [email protected] = create_actor_pedtype 6 model #SFPD1 at 370.0 2500.0 16.50173: set_actor [email protected] Z_angle_to [email protected] = Marker.CreateAboveActor([email protected])01B2: give_actor [email protected] weapon 25 ammo 999902E2: set_actor [email protected] weapon_accuracy_to 50223: set_actor [email protected] health_to 1004D8: set_actor [email protected] drowns_in_water 00446: set_actor [email protected] immune_to_headshots 005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR:M3_ACTION_10001: wait 0 msifActor.Dead([email protected])004D: jump_if_false @M3_ACTION_10002: jump @M3_pass_1:M3_pass_10AB3: var 12 = 300BA: text_styled 'M_PASSD' 5000 ms  1Player.Money($PLAYER_CHAR) += 50000051: return:M3_fail_100BA: text_styled 'M_FAIL'  5000 ms  10051: return:M3_Cleanup_10164: disable_marker [email protected]([email protected])0249: release_model #SFPD1    0249: release_model #CHROMEGUN0004: $ONMISSION =  000D8: mission_cleanup0051: return

 

 

 

 

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
n4z1_f0rum

Wow! My master, now I'm happy as a baby to a Luna Park! biggrin.gif

 

It can use a .cm for each mission, or necessarily to one .cm?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.