Skip to main content

Feature Trigger

A seeded yes-or-no roll that fires with the probability you set, and always the same way for the same seed. Maths node that also compiles to the RGS.

Set Chance (0..1) and fire Do. The node clamps the chance to 0..1, takes the first float from a Park-Miller generator seeded with Seeds[0] (the same generator Weighted Reels uses) and reports triggered = roll < chance. A chance of 0 never fires and 1 always fires. The same seed always gives the same roll, so every trigger can be replayed and audited.

Wire Seeds from ISAAC Random Number Array Generator array. Give the trigger a different ISAAC array, or at least a different element, from the one that spins the reels; otherwise the trigger correlates with the spin outcome. Do waits for the inputs delivered in the same update, so seeds that arrive together with the signal are the seeds rolled.

Unseeded, the node fails closed: it logs [Feature Trigger] Seeds is required, writes the error to inspect data, sets Triggered false, Roll 0 and Chance 0, and still fires Done. It never falls back to Math.random. Wire Triggered into a Condition or Switch node to branch the round, for example into Wheel Spin, Pick Bonus or Symbol Upgrade.

Stateless: nothing is kept between rounds. The RGS compiler embeds the same core, so the server rolls exactly what the editor preview rolled from the same seed. A non-numeric Chance (0..1) falls back to the default 0.05, and the inspect data records chance, seedCount, roll and triggered for every run.

Inputs​

Parameters​

DataDescription
Chance (0..1) (number)Probability of firing, 0..1; values outside are clamped and non-numbers fall back to the default. Default 0.05.
Seeds (array)Random seeds, wired from ISAAC Random Number Array Generator array. Required; the node refuses to run unseeded.

Actions​

SignalDescription
DoRuns the node.

Outputs​

Events​

SignalDescription
DoneFires when the node has finished, on success and failure alike.

Results​

DataDescription
Triggered (boolean)true when the roll is below the chance; false when unseeded.
Roll (number)The seeded float in 0..1 compared with the chance; 0 when unseeded.
Chance (number)The clamped probability actually used; 0 when unseeded.

Usage​

  1. Add an ISAAC Random Number Array Generator for the trigger, separate from the one that spins the reels, and wire its array into Seeds.
  2. Set Chance (0..1), for example 0.05 for one trigger in twenty rounds on average.
  3. Fire Do once per round, after the seeds have arrived.
  4. Wire Triggered into a Condition node and branch into the feature.
caution

Seeds shared with the reel spin make the trigger correlate with the spin outcome. Give the trigger its own ISAAC array, or at least its own element of the array.