Variables, Conditions and Actions
Use variables to remember viewers' choices and progress, conditions to decide when connections, options and components apply, and actions to change variables, then watch the values in preview.
Variables remember the choices viewers make and how far they have come, for example how much "Courage" they have or whether they "Opened the letter". Conditions read variables to decide which connection to follow or which option to show; actions change variables when viewers make a choice or a component triggers. Together they let one drama lead to different endings depending on what each viewer did.
Before you start
- Sign in and open an interactive drama project in the editor.
- Editing variables, conditions and actions does not use credits.
- Team viewers can view but not edit.
Create and manage variables

Switch to the node view in the editor and open the Variables tab on the left.
Click New variable and choose a type: Number, Boolean or Enum. New variables get numbered default names, such as Variable1.
Rename the variable on its card and press Enter or click elsewhere to confirm, then set its Initial value and other options.
Options on a variable card:
- Scope: a Per save variable only lasts for the current viewing; a Cross-save variable is kept across restarts and rewinds, which you can use for second-playthrough content. See Cross-save variables and second playthroughs.
- Expose: when on, host pages that embed the work receive changes to this variable.
- Initial: the variable's value when a viewer starts watching.
- Number variables can have a Range (Min and Max). The value always stays within the range and is always a whole number.
- Enum variables list the values they can take under Values; keep at least one.
A variable name cannot be empty, duplicate another name, or contain braces or line breaks. Names and the number of variables both have limits, and the interface tells you when you exceed them. When you rename a variable, text that references it is updated too.
While writing a condition or action in the story graph, you can also click New variable right there, then rename it and set its initial value in the Variables tab later.
Delete a variable
Click Delete variable on the variable card. If the variable is still used by a condition, action or text, the interface lists where it is used; remove those references first, then delete it.
Series variables
When an episode belongs to a series, the series' variables are listed at the bottom of the Variables tab. You can use them in conditions and actions, but to change their definitions, click Edit in series. See Series.
Display identity
Number and Boolean variable cards also have display identity settings (Enum variables don't). When Show changes during playback is on for a number variable, each change in its value during playback is shown on screen according to its display identity.
On the variable card, turn on Show changes during playback.
If you like, click Apply a preset and choose Romance, Court power, Mystery clues, Survival horror or Quiz and learning to fill in the settings below in one go; you can still change each one afterwards.
Set Display name (up to 8 characters; the variable name is used when it's empty), Icon, Color, Character and Show as as needed.
- Show as: Number shows how much it changed, Direction only shows only up or down, and Hidden shows nothing.
- With a Character filled in, the change is shown as that character's relationship change.
- Variables without Show changes during playback don't show their changes to viewers.
- When the work has Master mode turned on in the player look, only relationship changes and "remembered" notes remain. See Chapter title cards, first-time tips and master mode.
Write conditions

Conditions appear in these places:
- A connection's Condition: select a connection in the story graph and set it in the properties panel.
- A component's Show when: the component only appears while the condition holds. For Passive trigger and Random components, the field is Run when.
- An option's Show when and Enable when: they decide whether the option appears and whether it can be chosen.
Click Add condition and pick a variable under Variable.
Choose how to compare and enter a value. Number variables compare with a whole number using =, ≠, >, ≥, < or ≤. For Boolean variables choose is true or is false. For Enum variables choose equals or not equal and one of its values.
To combine several conditions, choose Match all or Match any for the group. Click Add group to nest groups, and turn on Negate to make the group hold only when its conditions do not.
- You can also add Reached ending… and Unlocked achievement… conditions, which check the endings a viewer has reached and the achievements they have unlocked in earlier viewings. They are often used for second-playthrough content; see Cross-save variables and second playthroughs.
- Components and options without a condition show Always.
- If the project has no variables yet, the condition editor says No variables yet. Create one, then add conditions.
Branch on conditions
One exit can have several connections. The properties panel lists them by priority, and you can reorder them with Move up and Move down. When a viewer reaches the exit, the first connection whose condition holds is followed. A connection without a condition is the Fallback, used when none of the other conditions hold.
- If an exit only has conditional connections and no fallback, the checks flag it.
- An exit with weights picks a connection at random in proportion to the weights, and those connections cannot have conditions.
For the other connection properties, see Story Graph.
Change variables with actions

Actions appear in these places:
- A connection's Actions: run when a viewer follows the connection.
- The actions of interactive components such as options and hotspots: run when a viewer makes the choice or triggers the component.
- The Actions of a Passive trigger component: run when playback reaches its start time on the timeline.
Click Add action and choose Change variable.
Choose the variable and the operation. A Number variable can be Set, or you can Add, Subtract, Multiply or Divide it by a whole number, or pick a Random whole number in a range. For a Boolean variable choose Set true or Set false. For an Enum variable set one of its values.
- Actions run one after another in the order they are listed.
- The result for a Number variable is rounded to a whole number and kept within the variable's range; dividing by 0 leaves the variable unchanged.
- Click Remove action to delete an action.
The action menu also has Unlock achievement; see Achievements. On interactive components and Passive trigger components, you can add actions such as Open link, Call phone, Map navigation and Open Mini Program as well; connections do not offer these actions. See Marketing components and actions.
From variable and effects
- For Number variables, Set, Add, Subtract, Multiply and Divide can switch Fixed value to From variable, which calculates with another number variable's current value; a summary such as "Roll + Strategy" appears below the row. For example, first have "Roll" take a Random value from 1 to 20, then Add From variable "Strategy" to "Roll". The result is still rounded and kept within the variable's range; if the referenced variable doesn't exist or isn't a number, the action doesn't run and the checks flag the variable as used incorrectly.
- The action menu also has Effect; see Effects and reduced motion.
Items
A Boolean variable can be turned into an item with Mark as item: fill in Item name, Icon and Description, and choose whether it's Consumable (gone after use). The variable being true means the viewer holds the item, and conditions check it as usual. Items are picked up at investigation spots and used on spots or hotspots, and viewers see them in the item bar. See Items.
Show variables in text
In a text component, write {name} with the variable's name to show its current value during playback, for example "Courage: {Courage}".
The progress bars inserted by the Faction HUD recipe show where the bound number variable's current value sits within its range. See Radar charts and faction HUDs.
Watch variables in preview
In the preview, switch to Debug. The Variables tab on the right shows each variable's current value, and you can change values temporarily to try different branches. See Debug mode.
Check the result
- The Variables tab lists every variable with its type, scope and initial value.
- In the story graph, connections with conditions show a short summary of the condition; the other connections from the same exit that have no condition show Fallback.
- Open the checks panel and make sure there are no variable problems, such as a variable used incorrectly, an exit without a fallback, or a variable that no condition, action or text uses. See Checks.
Limits and FAQ
- You cannot delete a variable that is still in use: remove the references listed by the interface first.
- Number variables only hold whole numbers.
- A comparison that refers to a variable that no longer exists counts as not holding.
- Weighted exits cannot be combined with conditions. To branch on conditions, route through a router node first.
Related pages
Was this page helpful?