Rules Editor
Rules Editor
The Rules Editor draws a table’s rules as a node graph so you can see how the machine reacts to play. It shows two families of rule side by side — autofire rules (a switch driving a coil, like a flipper button firing the flipper coil) and scoring rules (a trigger awarding points and changing game state) — plus the tag groups that bundle devices together. Against the live engine you can also author scoring rules directly, with undo/redo.
The graph mirrors the table’s real rules: you don’t hand-draw connections, and the shape is derived, not free-form. See Node Editor Basics for the shared canvas gestures.
What the nodes mean
Nodes sit in two bands — sources on the left, actions on the right — in five kinds:
| Node | Kind | Meaning |
|---|---|---|
| Device trigger ⊙ | source | A switch or device that fires a rule — an autofire switch (hold/pulse) or a scoring rule’s device slot. |
| Event trigger ⚡ | source | A scoring rule fired by a bare game event (no physical device), such as a mode or lifecycle event. |
| Tag group ◈ | hub | A named bundle of devices from the table’s tag groups; the subtitle counts its members. |
| Coil action ⊗ | action | The coil an autofire rule fires (coil · hold or coil · pulse). Inspect only. |
| Scoring rule ◆ | action | A trigger → score rule. The only editable node. |
A tag group that no rule references is shown muted, parked in a lane below the connected graph so it’s clearly unused.
View modes
The toolbar’s segmented control switches how the same rules are laid out:
- ◈ Tags (default) — device groups → the actions they drive; unused tag groups sit in a muted lane below.
- ⟶ Flow — role bands left-to-right (sources → actions); each rule reads as one horizontal line.
- ◎ Focus — the selected node plus only its direct neighbors. In Focus mode, clicking any node re-centers on it. Right-clicking a node and choosing Focus ◎ also enters this view, pinned on that node.
A filter box narrows the graph to nodes matching your text (pulling in their direct neighbors so edges still make sense) and shows a “N shown” count. Node positions you drag are remembered per view and per table until you choose Reset layout (from the ⚙ Options menu or the empty-canvas context menu, which also offers Fit to view ⤢).
Live vs. sample
Normally the graph reads the running table. Append ?sample to the page URL
to load a fixed illustrative sample instead — useful for looking around the
interface without touching a real table. Editing is live-only: in sample mode
the authoring buttons don’t appear and the page is a pure viewer, which is the
quickest way to tell which one you’re in.
When the Rules Editor is docked inside the 3D geometry editor, selection is two-way linked: clicking a node highlights its devices in the scene, and selecting devices in the scene lights the matching nodes. A non-dismissible amber warning appears if a rule references a device the geometry editor no longer has.
Authoring scoring rules (live)
The add-node toolbox sits open in the canvas’s top-left corner, and keeps its filter and expander state as you switch between the Tags, Flow, and Focus views.
With the live engine attached and a scoring-rule node selected, the toolbar exposes rule-editing commands (all other node kinds are inspect-only):
| Command | What it sets |
|---|---|
| + Rule | Create a rule — name and trigger (e.g. device.bumper.hit) required, points optional. |
| Rename | Change the rule’s name. |
| Points | The score awarded (e.g. 1000). |
| Condition | A gate expression like var.frenzy_active > 0; blank = always fires. |
| Emit | An event to emit after scoring, like event.jackpot_lit; blank = none. |
| Updates | One var = expr per line (e.g. combo = var.combo + 1); blank clears all. |
| Delete | Remove the rule. |
You can also double-click a scoring-rule node to re-point its trigger inline. Right-clicking any node opens a context menu with Focus ◎ (enter Focus view on it), Copy rule string ⧉, and Reset this node’s position ⤺ (disabled until you’ve moved it); scoring-rule nodes add Edit trigger ✎, the menu equivalent of the double-click re-point.
Edits are validated by the engine. A rejected edit surfaces the engine’s exact reason in a red banner and the graph re-renders from what the engine actually accepted — so the diagram never drifts from reality. Undo (Ctrl/Cmd+Z) and Redo (Ctrl/Cmd+Shift+Z) cover every edit, including add and delete.
Tip — in the Condition, Emit, and Updates forms, an empty field clears that aspect of the rule; canceling the dialog leaves the rule untouched.