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.

Using goto and Jump Labels

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:

  1. If self.enemy.hp > 0, the script jumps to the skip_over label, bypassing the line self.enemy.set_state("die").
  2. The script resumes execution at the jump label.