Bet Mode
Ante-bet and bonus-buy stake maths: turns a bet and a mode into the cost to charge, the base bet for the paytable and a flag that forces the feature. A maths node: it runs in the editor preview and compiles to the RGS.
Mode is base (the default), ante (stake × Ante Multiplier, default 1.25), bonus_buy (stake × Bonus Buy Multiplier, default 100) or any key of Custom Multipliers ({ mode: multiplier }). Matching is forgiving: the mode is trimmed and lower-cased, with spaces and hyphens turned into underscores, so Ante Bet, bonus-buy, bonusbuy, feature_buy and buy all work. An unknown mode falls back to base with modeKnown false and a multiplier of 1.
Direction says which side Bet Amount is on. With base-to-cost (the default) it is the base bet and cost is betAmount × multiplier, the amount to charge. With cost-to-base it is what the player paid and baseBet is betAmount / multiplier. Results are rounded to whole minor units; a negative bet counts as 0, and a multiplier of 0 leaves baseBet equal to the amount paid.
On Do: mode (the normalised key, or base when unknown), modeKnown, multiplier, cost, baseBet, stakeForPaytable (equal to baseBet; wire it to Calculate Winnings betAmount so the paytable pays on the base stake), isBase, isAnte, isBonusBuy and forceFeature, true for a bonus buy. A custom mode reports isBase true and forceFeature false. The booleans are not signals; read them after Done. The node keeps no state.
On the RGS Bet Amount is always the round's stake, whatever is wired, so the component sees what the player actually paid. Use base-to-cost in the browser to compute the cost and send it as the round's bet; use cost-to-base inside the maths component to recover the base stake and forceFeature. Bad numbers fall back to their defaults, so the node does not fail closed. See Round Tracking for how the bet reaches the platform.
Inputs
Parameters
| Data | Description |
|---|---|
| Bet Amount (number) | Stake in minor units: the base bet, or the amount paid with cost-to-base. Default 100; on the RGS always the round's stake. |
| Mode (string) | The bet mode: base, ante, bonus_buy or a Custom Multipliers key; spelling is forgiving. Default base. |
| Ante Multiplier (number) | Stake multiplier for ante. Default 1.25. |
| Bonus Buy Multiplier (number) | Stake multiplier for bonus_buy. Default 100. |
| Custom Multipliers (object) | Extra modes as { mode: multiplier }, object or JSON string. Default {}. |
| Direction (enum) | Whether Bet Amount is the base bet or the amount paid. Default base-to-cost. Options: base-to-cost, cost-to-base. |
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 |
|---|---|
| Mode (string) | The normalised mode key; base when Mode was unknown. |
| Mode Known (boolean) | False when Mode matched nothing and the node fell back to base. |
| Multiplier (number) | The stake multiplier applied; 1 for base and unknown modes. |
| Cost (number) | What the player pays, in whole minor units. |
| Base Bet (number) | The base stake, in whole minor units. |
| Stake For Paytable (number) | Equal to baseBet; wire it to Calculate Winnings betAmount. |
| Is Base (boolean) | True unless the mode is ante or bonus buy; custom modes count as base. |
| Is Ante (boolean) | True for an ante bet. |
| Is Bonus Buy (boolean) | True for a bonus buy. |
| Force Feature (boolean) | True for a bonus buy; read it after Done to force the feature trigger (a boolean, not a signal). |
Usage
- In the UI component, run Bet Mode in
base-to-costwith the player's base bet and chosen mode, and sendcostas the round's bet. - In the maths component, run Bet Mode in
cost-to-basewith Mode wired from a Component Inputs port; Bet Amount is the round's stake on the RGS. - Wire
stakeForPaytableto Calculate WinningsbetAmount. - Branch on
forceFeaturewith Condition to start the bonus instead of a normal spin. - Feed
modeto Variant Selector Key when each mode has its own reel set.
On the RGS Bet Amount is the round's stake even when a wire says otherwise. A maths component left in base-to-cost treats the whole bonus-buy price as the base stake, and the paytable pays on it.