Effect: Change variable value
EffectNo. 9239
Synopsis
Choose the variable, who it affects and the operation: add, subtract, multiply, divide (whole-number division), modulo or set a minimum or maximum. Dividing by zero changes nothing. It does not create the variable: give it first with Effect: Give variable. In a stack, giving, changing and removing variables always run in that order, regardless of height.
Step by step
Add 5 points on every step
Boxes you need
- TriggerTrigger: Step on an object
- AddonAddon: Variable value in text
- EffectEffect: Change variable value
- EffectEffect: Give variable
- EffectEffect: Show message
- Place a walkable object A. Create a user variable “points”, with a value and duration while in the room; save.
- Stack “Walks on object”, “Give variable”, this effect, “Variable text” and “Show message”. Select A in the trigger.
- In “Give variable” choose Users, “points”, triggering user and initial value 0 without overwrite. In “Change value” choose the same variable and user, Add operation and fixed value 5.
- In “Variable text” use identifier “points”, Users, the “points” variable, triggering user, Numeric and Single. Set the message to “You have $(points) points”, for the triggering user.
- Save every box with delay 0. Step on A twice, stepping off between visits.
Result: The first step shows 5 points and the second shows 10.
Settings

Notes
- Change value does not create the variable, which is why the stack also gives it. Giving, changing and preparing the text follow a fixed order independent of box height.
- Effect: Change variable value doesn't create the variable: you need Effect: Give variable first.
- Inside a stack the order is fixed: give → change → remove →
$(…)is read → messages → signal. It doesn't depend on height. - Dividing by 0 and modulo 0 change nothing. Division is integer division.
- “Set minimum” is a floor and “set maximum” is a ceiling.
Related
- Trigger: Step on an object
- User variable
- Effect: Give variable
- Addon: Variable value in text
- Effect: Show message
Used in these recipes










