Gates ›
Control Flow ›
Counter
Counter
Increase advances the saved Output through 0 to Count minus 1 and wraps to 0. Decrease moves the other way and wraps to Count minus 1.
Diagram
Ports drawn from the source data: inputs left, outputs right, config inside.
How it's used
Keeps a number that steps up (or down) each time it gets a pulse, wrapping back to 0 at the top. The backbone of step-sequences and multi-state switches.
- Cycle a light or animation through a set of frames/positions
- A button that steps through modes: off → low → high → off
- Round-robin selector (pick the next spawn, next target, etc.)
Count button presses, wrapping at 4
- Place a Button and a Counter gate.
- Set the Counter's Count property to 4 (it will output 0,1,2,3 then wrap to 0).
- Wire the Button's press output → the Counter's Increase (Exec) input.
- The Counter's Output now steps 0→1→2→3→0… on each press.
Documented: Output advances 0..Count-1 and wraps. The Counter also has a Decrease (Exec Down) input to step backward. Exact button output port name varies by button type — verify in-game.
Technical details — ports, config & source
Wire inputs
Wires you feed into the gate.
| Display name | Type | Tooltip |
|---|---|---|
| Count | int | No tooltip in source |
| Exec | exec | No tooltip in source |
| Exec Down (ExecDown) | exec | No tooltip in source |
Wire outputs
Wires the gate produces.
| Display name | Type | Tooltip |
|---|---|---|
| Exec Out (ExecOut) | exec | No tooltip in source |
| Exec Out Down (ExecOutDown) | exec | No tooltip in source |
| Output | int | No tooltip in source |
Configuration properties
Set on the gate itself in its properties panel — not wired. Distinct from inputs.
| Display name | Type | Tooltip |
|---|---|---|
| Value | int | No tooltip in source |
Source details
- Brick asset
- B_1x1_Gate_Exec_Cycle
- Component class
- BrickComponentType_Exec_Cycle
- Kind
- exec
- Family
- —
- Search tags
- cycle counter count increment increase decrement decrease wrap index
- Half size
- 5 × 5 × 2