Logic » Variables
March 13, 2026

Variables

Work in Progress

This documentation is still being expanded and refined. Features, screenshots, and descriptions may change until Talescape's public release. If something is unclear or you need help, please ask on the official Talescape Discord. We're happy to clarify or update pages as needed.

Variables store information about what has happened in your story and what the player has done. They allow the game to remember choices, track progress, and control how the world reacts.

Variables are the foundation of logic in Talescape. They are commonly used to control dialogue options, trigger events, unlock items, or determine which scenes become available.

All variables are global, meaning they can be accessed from anywhere in your story.

1. Creating Variables

Variables are created in the Variables panel. Each variable includes the following settings:

  • Name: A descriptive label used to identify the variable in the editor.
  • Type: Determines what kind of value the variable stores.
  • Starting Value: The value assigned when the story begins.

The starting value is optional. If no value is provided, the variable starts empty or at its default value.

2. Choice Variables

2. Choice Variables

Choice variables store a simple true or false value. They are used for yes or no decisions and are the most common type of variable.

Typical uses include:

  • Tracking whether the player performed a specific action.
  • Recording decisions made during dialogue.
  • Unlocking events or dialogue options.

Example uses:

  • Has the player opened the chest?
  • Did the player help the fisherman?
  • Is the cave entrance guarded?

Choice variables can be switched between true and false through actions or events.

3. Number Variables

3. Number Variables

Number variables store numeric values. They are useful when you need to track counts, scores, or progression values.

Typical uses include:

  • Tracking collected resources
  • Counting how many times something happened
  • Managing currencies or points

Example uses:

  • How many keys does the player have?
  • How much money has been collected?
  • How many clues were discovered?

Number variables can be increased, decreased, or set to a specific value during gameplay.

4. Text Variables

4. Text Variables

Text variables store short pieces of text. They are useful when you need to remember names, codes, or selections made by the player.

Typical uses include:

  • Storing the player's chosen name
  • Recording which option was selected
  • Saving codes or identifiers

Example uses:

  • Player name
  • Selected faction
  • Entered door code

Text variables can be updated whenever a new value needs to be stored.

5. Using Variables

Variables are used throughout the editor to control how the story behaves.

They can be used to:

  • Show or hide dialogue options
  • Activate triggers and events
  • Control branching story paths
  • Unlock scenes, items, or interactions

Whenever a variable changes, the new value is stored immediately and remains active for the rest of the playthrough.

6. Testing Variables

6. Testing Variables

During testing, you can open the Debug Menu to inspect and modify variables in real time.

This allows you to:

  • view all variables currently used in the story
  • change values to test alternate paths
  • reset variables to their starting values

This makes it easier to test complex branching logic without replaying the entire story.

7. Best Practices

  • Use Choice variables for simple yes or no decisions.
  • Use Number variables for counters, resources, or progress tracking.
  • Use Text variables only when you need to store actual text values.
  • Keep variable names descriptive so they remain easy to understand later.
  • Remove unused variables to keep your project organized.

Variables allow Talescape to remember what happened and react accordingly. They form the backbone of conditions, actions, and every branching path in your story.