Variables
Variables are named values that your story remembers as the player plays through it — they’re the “memory” of your story, used to track state and steer the player down different paths.
Creating variables
Open the Variables tab in the right-hand panel. Click + Create variable to add a new one, then set its:
- Name — used to reference the variable from blocks.
- Type — one of:
string— textint— whole numbersfloat— decimal numbersbool— true/false
Click the trash icon next to a variable to delete it.
Every player who starts your story gets their own copy of these variables — they all start at the same default value and change independently as each player makes choices.
Reading and writing variables
Variables are used by all of the blocks:
| Block | What it does with variables |
|---|---|
| Text | Can display a variable’s value inside its text — see below. |
| User Input | Saves the player’s typed answer into a variable (save_to); can also display variables in its prompt/hint. |
| Set Variable Value | Sets a variable to a fixed value. |
| Change Variable Value | Adds/subtracts a number from an int/float variable. |
| Variable Router | Branches the story based on a variable’s current value. See Variable Router conditions. |
Displaying variables in text
To show a variable’s current value to the player, wrap its name in double
curly braces: {{variable_name}}. You can use this inside a
Text block’s text, or a
User Input block’s prompt/hint.
For example, if a string variable named name holds "Alex", the text:
Hello, {{name}}!is shown to the player as:
Hello, Alex!While editing, the placeholder is highlighted blue if the variable exists, or
red if it doesn’t (likely a typo). If the variable doesn’t exist at all when
the story is played, the placeholder is replaced with
[variable name is not found].
Example
A simple “trust” system:
- Create an
intvariable namedtrust. - Whenever the player makes a kind choice, connect it to a
Change Variable Value block with
variable_name = trustanddelta = 1. - Later in the story, add a Variable Router
on
trustwith choices>5(friendly ending) and!999999(neutral ending, catch-all) to send the player down a different path based on how they played. - Anywhere else in the story, write
Your trust level is {{trust}}.to show the player their current score.