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 then input when condition becomes true
  • Actions execute in the order they appear

How to build it:

  1. Drag the when ... then block from the Logic category
  2. Insert a Boolean condition into the when socket
  3. Insert action blocks into the then statement input
  4. Connect multiple actions vertically in the then section if needed

Block structure:

  • when input: must accept a Boolean type condition
  • then input: accepts statement blocks (actions) sequentially
  • Previous/next connectors: can chain multiple when ... then blocks

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:

  1. open [task 4] for answering
  2. show [task 4] on map
  3. finish

(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

Tagged: