#
Router
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.
-> Finish
// This label is jumped.
@ Story
// The script flow moves to this label.
@ Finish
#
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.
$ courage = 1
- Alice | ? {courage} >= 5 | -> Flee
I will fight
$ x = 1
@ Mylabel | ? {x} == 0 | -> MyOtherLabel
$ move = off
-> Mylabel | ? {move} == on | -> MyOtherLabel
$ coins = 25
$ End | ? {coins} >= 50 | -> Pay
In Option statements, a router instruction is executed when that option is selected.
- .
You're flanked.
* Be brave and stay | -> Fight
* Be cautious and try to leave | -> Flee
See also
A covert label has the same behavior as a standard label, except that a covert label won't play unless explicitly called by a
If you are a beginner with Quillscript Plugin, this article helps you start from scratch.
Labels are markers in specific points of your script flow. They are used as routing points to navigate from one point of the script to another,...
Labels and Routers can be used to create common code loops like a while, for and for each loop.
Another essential element for games with story branching is asking the player what they want to do or say in a specific situation.