Test the gate with 1, 2 and 3 tickets
On this page
WORKED CASE / TICKET GATE
The workbench phone runs the visual script gate_route on each completed digit. Its rule is “at least two tickets.” Success sets paid to 1. The graph leaves tickets unchanged.
Read the two exits#
True goes to the orange Set Variable node. False goes to End. Neither route removes an inventory item.
The shipped Ticket gate visual script. The output labels on the left node identify each branch.
Start a Trace with the workbench open. In State, type global.tickets in the 1 watch field, enter 1 in New JSON scalar, and choose Set watched global. Repeat with global.paid and 0.
Return focus to the preview phone and complete one digit. In State, evaluate 2 global.paid, then global.tickets. Repeat the whole test with 2 and 3 tickets. Reset paid to 0 before each attempt.
| Starting tickets | Expected successor | Paid afterward | Tickets afterward |
|---|---|---|---|
| 1 | no → End | 0 | 1 |
| 2 | pay → Set Variable | 1 | 2 |
| 3 | pay → Set Variable | 1 | 3 |
Why all three tests matter#
A rule using > instead of >= rejects exactly two. A rule using == accepts two but rejects three. A stale paid flag from the previous trial can hide either bug.
