-> Router

Navigation controllers

Routers are navigation controllers to move from one point of the story to a given label, by name. Its main functionality is control where the story should move to, based on player choices, variable values, and custom code.

A Router statement starts with a -> (Dash and Greater Than), immediately followed by a space.


Router as Instruction

A Router can also be concatenated to other statements and used as an instruction.

In Dialogue, Label, Command, and Other Router statements, a router instruction is executed only if the statement conditions fail.

Dialogue
$ courage = 1

- Alice | ? {courage} >= 5 | -> Flee
  I will fight
Label
$ x = 1

@ Mylabel | ? {x} == 0 | -> MyOtherLabel
Router
$ move = off

-> Mylabel | ? {move} == on | -> MyOtherLabel
Command
$ coins = 25

$ End | ? {coins} >= 50 | -> Pay

In Option statements, a router instruction is executed when that option is selected.

Option
- .
  You're flanked.

* Be brave and stay            | -> Fight
* Be cautious and try to leave | -> Flee

Last updated