This one is from the scripting tut I written like the "Mission Template"
Creating a thread: (main.scm) Note: Any changes to main will require you to start a NEW GAME
Open up main.scm
find command
After or before these commands add to it you're create thread command:
Now find:
After this is where the first mission starts, so BEFORE this insert you're thread:
Now note if you end the thread with 004E: the game will only read this thread once,
for the thread to be in a loop you must repeat the script with 0002:
(above code, will only be read once, the one I'm going to show now is in a loop)
Because the thread is in a loop, a wait within the loop is necessary, otherwise BOOM! (the game will crash!)
The thread now will repeat it's self, so make sure you don't put stuff which should only be read once within the script.
Note:
You do not necessary have to name the thread, but you will find that it's best to name them.
Empty string is also allowed:
Numbers are also allowed. Max character's allowed is 16.
Creating a thread: (main.scm) Note: Any changes to main will require you to start a NEW GAME
Open up main.scm
find command
- Code:
create_thread
After or before these commands add to it you're create thread command:
- Code:
004F: create_thread @thread // You can name this label anything, of course.
Now find:
- Code:
//-------------Mission 0---------------
After this is where the first mission starts, so BEFORE this insert you're thread:
- Code:
:thread // Must match the name, of what you created the thread with.
03A4: name_thread ' ' // You can name this with anything (max is 16)
// Here goes you're script contents
004E: end_thread
Now note if you end the thread with 004E: the game will only read this thread once,
for the thread to be in a loop you must repeat the script with 0002:
(above code, will only be read once, the one I'm going to show now is in a loop)
- Code:
:thread // Must match the name, of what you created the thread with.
03A4: name_thread ' ' // You can name this with anything (max is 16)
:thread_01
0001: wait 0 ms
// Here goes you're script contents
0002: jump @thread_01
Because the thread is in a loop, a wait within the loop is necessary, otherwise BOOM! (the game will crash!)
The thread now will repeat it's self, so make sure you don't put stuff which should only be read once within the script.
Note:
You do not necessary have to name the thread, but you will find that it's best to name them.
Empty string is also allowed:
- Code:
03A4: name_thread ' '
Numbers are also allowed. Max character's allowed is 16.