UI name in toolbox: when ... then
Definition: A WHEN-THEN block executes one or more actions the moment a connected condition becomes true.
What it does:
- Monitors a Boolean condition continuously
- Executes all action statements in the
theninput when condition becomes true - Actions execute in the order they appear
How to build it:
- Drag the
when ... thenblock from the Logic category - Insert a Boolean condition into the
whensocket - Insert action blocks into the
thenstatement input - Connect multiple actions vertically in the
thensection if needed
Block structure:
wheninput: must accept a Boolean type conditiontheninput: accepts statement blocks (actions) sequentially- Previous/next connectors: can chain multiple
when ... thenblocks
Important note: This block has no else branch.
Example (Simple):
Condition: timer > [0] h [10] min [0] s
Result: open [task 5] for answering
Example (Chaining multiple actions):
Condition: [task 3] finished
Result:
open [task 4] for answeringshow [task 4] on mapfinish
(All three actions execute in order when Task 3 finishes)
Example (Edge Case – Multiple when-then blocks):
Multiple WHEN-THEN blocks can monitor the same condition:
- Block 1: When Task 3 finishes → Open Task 4
- Block 2: When Task 3 finishes → Show Task 4 on map
Both blocks trigger independently when the condition is true.
Common mistakes:
- Expecting WHEN-THEN to execute only once (it re-evaluates continuously)
- Placing action blocks outside a WHEN-THEN block (then they execute at game start)
- Forgetting that condition must be Boolean type