Jump Labels - coldrockgames/doc-scriptor GitHub Wiki
To address some of the single-line limitations in Scriptor, the goto
command provides a valid way to navigate and control code flow, similar to command shell scripts.
goto
and Jump Labels
Using The goto
command requires a target, which is defined using jump labels.
What is a Jump Label?
A jump label is any word (without spaces) followed by a colon :
Here is an example:
if self.enemy.hp > 0 goto skip_over
self.enemy.set_state("die")
skip_over: <-- this is the jump label
// continue with the script
In this example:
- If
self.enemy.hp > 0
, the script jumps to theskip_over
label, bypassing the lineself.enemy.set_state("die")
. - The script resumes execution at the jump label.