Skip to content

Jump Labels

Grisgram edited this page Jul 14, 2025 · 7 revisions

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) starting with a colon :, as you know it from command shells.

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.

Clone this wiki locally