> 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-wedding/venue.md).

# The Wedding Venue

The Mayor's Garden wedding venue in Saint Denis: custom props, showing and moving the venue, sittable chairs, NPC wedding guests for filming, confetti, fireworks, applause and sound.

Ceremonies take place in **the Mayor's Garden in Saint Denis**, dressed for a 1900s wedding. There is a floral arch before the Mayor's porch, rows of white chairs along a rose-strewn aisle, guest tables and a sweetheart table. A cake table, a dessert pavilion, a flower stall, a photographer with a heart backdrop, a phonograph, a string quartet, a gift and guestbook table, and torches for the evening complete it.

Most of it is built from the game's own props. Seven custom models are streamed with the resource: the arch, the backdrop, two balloon clusters, the cake, the heart and the petals. There is also the ring box used for proposals.

## Showing and hiding it

The venue appears for every player who comes within 140 m of it and is removed again beyond 170 m.

```lua
Config.Venue.EnabledByDefault = true
```

Staff can switch it for everyone while the server runs:

```
/wedding_venue on
/wedding_venue off
/wedding_venue
```

The last one tells you whether it is showing. After a restart the venue goes back to `EnabledByDefault`.

## 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 map |

{% hint style="warning" %}
The altar and the officiant are set separately, in `Config.Offices`, in world coordinates. Move them together with the venue. Stand on the new spot and use `/weddingcoords` to get the `vector4`.
{% endhint %}

## Night lights

After dark the tables, candles and cake get a soft warm light, so the venue can be seen at night.

```lua
FillLights = {
    enabled = true,
    distance = 75.0,
    fromHour = 19,
    toHour = 6,
    color = { 255, 170, 95 },
    models = { ... },
}
```

`fromHour` and `toHour` are in-game hours. `models` lists which props get a light, with its range, intensity and height.

## Seats

Every chair and bench in the venue can be sat on.

1. Walk up to a free seat. **Sit Down** appears.
2. Hold **E** to sit.
3. Hold **R** to change the pose, for example to lean on the table or drink.
4. Hold **E** again to stand up.

A seat with another player on it cannot be taken. Chairs at the guest tables and the sweetheart table use table poses. Every pose works for male and female characters.

```lua
Seating = {
    enabled = true,
    distance = 1.3,
    occupiedRadius = 0.4,
    scenarios = {
        table = { 'GENERIC_SEAT_CHAIR_TABLE_SCENARIO', 'PROP_HUMAN_SEAT_CHAIR', 'PROP_HUMAN_SEAT_CHAIR_TABLE_DRINKING' },
        chair = { 'PROP_HUMAN_SEAT_CHAIR', 'GENERIC_SEAT_BENCH_SCENARIO' },
        bench = { 'GENERIC_SEAT_BENCH_SCENARIO', 'PROP_HUMAN_SEAT_BENCH' },
    },
    ...
}
```

The first pose of each kind is the one you sit down in. **R** cycles through the rest.

## NPC guests

For filming, or to make a quiet server's wedding feel full, staff can fill the venue with NPC guests from Saint Denis society:

```
/wedding_crowd all
/wedding_crowd ceremony
/wedding_crowd reception
/wedding_crowd off
```

| Mode        | Guests                                                                                                                                  |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `ceremony`  | Seated in the rows facing the arch, standing along the sides, the string quartet playing                                                |
| `reception` | At the guest tables eating and drinking, on the fountain benches, standing in pairs with champagne, waiters in formal wear, the quartet |
| `all`       | Both                                                                                                                                    |

Every player sees the same guests on the same seats. The couple's table is always left free. `/wedding_clap [seconds]` makes the guests applaud.

```lua
Crowd = {
    startMode = false,
    radius = 110.0,
    maxGuests = 80,
    spawnPerFrame = 3,
    suppressAmbient = true,
    ...
}
```

| 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                                              |
| `suppressAmbient` | No new townsfolk or animals spawn near the venue while the guests are out         |
| `groups`          | Which chairs are filled, what share of them, and the poses                        |
| `spots`           | Where standing guests stand, in venue-local metres. `/wedding_where` prints yours |
| `models`          | The guests' models, men and women                                                 |

{% hint style="info" %}
The guests are created on each player's own game. RedM has room for about 150 characters at once, counting players, horses, animals and townsfolk. If players see characters vanish or the game warns about a full pool, lower `maxGuests`.
{% endhint %}

## Celebrations

The altar celebrates twice: when a ceremony begins, and when the register is sealed. Everyone within 150 m sees and hears it.

```lua
Config.Ceremony.Celebration = {
    Begin = { confetti = true, fireworks = false, clap = 0 },
    Married = { confetti = true, fireworks = true, clap = 10 },
    Distance = 150.0,
    ...
}
```

| Effect        | What it is                                                                                            |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| **Confetti**  | Bursts of flower petals over the couple, each in a different colour, then petals drifting on the wind |
| **Fireworks** | The fireworks of the Mayor's own garden party from the story, over the garden behind the arch         |
| **Applause**  | The NPC guests clap for `clap` seconds, if they are out                                               |

Each effect has its own block (`Confetti`, `Fireworks`) for the number of bursts, their timing, height, spread, size and colours.

### Sound

Confetti, fireworks and applause come with sound, heard from the camera. They play at full volume up close and fade out with distance. Firework booms arrive late when far away, as they would.

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

`volume` is the master volume, `0` to `1`. `near` is where the sound starts to fade, and `far` where it is silent. The sound files are in `web/dist/sfx`.

Staff can fire a celebration any time with `/wedding_confetti`, `/wedding_confetti fireworks` or `/wedding_confetti all`.

## Developer tools

With `Config.DevTools = true`, staff can fine-tune the venue:

* `/wedding_where` prints your venue-local position and the nearest prop, for placing guest spots.
* `/wedding_seat` prints the offset of the seat you are sitting on. `/wedding_seat x y z h` moves it live.
* `/wedding_scan` surveys the ground and objects around the venue and saves a `scan_<date>.json` file in the resource folder. It needs the `command.wedding_scan` permission.

Turn `DevTools` off again before players arrive.
