Variables, rewards and reusable logic
On this page
Keep puzzle facts in variables, then use a visual or text script when a decision is needed. A list is an ordered set of instructions; it does not gain a branch just because an action returns false.
Set Variable#
ID: SetVariable | Shared list / GUI · Visual graph · Text action wrapper · Timeline
Assign a value to a runtime game variable. This replaces its previous value and can create the runtime entry if it does not exist.
| Field / stored key | What to enter | Starting value |
|---|---|---|
| Variable name | Choose a game variable name. Custom values are accepted. | Blank |
| Value value | A value of the type required by the selected variable, operation or property. | true |
In use. Set powered to true when the lever is used. Use a Boolean value, not the text "true". In the room/object inspector, choose Change Variable with Operation set to Set instead.
Create Variable#
ID: CreateVariable | Native inspector · Shared list / GUI · Visual graph · Text action wrapper
Create a variable only when that name is absent. It is an initializer, so calling it again does not reset an existing value.
| Field / stored key | What to enter | Starting value |
|---|---|---|
| Variable ID name | Text. | Blank |
| Type variableType | Choose: string, boolean, number, array. | "string" |
| Initial Value value | A value of the type required by the selected variable, operation or property. | Blank |
In use. Create visits with a numeric value of 0, then increment it on room entry. Define long-lived puzzle variables in the Variable Designer so their starting values are easy to find. The variableType field is descriptive; do not rely on it to convert bad input.
