> 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-advanced-darts-system/faq.md).

# FAQ

Answers for server owners on frameworks, items, OneSync, wagers and refunds, restarts, difficulty, map boards, unflagging and escrow files.

## Which frameworks does it work with?

VORP Core (with `vorp_inventory`) and RSG Core (with `rsg-inventory`), or no framework at all. With `Config.Framework = 'auto'` the script uses whichever of `vorp_core` and `rsg-core` is started when `cas-darts` starts, so start your framework first. You can also force one with `'vorp'` or `'rsg'`. The console line `[cas-darts] [info] framework: ...` tells you which one it picked.

Stats, boards and money belong to the character, not the player: the VORP character id or the RSG citizen id. A player with two characters has two sets of stats.

## Can I run it without a framework?

Yes, set `Config.Framework = 'standalone'` (or start it on a server without VORP and RSG). Then:

* **Works:** every game, the house player, the skill throw, decor boards, boards hung by admins with `/darts_place`, stats and the leaderboard (with oxmysql).
* **Does not work:** the items (there is no inventory) and wagers (there is no money). The stake slider does not show.
* Admins are found by the ace `casdarts.admin` only. Players are told apart by their license.

## I added the items, but the Dartboard does nothing. Why?

Check these in order:

1. **VORP:** did you restart the server after running `cas-darts/install/items_vorp.sql`? `vorp_inventory` reads the items table only when it starts. **RSG:** the items file is read when `rsg-core` starts, so restart the server after adding the lines.
2. The item names in your inventory are the ones in `Config.Items` (`darts_board_wall` and `darts_board_stand`).
3. The console says `framework: vorp` or `framework: rsg`. With `standalone` there are no items: start your framework before `cas-darts`.
4. `cas-darts-assets` is started. With `Config.Debug = true`, F8 shows `board models did not load (cas-darts-assets started?)` when it is not.
5. The character does not already have 2 boards hung (`You have 2 boards hung already`).

The pictures from `cas-darts/install/img` go into `vorp_inventory/html/img/items/` or `rsg-inventory/html/images/`.

## Do I need OneSync?

Yes. The server reads where the players stand to check that a board is hung near the player, that a player is near the board to set up or join, that the thrower stands at the oche, and to take out players who walk more than 20 m away.

Without OneSync the game still runs, because the client checks the distances itself. But the server lets every distance pass and nobody is taken out for walking away. The admin commands `/darts_remove` and `/darts_decor` work either way.

## How do wagers work, and when do players get their money back?

The host picks a stake per player (whole dollars of cash, $1 to $250 by default). A money game needs 2 seats or more. Everyone pays the same stake when they join, and the server holds it in `cas_darts_escrow`. The house player never plays for money and practice has no stake.

| What happens                                                                         | The money                                                                                      |
| ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
| A player wins                                                                        | The pot minus `Config.Wager.houseCutPercent` goes to the winner. The cut is not paid to anyone |
| A player leaves the lobby (or walks away from it)                                    | Their stake comes back                                                                         |
| The host leaves the lobby                                                            | The lobby closes and every stake comes back                                                    |
| Nobody starts the lobby for 10 minutes                                               | Every stake comes back                                                                         |
| A player leaves a running match, disconnects or walks away                           | It is a loss. Their stake stays in the pot                                                     |
| Only one player is left in the match                                                 | That player wins by forfeit and takes the pot                                                  |
| The match ends without a winner (an admin removed the board, the resource restarted) | Every stake comes back                                                                         |
| The player is offline when the money is due                                          | It is owed and paid at their next character load                                               |
| The framework refused the payment while the player was online                        | It is tried again every 60 seconds                                                             |

Every movement is logged in the server console with `[money]`. See [Commands and exports](/script-documentation/cas-advanced-darts-system/commands-and-exports.md) for the lines.

## What happens if I restart the script during a match?

Restart `cas-darts` whenever you like. Lobbies and running matches stop (they are not saved and do not count for the stats), boards stay, and every stake that was held is paid back: on start the console says `N stakes from before the restart are owed back`, and players online get their money a moment after the restart. Players who are offline get it at their next character load.

Never restart `cas-darts-assets` while players are in game. It only holds the models, so it never needs a restart after the server is up.

## Players find the throw too hard (or too easy). What do I change?

Everything for human players is in `Config.Throw`, plus `Config.BounceOutChance`:

