SCRMaps
/
Sign in

Order and the trigger cycle

The same trigger gives a different result depending on where it sits.

2 min read

Each cycle, triggers are evaluated player by player from P1 to P8, and within a player from the top of the file down. Not knowing this order is how you end up with bugs you cannot reproduce.

Say one trigger adds one to a counter and another fires when that counter hits 120. With the adder above, both happen in the same cycle; with it below, the second fires a cycle late.

If A writes a value and B reads it in the same cycle, the order of those two triggers is the specification. Re-sorting your trigger file later will silently change behaviour.

Keep interdependent triggers next to each other, and leave a comment saying why they are in that order.

Sign in to track your progress