If, loops, timers
Actions run from top to bottom. To branch, repeat or wait, use the actions in the If, loops, timers category.
Branching with If
If runs one list of actions when its conditions hold (Then) and another when they don't (Else). Put an If inside Else for Else If.
Conditions use variables. Number variables can be compared, and several conditions can be combined with all or any one. For a condition on the whole card, use the conditions in the card's Advanced settings instead of If.
Loops
| Action | Repeats |
|---|---|
| Repeat | a set number of times |
| For Each | once for each item of a list variable |
| While | while its conditions hold |
For Each is how you act on a list of objects: put actions that target the item variable under Do, and they run for every item.
Make While end
If nothing under While changes the variable in its condition, the loop never ends and the trigger stops working.
Inside loops, Break leaves the loop and Continue skips to the next round. Return skips the rest of the event's actions.
Timers
The Timer event runs every few seconds.
- Every: the seconds; with Random, a different time between the shortest and longest each round
- Runs: repeatedly or once
- Start right away: when off, it waits for a Start Timer action
Give the timer a name, and pick that name in Start Timer and Stop Timer. Timers keep running when the object is hidden; to stop one then, put Stop Timer in OnDisable (under Advanced in Detailed mode).
Delays
Delay in a card's Advanced settings runs its actions a few seconds after the event. Send Event Delayed calls a named event a few seconds later.