> 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-weddingvenue/configuration.md).

# Configuration

Every setting in config.lua of CAS Wedding Venue: moving and rotating the venue, streaming, ground snapping, night lights, seats, NPC guests and celebrations.

All settings are in `config.lua`, which is not escrowed. Every section is commented in the file itself. Restart the resource after a change.

## General

```lua
Config.Locale = "en"
Config.StaffOnlyCommands = true
Config.DevTools = false
Config.Debug = false
```

| Setting             | Effect                                                                                                                                    |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `Locale`            | The language of messages and prompts: `"en"` or `"tr"`, or your own. See [Languages](/script-documentation/cas-weddingvenue/languages.md) |
| `StaffOnlyCommands` | `true` puts the venue commands behind ACE permissions. See [Permissions](/script-documentation/cas-weddingvenue/commands.md#permissions)  |
| `DevTools`          | Turns on `/wedding_where`, `/wedding_seat` and `/wedding_scan`. Keep `false` on a live server                                             |
| `Debug`             | Prints how many props and guests were spawned. Keep `false` on a live server                                                              |

## The venue

```lua
Config.Venue = {
    EnabledByDefault = true,
    AnchorOverride = nil,
    Heading = 0.0,
    SpawnRadius = 140.0,
    DespawnRadius = 170.0,
    SpawnPerFrame = 8,
    ModelLoadTimeout = 5000,
    GroundSnap = false,
    GroundSnapMaxDelta = 1.0,
    GroundRefineRadius = 60.0,
    ModelHeadingFix = {},
    FillLights = { ... },
    Scan = { ... },
}
```

| Setting            | Effect                                                                              |
| ------------------ | ----------------------------------------------------------------------------------- |
| `EnabledByDefault` | Whether the venue shows after a restart. Staff switch it live with `/wedding_venue` |
| `SpawnRadius`      | The venue appears for players within this distance of it (m)                        |
| `DespawnRadius`    | It is removed again beyond this distance (m). Keep it larger than `SpawnRadius`     |
| `SpawnPerFrame`    | Props created per frame while it appears. Lower it if arriving stutters on slow PCs |
| `ModelLoadTimeout` | How long to wait for each model to load (ms)                                        |
| `ModelHeadingFix`  | Turns one model by some degrees, for a prop whose front faces the wrong way         |

### Moving the venue

The layout is stored in venue-local metres around an anchor in the Mayor's garden. To place the whole venue elsewhere:

```lua
Config.Venue.AnchorOverride = vector3(2400.56, -1113.09, 46.49)
Config.Venue.Heading = 0.0
Config.Venue.GroundSnap = true
```

| Setting              | Effect                                                                                                                                                                            |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AnchorOverride`     | The point the layout is built around. `nil` uses the Mayor's garden                                                                                                               |
| `Heading`            | Turns the whole venue around the anchor, in degrees, counter-clockwise                                                                                                            |
| `GroundSnap`         | Raises or lowers each group of props to the ground under it, by at most `GroundSnapMaxDelta` metres. Leave it off in the Mayor's garden, where the heights already match the lawn |
| `GroundRefineRadius` | Within this distance, groups whose ground was not loaded yet are checked again (m)                                                                                                |

The seats, the NPC guests and the altar move with the venue.

### Night lights

```lua
FillLights = {
    enabled = true,
    distance = 75.0,
    fromHour = 19,
    toHour = 6,
    color = { 255, 170, 95 },
    models = {
        p_centerpiece01x = { range = 3.2, intensity = 3.0, height = 0.45 },
        ...
    },
},
```

After dark, a soft warm light is drawn over the table centrepieces, the candelabras, the candles and the cake, for players within `distance`. `fromHour` and `toHour` are in-game hours. `models` lists which props get a light, with its range, intensity and height above the prop. The lights cast no shadows.

## Seats

See [Seats](/script-documentation/cas-weddingvenue/seats.md#settings).

## NPC guests

```lua
Config.Crowd = {
    startMode = false,
    radius = 110.0,
    maxGuests = 80,
    spawnPerFrame = 3,
    suppressAmbient = true,
    groundZ = -1.04,
    groups = { ... },
    seatFallback = 'PROP_HUMAN_SEAT_CHAIR',
    standFallback = 'WORLD_HUMAN_STAND_WAITING',
    standing = { ... },
    spots = { ... },
    models = { ... },
    clap = { ... },
}
```

| Setting                         | Effect                                                                                                                                    |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `startMode`                     | Guests out from the start: `'all'`, `'ceremony'`, `'reception'` or `false`                                                                |
| `radius`                        | Guests appear for players within this distance of the venue (m)                                                                           |
| `maxGuests`                     | The most guests at once, in any mode                                                                                                      |
| `spawnPerFrame`                 | Guests created per frame                                                                                                                  |
| `suppressAmbient`               | No new townsfolk or animals spawn near the venue while the guests are out                                                                 |
| `groundZ`                       | The lawn height in venue-local metres, where standing guests are placed                                                                   |
| `groups`                        | Seated guests: which chairs (by layout group), what share of them is filled, in which modes, and their poses for men and women            |
| `seatFallback`, `standFallback` | The pose used if a guest's own pose does not start                                                                                        |
| `standing`                      | Poses of standing guests: ceremony, reception and waiters                                                                                 |
| `spots`                         | Where standing guests stand, in venue-local metres. `face` is the point they look at, `h` a fixed heading. `waiter = true` makes a waiter |
| `models`                        | The guests' models, men and women, and the waiters'                                                                                       |
| `clap`                          | The applause animations, seated and standing                                                                                              |

The share filled is decided per seat, the same on every screen, so every player sees the same guests on the same seats.

To add a standing guest, stand where you want them with `Config.DevTools` on, use `/wedding_where` and copy the local `x` and `y` into a new spot:

```lua
{ mode = 'reception', x = 12.4, y = -1.8, face = { 11.2, -0.6 } },
```

## Celebrations

```lua
Config.Celebration = {
    Altar = { x = -12.5, y = 1.8, z = -0.05 },
    Distance = 150.0,
    Confetti = { ... },
    Fireworks = { ... },
    Sounds = { ... },
}
```

| Setting     | Effect                                                                                                                |
| ----------- | --------------------------------------------------------------------------------------------------------------------- |
| `Altar`     | The altar mark on the aisle, in venue-local metres, at a standing player's height. Staff celebrations go up here      |
| `Distance`  | Players within this distance see a celebration (m)                                                                    |
| `Confetti`  | The petal effect, the number of bursts, their timing, radius, height, size and colours, and the drifting petals after |
| `Fireworks` | The firework effects, the number of bursts, their timing, where they go up, spread, height, size and colours          |
| `Sounds`    | See below                                                                                                             |

### Sounds

```lua
Sounds = {
    volume = 1.0,
    confetti = { files = { 'confetti_1.ogg', 'confetti_2.ogg' }, volume = 0.8, near = 6.0, far = 60.0 },
    fireworks = { files = { ... }, volume = 1.0, near = 40.0, far = 450.0 },
    applause = { files = { 'applause_1.ogg', 'applause_2.ogg' }, volume = 0.75, near = 12.0, far = 90.0, length = 10.0 },
},
```

`volume` is the master volume, `0` to `1`. Each sound fades from full volume at `near` metres to silence at `far`. The files are in `html/sfx`. To use your own, put `.ogg` files there with lowercase names and list them here. `length` is how long each applause file runs, so longer applause can be chained.
