> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-roulette/configuration.md).

# Configuration

Every CAS Advanced Roulette System setting: framework, admins, chip values, limits, round pace, HUD, distances, blips, table sounds, the Discord webhook log and the locale file.

[Back to the guide](/script-documentation/cas-roulette/cas-advanced-roulette-system.md)

Four files, all readable in the escrow version:

* `config/config.lua`: how the game plays
* `config/tables.lua`: where the tables stand (see [Tables](/script-documentation/cas-roulette/tables.md))
* `config/locale.lua`: every text a player reads
* `config/server.lua`: server-only secrets (the Discord webhook URL)

Restart `cas-roulette` after a change. That is safe with players in game; a running round is called off and refunded.

## config/config.lua

### General

| Option                | Default                     | Meaning                                                                           |
| --------------------- | --------------------------- | --------------------------------------------------------------------------------- |
| `Framework`           | `'auto'`                    | `'auto'` uses vorp\_core or rsg-core, whichever is started; or `'vorp'` / `'rsg'` |
| `Debug`               | `false`                     | extra lines in the server console and the client F8 console                       |
| `TestCommands`        | `false`                     | `/roulette_tp` and `/roulette_money` for everyone (test servers only)             |
| `TeleportForEveryone` | `false`                     | `/roulette_tp` for everyone, even when `TestCommands` is off                      |
| `AdminAce`            | `'casroulette.admin'`       | the ace that makes a player an admin                                              |
| `AdminGroups`         | `{ 'admin', 'superadmin' }` | framework groups that count as admin (VORP user group, RSG permission)            |

### Chips and limits

| Option              | Default                                                            | Meaning                                                                                                                                                                                                                                                                                                             |
| ------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ChipValues`        | `{ 1, 5, 10, 25, 50, 100 }`                                        | chip values in dollars a player picks with the mouse wheel or + / -. A table only offers the values between its minimum and its highest spot limit                                                                                                                                                                  |
| `DefaultChipValue`  | `5`                                                                | the chip value selected when you join                                                                                                                                                                                                                                                                               |
| `Limits`            | `{ minBet = 1, maxInside = 50, maxOutside = 250, maxTotal = 500 }` | default limits in dollars: the smallest chip, the most one player may have on one inside spot (straight, split, street, trio, corner, top line, six line), on one outside spot (column, dozen, red / black, odd / even, low / high), and on the felt in one round. A table in `tables.lua` can override any of them |
| `MaxSpotsPerPlayer` | `30`                                                               | the most spots one player may cover in a round                                                                                                                                                                                                                                                                      |
| `ActionsPerSecond`  | `8`                                                                | chip actions (place, take back, clear) per second before the server ignores a player                                                                                                                                                                                                                                |

### Pace

`Config.Pace`, in seconds. The server moves on as soon as every seated player's game has shown a step; these are the fallback timers when a game does not answer.

| Field          | Default | Meaning                                                              |
| -------------- | ------- | -------------------------------------------------------------------- |
| `betting`      | `30.0`  | bets open                                                            |
| `closing`      | `3.0`   | "No more bets"                                                       |
| `spinRelease`  | `5.0`   | from the start of the spin until the ball leaves the croupier's hand |
| `result`       | `6.0`   | the croupier sets the marker on the number                           |
| `payoutBase`   | `8.0`   | raking in the losing chips                                           |
| `payoutPerWin` | `3.0`   | each winning bet paid                                                |
| `ackMargin`    | `4.0`   | extra time after each step before the fallback fires                 |

### History and HUD

| Option          | Default | Meaning                                                                                                                      |
| --------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `HistorySize`   | `100`   | results kept per table (saved)                                                                                               |
| `HistoryShown`  | `12`    | numbers in the HUD's marquee (at most 12)                                                                                    |
| `HotColdWindow` | `100`   | results counted for hot and cold numbers                                                                                     |
| `HotColdCount`  | `3`     | how many hot and cold numbers are shown. Cold numbers appear once enough results are in (38, or the window if it is smaller) |
| `HideRadar`     | `true`  | hide the minimap while a player sits at a table                                                                              |

### Distances and map tables

| Option              | Default                                                               | Meaning                                                                                       |
| ------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `StreamDistance`    | `35.0`                                                                | the table's props and croupiers exist while you are this close (m)                            |
| `InteractDistance`  | `1.3`                                                                 | the reach of the "Join the Table" prompt around a free place (m)                              |
| `JoinCheckDistance` | `4.0`                                                                 | the server refuses a join from farther away (m, needs OneSync)                                |
| `MapScanDelay`      | `3000`                                                                | ms after you arrive before the client looks for a map-placed `p_roulettetable01x`             |
| `MapScanRadius`     | `2.5`                                                                 | how far from a configured table it looks (m)                                                  |
| `AdminTable`        | `{ croupier = 'S_M_M_SDDEALER_01', chips = 'p_chips_val01x' }`        | croupier and chip model for tables added in game, and for tables in `tables.lua` without them |
| `Blip`              | `{ enabled = true, sprite = 'blip_mg_blackjack', name = 'Roulette' }` | the map blip of each table (the game has no roulette blip)                                    |

### Table sounds

`Config.Audio`. The game has no roulette sounds, so the script ships its own: the ball rolling on the track, clicking over the frets and dropping into its pocket, a chip placed or taken back, the rake sweep and the payout. Everyone near a table hears them, fading with the distance from their camera.

| Field      | Default | Meaning                                                          |
| ---------- | ------- | ---------------------------------------------------------------- |
| `enabled`  | `true`  | `false` switches every table sound off                           |
| `volume`   | `0.8`   | master volume, `0.0` to `1.0`                                    |
| `distance` | `12.0`  | metres at which a sound has faded out (full volume within 1.5 m) |
| `ball`     | `1.0`   | volume of the ball sounds, `0` turns them off                    |
| `chips`    | `1.0`   | volume of the chip, rake and payout sounds, `0` turns them off   |

### Discord webhook log

`Config.Webhook`. Off by default. When it is on, every line the script prints to the server console (bets, wins, losses and payouts, players joining and leaving, each spin's result, warnings, errors) is also posted to a Discord channel, a few lines per message. The URL goes in `config/server.lua` (below), never in `config.lua`.

| Field          | Default          | Meaning                                                                                                                                                                                               |
| -------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enabled`      | `false`          | `true` sends the log to the URL in `config/server.lua`                                                                                                                                                |
| `money`        | `true`           | money lines: every bet, each player's win or loss per round, payouts, refunds and money still owed                                                                                                    |
| `info`         | `true`           | players joining and leaving a table, each spin's pocket, tables added in game, the start-up lines                                                                                                     |
| `warn`         | `true`           | warnings, such as a payment that was interrupted and needs an admin to check                                                                                                                          |
| `error`        | `true`           | errors, such as a framework money call that failed                                                                                                                                                    |
| `debug`        | `false`          | debug lines (they only exist with `Config.Debug = true`)                                                                                                                                              |
| `flushSeconds` | `5`              | how often the collected lines are sent. Discord allows about 30 messages a minute per webhook; the script sends at most 2 messages per flush and drops the oldest lines if a flood would go past that |
| `username`     | `'CAS Roulette'` | the name the messages are posted under                                                                                                                                                                |

