10. Pick the right change operation
Set Variable replaces the complete value. Change Variable offers a choice of operations, so it is the useful action for counters, toggles and list additions. Choose the operation according to the kind of data you are keeping.
| Operation | Example | Result or rule |
|---|---|---|
| set | score 7; set 10 | Replaces 7 with 10. For an Array, replaces the whole list. |
| add | score 7; add 10 | 17. Adds the numeric amount. |
| subtract | score 7; subtract 2 | 5. No automatic minimum of zero. |
| multiply | score 7; multiply 2 | 14. Numeric multiplication. |
| divide | score 7; divide 2 | 3.5. A divisor of zero leaves the value unchanged. |
| append | clues ["note"]; append "key" | ["note", "key"]. Adds one member to an Array. |
| toggle | clock_wound False; toggle | True. Use this with an intended Boolean. |
Choose actions that match the meaning#
To mark a puzzle solved, Set Variable → true is usually clearer than toggle. If the player uses the solved object again, a toggle would turn the flag back off. Toggle fits a switch that is meant to alternate between on and off.
Append is an Array operation. It is not a text-joining command, and it does not prevent duplicate members. If you append an Array, the new member is that Array, nested inside the first one. To replace an entire list, choose set.
Add Score is also available as a separate action. It targets the score value and uses an integer amount. Change Variable → add lets you work with any chosen numeric variable.
The declared designer type is guidance for authoring and validation. It is not a hard lock on every runtime assignment. An action can still write text into a variable you intended to be a Number. Consistent inputs and play tests matter.
