Coin Collector
Pays the coin values on the grid when a collector symbol lands, the cash-collect step. A maths node that also compiles to the RGS; stateless and seedless.
Wire Reels from Weighted Reels reels, or from the output grid of Sticky Symbols or Hold And Win Grid, and Value Grid from Symbol Value Grid valueGrid built from the same grid. Every cell with a positive value is a coin, whatever symbol the reels show there; every cell showing Collector Symbol is a collector, 0 meaning none. Fire Do after both grids are ready.
With Require Collector on, nothing is paid unless at least one collector landed; off, the coins pay on every spin. collected is the sum of the coin values, multiplied by the number of collectors when Multiply By Collectors is on, rounded to minor units, or 0 when not paid. totalOnGrid always reports the sum; coinPositions, coinCount, collectorPositions and collectorCount describe both sets, with positions as [row, col] pairs; hasCollector and paid are booleans, not signals.
Add collected to the round win, for example with Addition on Calculate Winnings spinWinnings, and wire coinPositions to pixi.CellOverlay cells or a fly-to-collector animation. A missing or short Value Grid simply counts as no coins. On an empty or ragged Reels grid the node logs the error, writes it to inspect data, empties every output and still fires Done.
Inputs
Parameters
| Data | Description |
|---|---|
| Reels (array) | The landed grid, reels[col][row]; collectors are found here. |
| Value Grid (array) | Coin value per cell from Symbol Value Grid valueGrid; a positive entry is a coin. Missing cells count as no coin. |
| Collector Symbol (number) | Symbol id that collects; 0 = no collector, so nothing pays while Require Collector is on. Default 0. |
| Require Collector (boolean) | When on, coins pay only if a collector landed; when off, they pay every spin. Default on. |
| Multiply By Collectors (boolean) | When on, the total is multiplied by the number of collectors on the grid. Default off. |
Actions
| Signal | Description |
|---|---|
| Do | Runs the node. |
Outputs
Events
| Signal | Description |
|---|---|
| Done | Fires when the node has finished, on success and failure alike. |
Results
| Data | Description |
|---|---|
| Collected (number) | Amount paid this spin in minor units; 0 when a collector is required and none landed. |
| Total On Grid (number) | Sum of every coin value on the grid in minor units, paid or not. |
| Coin Positions (array) | The coin cells as [row, col] pairs. |
| Coin Count (number) | Number of coin cells. |
| Collector Positions (array) | The collector cells as [row, col] pairs. |
| Collector Count (number) | Number of collectors on the grid. |
| Has Collector (boolean) | True when at least one collector landed. A boolean, not a signal. |
| Paid (boolean) | True when the coins were paid this spin. A boolean, not a signal. |
Usage
- Wire Weighted Reels
reelsinto Symbol Value Grid and into this node's Reels. - Wire Symbol Value Grid
valueGridinto Value Grid and set Collector Symbol. - Fire Do from Symbol Value Grid Done.
- On Done, add
collectedto the round win and branch onpaid.