Jump

Jump to a different label in your script

Description

'jump <label_id>'

The jump action moves script execution to a different label. This is essential for creating branching narratives, chapters, and non-linear story structures.

Action ID: Jump

Reversible: Yes

Requires User Interaction: No

Parameters

Name
Type
Optional
Description

label_id

string

No

The name of the label to jump to.

Behavior

When a jump action is executed:

  1. Validates that the target label exists

  2. Stops any ambient audio

  3. Records the jump in history (source and destination)

  4. Changes the current label and resets step to 0

  5. Clears the dialog (unless in NVL mode)

  6. Executes the first statement of the new label

Basic Usage

Branching with Choices

The jump action is commonly used with choices to create branching paths:

Organizing Large Scripts

Use labels to organize your script into logical sections:

HTML Data Attribute

You can trigger jumps from HTML elements using the data-jump attribute:

When clicked, this will execute jump SpecialScene.

Error Handling

If the target label doesn't exist, the engine will display an error showing:

  • The target label that wasn't found

  • All available labels in your script

  • The current location in your script

Rollback Behavior

The jump action records history to support the back button:

  • Pressing back after a jump returns to the source label and step

  • The jump history tracks both source and destination

  • Label history is also maintained for proper rollback

[!NOTE] While jump is technically reversible, complex jump sequences may have unexpected rollback behavior. Test your back button functionality when using multiple jumps.

Examples

Conditional Jumps with Functions

Loop Back Pattern

  • End - End the game

  • Wait - Pause execution

  • Clear - Clear the text box

  • Choices - Present choices to the player

Last updated

Was this helpful?