Skip to content

Variables & Text

Variables are how the runtime remembers story state. They let a story remember things like the player’s name, a selected route, a score, or whether a badge has been earned.

This is the page to read if a field says Store In Variable and you are not sure what happens next.

Each variable has two important labels:

The stable key used by nodes and text templates.

Example: playerName

When you reference a variable in story text, use the Variable Key, not the display name.

Nice to meet you, {playerName}!

If playerName currently stores Bobo, the runtime shows:

Nice to meet you, Bobo!
KindUse it forCommon nodes
stringNames, selected option IDs, route labels, short text values.Text Input, Choice, Dialog text, Set Variable, Condition.
numberScores, counters, trust values, timers, progress values.Set Variable, Condition.
booleanFlags such as hasBadge, metCharacter, unlockedRoute.Set Variable, Condition, locked choice options.

The default value must match the kind. A boolean variable needs true or false, a number variable needs a number, and a string variable needs text.

Store In Variable means “when this node finishes, write a value into this variable.”

Text Input

Stores the player’s typed response in a string variable.

Choice

Stores the selected option ID in a string variable when Store Selection In Variable is set.

  1. Create a string variable with key playerName.
  2. Add a Text Input node.
  3. Set Store In Variable to playerName.
  4. Add a Dialog node after it.
  5. Use {playerName} in the Dialog text.

Example dialog text:

Nice to meet you, {playerName}!

The Text Input node does not automatically create a character. It only stores text. You can then reuse that text in dialog, title cards, prompts, or a character’s displayed speaker name.

A Choice node can store the option the player picked.

  1. Create a string variable with key favoriteColor.
  2. Add a Choice node.
  3. Add options with IDs like red, green, and blue.
  4. Open the Choice node’s Advanced section.
  5. Set Store Selection In Variable to favoriteColor.
  6. Use a Condition node later to check favoriteColor equals red.

The stored value is the option ID, not the option text. This is intentional. Option text can be rewritten for players, while option IDs stay stable for conditions and saves.

Set Variable uses a different operation list depending on the selected variable kind:

KindOperationsOperand
stringset, appendset uses Value. append uses Append Text.
numberset, increment, decrementincrement and decrement use Amount.
booleanset, toggletoggle has no value field.

If an operation is missing or invalid for the kind, the runtime normalizes it to set. That keeps old data from crashing, but you should still fix the warning or field before release.

Use {variableKey} in supported text fields. Variable keys must start with a letter or underscore and then use letters, numbers, or underscores.

Common places include:

  • Dialog text.
  • Text Input prompt and placeholder.
  • Choice prompt, option text, and locked text.
  • Title card text.
  • Character display names.

If a variable is missing or has no value, the runtime leaves the template visible. For example, {playerName} stays {playerName} if no variable value exists.

The runtime converts string, number, and boolean values to text when it resolves the template.

Characters can use a string variable as their runtime display name.

  1. Create a string variable, such as playerName.
  2. Use a Text Input node to store the player’s typed name in that variable.
  3. Select the character in the Characters tab.
  4. Set Name From Variable to playerName.
  5. Use that character as a Dialog speaker.

At runtime, the speaker name uses the variable value when it is not empty. If the variable is empty, the character falls back to its normal name.