Most automations are richer when ARC can remember something. How many wrong codes were entered? Which letters are on the readers? Is the secret door open? Variables and constants give a game a small memory and a little math, so automations can count, compare, and react.
Both live in the Editor: open your game, go to the Logic tab, and switch to its Variables or Constants sub-tab — they sit alongside Automations and Scenes. They’re game-scoped: each belongs to one game and is available to that game’s automations and scenes.
Variables
A variable is a named value that can change while a game runs. Your automations can read it, compare it in a condition, and change it with an action.
Types
Every variable has a type. Pick the one that fits what you’re storing.
| Type | Holds | Example |
|---|---|---|
| String | Text | "DEFENSE" |
| Number | Whole numbers and decimals | 3, 12.5 |
| Boolean | True or false | true |
| List | An ordered set of values | ["red", "blue"] |
| Map | Named slots of values | { "north": "open", "south": "shut" } |
Start value
Each variable has a Start value — what it holds when the game loads. A wrong-code counter starts at 0; a “door open” flag starts at false. ARC sets the variable to its start value at the beginning, and your automations take it from there.
What happens on game reset
Each variable carries a When the game resets choice:
- Reset to the start value — return to the start value you set. A counter goes back to
0. - Recompute from its formula — for formula variables, work the value out again from scratch.
- Clear it (empty) — empty the variable to its type’s blank:
"",0,false, an empty list, or an empty map. - Keep the current value — leave it exactly as it was at the end of the last session.
Pick reset behavior per variable
You set the reset choice on each variable individually. Most counters and flags want Reset to the start value; the rare value you want to carry across sessions wants Keep the current value.
Showing a variable to staff
Two switches decide whether a variable reaches the control page at all:
- Show on control page — when on, the variable appears in the control page’s Variables section, its value updating live. When off, staff never see it.
- Allow editing on the control page — when on, staff also get a pencil to change the value mid-game. Saving takes effect immediately and can trigger automations, so use it sparingly.
Formula variables are read-only wherever they appear.
Formula variables
A formula variable works its value out automatically from other values. You write an expression once, and ARC keeps the variable up to date whenever anything it depends on changes. Formula variables are read-only — automations can’t write to them, because the formula owns the value. They carry a Formula badge in the variables table.
An expression can reference other values by their ID, wrapped in braces:
{variable.id}— another variable’s current value{constant.id}— a constant’s value{device.id.state}— a device’s current state
You combine those references with:
- Math:
+-*/% - Comparisons:
==!=<<=>>= - Logic:
andornot - A choice:
if(condition, a, b)— useawhen the condition is true, otherwiseb
For example, a formula like if({variable.wrong-codes} >= 3, true, false) flags when a team has missed the code three times. ARC recomputes it the instant the counter changes, and any automation watching that flag reacts straight away.
Missing pieces are forgiving
If a formula references a value that isn’t set yet — an empty reader slot, say — that piece is treated as blank rather than throwing an error, so a partly-filled puzzle still computes cleanly.
Constants
A constant is a fixed, named value that never changes during a game. It’s the read-only sibling of a variable: same five types (String, Number, Boolean, List, Map), but you set the value once in the editor and no action can change it.
Constants are perfect for lookup tables and fixed settings. A classic example is a spell-a-word lock: a Map constant pairs each reader’s tag ID with the letter it represents, and a formula variable looks up letters in that constant to build the word. The mapping never changes, so it’s a constant; the assembled word does change as tags move, so it’s a (formula) variable.
Changing a variable from an automation
In an automation’s Do column, the variable actions update a value as the room plays out. The available moves depend on the variable’s type.
| Action | Works on | What it does |
|---|---|---|
| Set | Any | Set the variable to a value (a literal, another value, or a formula result). |
| Adjust | Number | Add to (or subtract from) the current number. |
| Toggle | Boolean | Flip true to false, or false to true. |
| Reset | Any | Return the variable to its start value. |
| Clear | Any | Empty the variable to its blank value. |
| Append | String | Add text to the end of the current text. |
| Add / Remove item | List | Add an item to the list, or remove one. |
| Insert / Remove at | List | Add or remove an item at a specific position. |
| Clear list | List | Empty the list. |
| Set / Remove key | Map | Set or remove a named slot in the map. |
| Clear map | Map | Empty the map. |
A common pattern is a wrong-code counter: a Device state trigger on the keypad’s “wrong” signal runs an Adjust action that adds 1 to a number variable, and a separate automation watches that variable with a condition like “greater than or equal to 3” to offer a nudge.
Formula variables are read-only
You can’t point a variable action at a formula variable — its value comes from its expression. Change the values the formula reads, and the formula updates itself.
Where to go next
- Game automations — use a variable in a condition or change it with an action.
- Devices — the device states a formula can read.
- Scenes — reusable sequences that can set values too.