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 are the foundation of logic in Talescape, used to control visibility, track progress, and make the world react to player choices.
1. What Variables Do
Variables allow you to:
- Track what decisions the player made.
- Record progress through scenes or puzzles.
- Enable or disable dialogue, triggers, or items.
- Control branching paths or alternate outcomes.
All variables are global, meaning they are available everywhere in your story.
2. Types of Variables
Talescape supports three basic types:
| Type | Description | Example Use |
|---|---|---|
| Flag | True or false value. Used for yes/no decisions. | “Has the player opened the chest?” |
| Number | Stores a numeric value. Used for counting, scoring, or progress tracking. | “How many keys does the player have?” |
| String | Stores text values such as codes or names. | “Which door was chosen?” |
3. Creating Variables
You can add new variables in the Variables panel. Each variable includes:
| Field | Description |
|---|---|
| Type | Flag, Number, or String. |
| Default Value | The starting value when the story begins. |
| Description | A short label describing what the variable represents (e.g., “Player has the lantern”). |
Talescape automatically handles all internal naming and IDs. You don’t need to worry about naming conventions or formatting.
4. Changing Variables
Variables are changed through actions or triggers during gameplay.
| Action | Description |
|---|---|
| Set Variable | Assign a new value. |
| Increase / Decrease | Add or subtract from a number. |
| Toggle Flag | Switch a flag between true and false. |
Once a variable is changed, the new value is stored immediately and persists throughout the story.
5. Checking Variables
Variables are used in conditions to decide whether something should happen. For example:
- A dialogue option can appear only if a flag is true.
- A trigger can activate only if a number is above a certain value.
- An item can become visible only when a specific variable matches a text string.
6. Testing Variables
During testing, open the Debug Menu to view and edit variable values in real time. You can:
- See all currently defined variables.
- Adjust their values to test different story paths.
- Reset them to their default values at any time.
7. Common Uses
| Purpose | Example |
|---|---|
| Track player choices | “Has the player helped the fisherman?” |
| Control story branches | “Which path did the player take?” |
| Count resources | “How many shells were collected?” |
| Store story states | “Current phase of the investigation.” |
8. Best Practices
- Keep descriptions clear so you can recognize variables easily later.
- Use flags for simple yes/no logic and numbers for cumulative progress.
- Clean up unused variables regularly to keep your story organized.
- Use the Checks System to detect undefined or unused variables before publishing.
Variables make your story dynamic. They allow Talescape to remember what happened and to react accordingly. They are the backbone of Conditions, Actions, and every piece of interactive storytelling in your project.