Missions in CLEO
Mission must have a starter pack this thread will call the mission from the *.cm file
The starter pack Must have the *.cs extension. In CLEO Use the opcode 0A94: to start the mission
Write the name of the mission file your starting.
Example:
Example: Of how to start creating a mission. Say if you save your mission script as "MyMission.cm" In the starter pack you would start mission as
MyMission
How to put a mission in main.scm
1: Find
Note: If you're using modded main.scm or whatever the number maybe different.
Up the number by 1 (You're putting one mission in)
2: At the end of the DEFINE MISSION list
After your list put,
(Note: If you're using modded main.scm then it may be not 135 which is the next number).
3: Create your start pack
Demonstration:
This goes before Mission 0
After the LAST mission of you're main.scm write you're mission in.
Demonstration:
*Notes*
Creating a mission is tough for beginners, you should learn first, how a normal thread is created correctly, creating missions needs advanced knowledge of scripting, if you must try a mission for whatever reason, make it as easy as possible.
Mission must have a starter pack this thread will call the mission from the *.cm file
The starter pack Must have the *.cs extension. In CLEO Use the opcode 0A94: to start the mission
Write the name of the mission file your starting.
Example:
- Code:
{$CLEO .cs}
:Start_Pack_00
03A4: name_thread 'StartP'
:restart
0001: wait 0 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @restart0
00D6: if
0038: $ONMISSION == 0
004D: jump_if_false @restart0
:Noname1
00D6: if
00FE: actor $PLAYER_ACTOR sphere 1 near_point X.Y.Z radius 2.0 2.0 2.0
004D: jump_if_false @Noname1
00BA: text_styled 'Mission_Name' 1000 ms style 2
0004: $ONMISSION = 1
0A94: start_custom_mission "CM_Files_Name_Goes_Here"
:restart0
0002: jump @restart
Example: Of how to start creating a mission. Say if you save your mission script as "MyMission.cm" In the starter pack you would start mission as
MyMission
- Code:
{$CLEO .cm}
03A4: name_thread 'NoName'
0050: gosub @Noname2
00D6: if
0112: wasted_or_busted // mission only
004D: jump_if_false @Noname1
0050: gosub @Failed_End
:Noname1
0050: gosub @Mission_End
004E: end_thread
:Noname2
0317: increment_mission_attempts
0004: $ONMISSION = 1
//-----------------------------------------------------//
// Mission Script
//-----------------------------------------------------//
:Failed_End
00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1 // ~r~MISSION FAILED!
0051: return
:Passed_End
01E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1 // MISSION PASSED!~n~~w~$~1~
0051: return
:Mission_End
0004: $ONMISSION = 0
00D8: mission_cleanup
0051: return
How to put a mission in main.scm
1: Find
- Code:
DEFINE MISSIONS 135
Note: If you're using modded main.scm or whatever the number maybe different.
Up the number by 1 (You're putting one mission in)
2: At the end of the DEFINE MISSION list
After your list put,
- Code:
DEFINE MISSION 135 AT @Name // Your Mission's name
(Note: If you're using modded main.scm then it may be not 135 which is the next number).
3: Create your start pack
Demonstration:
- Code:
004F: create_thread @StartP // With the other create_threads commands
This goes before Mission 0
- Code:
:StartP
03A4: name_thread 'StartP'
:restart
0001: wait 0 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @restart0
00D6: if
0038: $ONMISSION == 0
004D: jump_if_false @restart0
:Noname1
00D6: if
00FE: actor $PLAYER_ACTOR sphere 1 near_point X.Y.Z radius 2.0 2.0 2.0
004D: jump_if_false @Noname1
00BA: text_styled 'Mission_Name' 1000 ms style 2
0004: $ONMISSION = 1
0417: start_mission 135 // Mission defined number
:restart0
0002: jump @restart
After the LAST mission of you're main.scm write you're mission in.
Demonstration:
- Code:
:Your_Defined_Mission_Name // Put you're missions defined name here....
03A4: name_thread 'Name' // Put a name here....
0050: gosub @Noname2
00D6: if
0112: wasted_or_busted // mission only
004D: jump_if_false @Noname1
0050: gosub @Failed_End
:Noname1
0050: gosub @Mission_End
004E: end_thread
:Noname2
0317: increment_mission_attempts
0004: $ONMISSION = 1
//-----------------------------------------------------//
// Mission Script
//-----------------------------------------------------//
:Failed_End
00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1 // ~r~MISSION FAILED!
0051: return
:Passed_End
01E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1 // MISSION PASSED!~n~~w~$~1~
0051: return
:Mission_End
0004: $ONMISSION = 0
00D8: mission_cleanup
0051: return
*Notes*
Creating a mission is tough for beginners, you should learn first, how a normal thread is created correctly, creating missions needs advanced knowledge of scripting, if you must try a mission for whatever reason, make it as easy as possible.