### The table itself

These are tuned to Rockstar's models and clips. Change them only if you know why.

| Option        | Meaning                                                                                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PlayerSpots` | the six player places around the table: table-local `x`, `y` and heading offset `h`                                                                                       |
| `SeatTints`   | the chip colour of each place (tint rows of the chip model: 3 cream, 6 red, 9 green, 12 blue, 15 black, 18 cream / red, 21 red / green, 24 green / blue, 27 blue / black) |
| `Croupier`    | the seats of the wheel and layout croupiers, the bar stool, the hand offsets of the rake, ball and marker, and where the rake, the marker and the chip bank rest          |
| `Clips`       | every Rockstar clip used, with the phase windows in which the props move                                                                                                  |
| `Camera`      | the felt view (`layout`), the wheel view (`wheel`) and the blend time                                                                                                     |
| `Sounds`      | Rockstar's minigame sounds for the interface: cursor, chip value, limit, refused, win                                                                                     |

## config/server.lua

Loaded by the server only; the server never sends it to players, so it is the place for secrets.

| Option       | Default | Meaning                                                                                                                                                                                                                                                                                                                     |
| ------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `WebhookUrl` | `''`    | the Discord webhook URL for the log (Discord: channel settings, Integrations, Webhooks, New Webhook, Copy Webhook URL). Switch the log on with `Config.Webhook.enabled`. Keep the URL secret: anyone who has it can post into that channel                                                                                  |
| `HouseEdge`  | `5.26`  | the house edge in percent: the least share of every bet the house keeps over time. `5.26` is a real American wheel with the standard payouts, and lower values change nothing. A higher value makes every winning bet pay a little less, by the same share on every kind of bet, so no bet becomes a loophole. At most `50` |

What the bets pay at a few `HouseEdge` values ("to 1"):

| `HouseEdge`      | Straight | Split | Street, trio | Corner | Top line | Six line | Column, dozen | Red / black, odd / even, low / high |
| ---------------- | -------- | ----- | ------------ | ------ | -------- | -------- | ------------- | ----------------------------------- |
| `5.26` (default) | 35       | 17    | 11           | 8      | 6        | 5        | 2             | 1                                   |
| `7.5`            | 34.15    | 16.57 | 10.71        | 7.78   | 6        | 4.85     | 1.92          | 0.95                                |
| `10`             | 33.2     | 16.1  | 10.4         | 7.55   | 5.84     | 4.7      | 1.85          | 0.9                                 |
| `15`             | 31.3     | 15.15 | 9.76         | 7.07   | 5.46     | 4.38     | 1.69          | 0.79                                |

The ball stays fair (every pocket is equally likely) and the HUD shows the payout that is really paid. Winnings are cut down to the cent.

## config/locale.lua

Every text a player reads: the prompts, the HUD, the bet spot names (`spotStraight = 'Straight %s'`, `spotDozen1 = '1st 12'` ...), the notices, the errors and the command replies. Keep every `%s` and `%d`; the script fills them in order. Keep the prompt texts to plain letters (the game's prompt font draws some signs as boxes).
