Symbol Upgrade
Swaps every occurrence of one symbol for another while an upgrade is active, for symbol upgrade and transform features. A stateful maths node that also compiles to the RGS.
Wire Reels from Weighted Reels reels or from the Variable that holds the evolving grid. Fire Activate to start an upgrade that lasts Duration calls, 0 meaning until Reset. While active, every call writes To Symbol over every From Symbol in a copy of the grid and emits it on reels; both ids must be positive or nothing is swapped, though the timer still runs.
The call that activates already applies the swap and counts as one of the Duration calls, so fire Activate on the triggering spin and Do on each following spin. remaining reports the calls left, -1 for an open-ended upgrade, and active drops on the call that uses the last one. upgradedCount is the number of cells swapped by this call and changed is true when it is above zero.
Turn Activate On Do on to re-arm the upgrade on every call: the swap then never lapses and Reset is overridden in the same call, so use it only for a permanent transform. On the server the same rule applies per round: the upgrade activates when Activate fired or Activate On Do is set, and Reset is a boolean for the round.
Write the reels output back to the grid Variable and let the win evaluator and the display read that variable, or the maths scores a grid the player never saw. The state is the timer; it persists across rounds for identified players only, so for a guest a multi-spin upgrade lasts one round. On an empty or ragged grid the node logs the error, writes it to inspect data, empties every output, keeps its state and still fires Done.
Inputs
Parameters
| Data | Description |
|---|---|
| Reels (array) | The grid to rewrite, reels[col][row], from Weighted Reels reels or the grid Variable. |
| From Symbol (number) | Symbol id to replace; 0 = nothing is swapped. Default 0. |
| To Symbol (number) | Symbol id written over every From Symbol; 0 = nothing is swapped. Default 0. |
| Duration (calls, 0 = until reset) (number) | Calls the upgrade lasts, counting the activating call; 0 = until Reset. Default 0. |
| Activate On Do (boolean) | When on, every call re-arms the upgrade for Duration calls, so it never lapses. Default off. |
Actions
| Signal | Description |
|---|---|
| Do | Runs the node. |
| Activate | Starts the upgrade for Duration calls and applies the swap to the grid on Reels at once. |
| Reset | Clears the node's state and starts again. |
Outputs
Events
| Signal | Description |
|---|---|
| Done | Fires when the node has finished, on success and failure alike. |
Results
| Data | Description |
|---|---|
| Reels (array) | The grid with every From Symbol swapped for To Symbol while active; unchanged otherwise. |
| Active (boolean) | True while the upgrade is still running after this call. |
| Remaining (number) | Calls left after this one; -1 = until Reset; 0 when inactive. |
| Upgraded Count (number) | Cells swapped by this call. |
| Changed (boolean) | True when at least one cell was swapped. A boolean, not a signal. |
Usage
- Wire the grid Variable into Reels and set From Symbol and To Symbol.
- Set Duration to the number of spins the upgrade lasts, counting the triggering spin.
- Fire Activate on the spin that triggers the upgrade, then Do on each following spin.
- On Done, write
reelsback to the Variable and score it. - Fire Reset if the feature ends early.