Variant Selector
Picks one maths variant, such as an RTP set, a market or a regional build, out of a variants object and unpacks its reel strips, weights and paytable for wiring. A maths node: it runs in the editor preview and compiles to the RGS.
Variants is an object keyed by variant name, { key: { reelStrips, symbolWeights, paytable, paytableScale, rtp, ... } }; a JSON string is parsed too. Key selects the variant; wire it from Bet Mode mode, or from a Component Inputs port carrying the market code (Jurisdiction Rules jurisdictionCode in the browser). When that key is missing, Fallback Key is tried. With an empty Key the first variant in the object is used; a key that is set but missing, with no usable fallback, selects nothing.
On Do: variant (the whole object), selectedKey, found (a boolean, not a signal) and keys (every key in Variants, found or not), plus the common fields unpacked for wiring: reelStrips to Weighted Reels reelStrips, symbolWeights to Weighted Reels or Directional Cascade symbolWeights, paytable to Calculate Winnings paytable or Paytable Modifier paytable, paytableScale to Paytable Modifier scale, and rtp for the info screen.
Fields the variant does not carry come out empty: reelStrips and symbolWeights as [], paytable as {}, paytableScale as 1 and rtp as 0; when nothing is selected, variant is {} and the same empties apply. Only entries that are objects count as variants. The node keeps no state and needs no seeds, and a malformed Variants value parses as {}, so it never fails closed: it reports found false instead.
Inputs
Parameters
| Data | Description |
|---|---|
| Variants (object) | Object keyed by variant name, { key: { reelStrips, symbolWeights, paytable, paytableScale, rtp } }, or its JSON string. Default {}. |
| Key (string) | The variant to select. Default empty, which selects the first variant. |
| Fallback Key (string) | Variant used when Key is set but missing. Default empty. |
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 |
|---|---|
| Variant (object) | The selected variant object, whole; {} when none. |
| Selected Key (string) | The key that was selected; empty when none. |
| Found (boolean) | True when a variant was selected (a boolean, not a signal). |
| Keys (array) | Every key in Variants, in object order, whether or not one was selected. |
| Reel Strips (array) | The variant's reelStrips, or []; wire it to Weighted Reels reelStrips. |
| Symbol Weights (array) | The variant's symbolWeights, or []; wire it to Weighted Reels or Directional Cascade symbolWeights. |
| Paytable (object) | The variant's paytable, or {}; wire it to Calculate Winnings paytable. |
| Paytable Scale (number) | The variant's paytableScale, 1 when absent; wire it to Paytable Modifier scale. |
| RTP (number) | The variant's rtp, 0 when absent; for the info screen. |
Usage
- Build Variants as one object with a key per RTP set or market, each holding
reelStrips,symbolWeights,paytableandrtp. - Wire Key from Bet Mode
modeor a Component Inputs port, and set Fallback Key to the default set. - Fire Do before the spin and wire
reelStripsandsymbolWeightsinto Weighted Reels. - Wire
paytableinto Calculate Winnings andrtpto the info screen.