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

# Using It With a Wedding Script

Use CAS Wedding Venue with CAS Wedding or any other script: the automatic hand-over, and the server and client exports for celebrations, applause, the altar and seats.

The venue works on its own, and it is made to be the stage for a wedding script.

## With CAS Wedding

[CAS Wedding](https://codeaftersex.com/scripts) has the same garden built in. When both are installed, CAS Wedding sees this resource and hands the venue over to it:

* **One venue.** CAS Wedding does not place its own props, seats or guests. This resource does.
* **One set of commands.** `/wedding_venue`, `/wedding_crowd`, `/wedding_clap` and `/wedding_confetti` come from this resource.
* **The ceremony celebrates here.** When a couple begins their ceremony, and again when the register is sealed, CAS Wedding fires this venue's confetti, fireworks and applause over its own altar.
* **Prompts stay apart.** The Sit prompt gives way at the altar, where CAS Wedding shows *Begin the Ceremony*, and CAS Wedding's prompts wait while a player is seated here.

Install both as they are. Nothing needs to be set. When CAS Wedding starts, the console says:

```
[cas-wedding] cas-weddingvenue is installed: the venue, its seats, guests and celebrations are handled by it.
```

{% hint style="info" %}
CAS Wedding looks for this folder among your resources. To go back to CAS Wedding's built-in venue, remove the `cas-weddingvenue` folder and restart both.
{% endhint %}

## With any other script

Other scripts can use the venue through exports.

### Server exports

```lua
exports['cas-weddingvenue']:Celebrate({ confetti = true, fireworks = true, clap = 10 })
```

Fires a celebration for everyone within `Config.Celebration.Distance`. All fields are optional:

| Field         | Effect                                                       |
| ------------- | ------------------------------------------------------------ |
| `confetti`    | `true` for confetti                                          |
| `fireworks`   | `true` for fireworks                                         |
| `clap`        | Seconds of NPC applause, 0 to 60. Only if the guests are out |
| `x`, `y`, `z` | Where it goes up. Leave them out to use the venue's altar    |

```lua
exports['cas-weddingvenue']:Clap(8)
```

The NPC guests applaud for that many seconds, 1 to 60.

```lua
local altar = exports['cas-weddingvenue']:AltarCoords()   -- vector3
local shown = exports['cas-weddingvenue']:IsShown()       -- true / false
local mode  = exports['cas-weddingvenue']:CrowdMode()     -- 'all', 'ceremony', 'reception' or false
```

`AltarCoords` follows `AnchorOverride` and `Heading`, so it stays right if the venue is moved.

### Client exports

```lua
local seated = exports['cas-weddingvenue']:IsSeated()
local prompt = exports['cas-weddingvenue']:SeatPromptActive()
```

`IsSeated` is `true` while the local player sits on a venue seat. `SeatPromptActive` is `true` while the venue is showing its Sit or Stand prompt this frame. Check it before showing a prompt of your own nearby, so the two do not fight over the same spot.

### Keeping the Sit prompt away from yours

If your script has its own prompt at a spot in the venue, add that spot to `Config.Seating.keepClear`, in venue-local metres. The Sit prompt then gives way there. Use `/wedding_where` to find the local position.
