See in Sanny Builder > Help > CLEO 3 opcodes how them opcodes work.
Var 1 till var 99 is possible
Example starter pack(next mission using vars):
Here I'm going to show how they work in mission starter and the mission.
Var 1 till var 99 is possible
Example starter pack(next mission using vars):
Here I'm going to show how they work in mission starter and the mission.
- Code:
{$CLEO}
0A95: enable_thread_saving // Save
0AB3: var 15 = 0 // Okay, we have set the value to 0
:MissionStarter_0
0001: wait 250 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @MissionStarter_0
00D6: if
0038: $ONMISSION == 0 // integer values
004D: jump_if_false @MissionStarter_0
:MissionStarter_1
0AB4: 31@ = var 15
00D6: if
0039: 31@ == 0 // integer values
004D: jump_if_false @NextMission // If is not equal to 0 then we go on to the next starter pack script
:MissionStarter_2
0001: wait 250 ms
00D6: if and
0038: $ONMISSION == 0 // integer values
00FF: actor $PLAYER_ACTOR sphere 1 in_sphere -1643.9039 -2235.2317 29.7644 radius 2.0 2.0 2.0 on_foot
004D: jump_if_false @MissionStarter_2
0004: $ONMISSION = 1
00BA: text_styled ' ' 1000 ms 2
0A94: start_custom_mission " "
0002: jump @MissionStarter_0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Next Mission Starter //
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
:NextMission
0AB4: 31@ = var 15
00D6: if
0039: 31@ == 1 // integer values
004D: jump_if_false @Both_Mission_Passed_End_Thread // Jump if this mission is also passed
:MissionStarter2_1
0001: wait 250 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @MissionStarter2_1
00D6: if
0038: $ONMISSION == 0 // integer values
004D: jump_if_false @MissionStarter2_1
:MissionStarter2_2
0001: wait 250 ms
00D6: if and
0038: $ONMISSION == 0 // integer values
00FF: actor $PLAYER_ACTOR sphere 1 in_sphere -1643.9039 -2235.2317 29.7644 radius 2.0 2.0 2.0 on_foot
004D: jump_if_false @MissionStarter2_2
0004: $ONMISSION = 1
00BA: text_styled ' ' 1000 ms 2
0A94: start_custom_mission " "
0002: jump @MissionStarter_0
:Both_Mission_Passed_End_Thread
0A93: end_custom_thread
- Code:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// In Mission 1 //
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
{$CLEO .cm}
0AB4: 31@ = var 15
00D6: if
0039: 31@ == 0 // integer values
004D: jump_if_false @SecondMission // Next Mission script
:Mission
0050: gosub @MissionStart1
00D6: if
0112: wasted_or_busted
004D: jump_if_false @MissionEnd1
0050: gosub @MissionFailed1
:MissionEnd1
0050: gosub @MissionCleanup1
004E: end_thread
:MissionStart1
//.......Mission Script.......//
:MissionPassed1 // This bit is the passed part
0AB3: var 15 = 1 // Is now set to 1, so the game does now know that one mission has been passed
// Or you can do it the way I do:
0AB4: 31@ = var 15
000A: 31@ += 1 // integer values
0AB3: var 15 = 31@
// Use only one!
0051: return
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// In Mission 2 //
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
:SecondMission
0050: gosub @MissionStart2
00D6: if
0112: wasted_or_busted
004D: jump_if_false @MissionEnd2
0050: gosub @MissionFailed2
:MissionEnd2
0050: gosub @MissionCleanup2
004E: end_thread
:MissionStart2
//.......Mission Script.......//
:MissionPassed2 // This bit is the passed part
0AB3: var 15 = 2 // Is now set to 2, so the game does now know that two missions has been passed
// Or you can do it the way I do again:
0AB4: 31@ = var 15
000A: 31@ += 1 // integer values
0AB3: var 15 = 31@
// Use only one!