Skip to content

Set Variable

Set Variable changes what the story remembers without asking the player for text or a choice.

Use Insert > Dialogue & Logic > Change Variable for route flags, counters, affinity points, unlocks, and short pieces of state that later conditions should read.

Properties

Node-specific properties

Field What it does
Variable Variable this node changes.
Operation Operation allowed for the selected variable kind.
Value, Append Text, or Amount Operand used by the operation when one is needed.

Inherited/common properties

Field What it does
Name Optional label used in the editor and Story Map. Leave it empty to use VNC's automatic node name.
Next Node that runs after this node finishes its own work.

Operations

Variable kindOperations
TextSet, Append
NumberSet, Increase, Decrease
True/FalseSet, Toggle

If older project data contains an invalid operation for the variable kind, VNC treats it as Set. You should still fix the field in Properties so the route is clear.

Runtime Behavior

When the node runs, VNC reads the current variable value, applies the operation, stores the result, then continues to Next.

If the selected variable is missing, the node cannot update story state. Properties and Output should point you toward the missing variable before runtime testing. For variable kinds and templates, see Variables & Text.

Examples

GoalSetup
Seed a scoreNumber variable score, operation Set, value 1, then set Next to the next node in your route.
Mark a route openTrue/False variable hasBadge, operation Set, value true, then set Next to the next node in your route.
Add route progressNumber variable score, operation Increase, amount 2, then set Next to the next node in your route.
Append to route textText variable routeLog, operation Append, append text ->archive, then set Next to the next node in your route.
Flip a simple flagTrue/False variable hasBadge, operation Toggle, next a condition that checks hasBadge with Is True or Is False.

Set Variable nodes are quiet, but they make later branches meaningful. Name them clearly when the route depends on them.