Skip to Content
Editor GuideVariables

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 — text
    • int — whole numbers
    • float — decimal numbers
    • bool — 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:

BlockWhat it does with variables
TextCan display a variable’s value inside its text — see below.
User InputSaves the player’s typed answer into a variable (save_to); can also display variables in its prompt/hint.
Set Variable ValueSets a variable to a fixed value.
Change Variable ValueAdds/subtracts a number from an int/float variable.
Variable RouterBranches 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:

  1. Create an int variable named trust.
  2. Whenever the player makes a kind choice, connect it to a Change Variable Value block with variable_name = trust and delta = 1.
  3. Later in the story, add a Variable Router on trust with choices >5 (friendly ending) and !999999 (neutral ending, catch-all) to send the player down a different path based on how they played.
  4. Anywhere else in the story, write Your trust level is {{trust}}. to show the player their current score.