* **Less sway:** lower `amp` (10 mm). Longer breath: raise `breathMax` (3 s). Faster recovery: lower `breathRecover` (5 s).
* **Easier timing:** widen the clean band (`sweetLo` 0.72, `sweetHi` 0.86), slow the power meter (raise `period`, 1.1 s), punish a bad release less (lower `powerScale`, 250).
* **Less luck:** lower `sigma` (the server's scatter, 3 mm) and `BounceOutChance` (0.35).
* **More time:** `Config.VisitSeconds` (60) per visit, `Config.PullSeconds` (3) to pull the darts.

Do the opposite to make it harder. The server sends the same values to the thrower that it uses to judge the dart, so a change applies to everyone after a restart of `cas-darts`. A saloon or drinking script can also make one player sway more with the `setDrunk` server export.

**The house player:** players pick his level on the card (Greenhorn, Saloon Regular or Sharpshooter). You can rename the levels or remove one in `Config.Computer.levels`, change his pace (`dartMs`, `walkMs`, `pullMs`), his name and his model, or turn him off with `Config.Computer.enabled = false`. How tightly each level throws (a scatter of 38, 22 and 12 mm around his target) is set in `shared/ai.lua`, which you can change in the Open Source build only.

See [Configuration](/script-documentation/cas-advanced-darts-system/configuration.md) for every value.

## How do I put boards in saloons for good?

Use decor boards: `Config.DecorBoards`. They are always on the map, anyone can play on them, and nobody can take them down in game. To make one:

1. As an admin, type `/darts_place wall` (or `stand`) and hang a board exactly where you want it.
2. Stand at it and type `/darts_decor`. Your chat, your F8 console and the server console show its line, for example:

   ```lua
   { id = 'board_7', kind = 'wall', coords = vector4(-313.352, 805.318, 120.710, 100.00) },
   ```
3. Add the line to `Config.DecorBoards`. You may rename the `id` (for example `valentine_saloon`), but never change it afterwards.
4. Take the hung board down with `/darts_remove`, so the two do not overlap.
5. Restart `cas-darts`.

To move a decor board, change its `coords` and restart. To remove it, delete its entry and restart. `/darts_remove` refuses decor boards.

## A player was flagged by the hit-rate watch. What now?

The watch counts the darts each character throws in money games with two seats or more. After 300 of them, more than 90 percent in a treble, a double or the bull flags the character (`Config.AntiCheat`). The server log shows a line like `hit-rate watch: John Smith (vorp:12) flagged: 91% in the beds over 300 darts`, and every online admin gets a notice.

A flagged character can still play free games and practice, but cannot set up, join or rematch a money game. If you decide the player is clean, clear it:

```
/darts_unflag 12
/darts_unflag vorp:12
```

Use the server id while they are online, or the character key from the log line while they are offline. It works from the server console too. Clearing starts the count again from zero. Use the command, not SQL: the server keeps online players' stats in memory and writes them back.

A very steady player can land 75 to 80 percent, so do not lower `maxBedRate` under 0.85 unless you want to look at more flags.

## Which files can I edit in the Escrow build?

`config/config.lua`, `config/locale.lua` and `install/items_rsg.lua` stay open. Every option on the [Configuration](/script-documentation/cas-advanced-darts-system/configuration.md) page is in the two config files. The Lua files in `client/`, `server/` and `shared/` are encrypted, so changes there (for example the house player's scatter in `shared/ai.lua`) need the Open Source build. The Open Source build also has the source of the interface in `cas-darts/web/`.

## How do I translate it?

Every text the players see is in `config/locale.lua`: the prompts, the notices, the admin answers, the whole interface and the error messages. Change the words, keep the keys, and keep every `%s` (the script fills in an amount, a name or a number there). Then restart `cas-darts`.

Three things are not in the locale file:

* the item labels and descriptions (they are in your inventory: the VORP `items` table or the RSG `items.lua`),
* the command names (`Config.Commands`),
* the key names shown on the throw slate and the board card (`LMB`, `RMB`, `V`, `Back`, `Enter`, `Esc`), which are part of the interface.

## How many boards can players hang, and who can take them down?

A character may have 2 boards hung at the same time (`Config.MaxBoardsPerCharacter`). Admin boards and decor boards do not count. Boards must be at least 1.2 m apart and stay on the map, across restarts, until they are taken down.

* The **owner** takes a board down with **Take down** on the card, while no lobby or match runs on it. The item comes back to their satchel.
* An **admin** removes any player or admin board with `/darts_remove`, even during a match (every stake goes back). The item of a player board goes back to its owner, or waits for their next login.
* **Decor boards** only go when you take them out of `Config.DecorBoards` and restart.
* Anyone can play on any board, even when its owner is offline.
