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

# VORP and RSG Core

How the RedM Wedding & Marriage System works on VORP Core and RSG Core: framework detection, characters, money, items, jobs and the differences between the two.

The script talks to your framework through one file, `server/bridge.lua`. Everything else is the same on both frameworks: the interface, the database, the venue and the rules.

## Detection

```lua
Config.Framework = "auto"   -- "auto" | "vorp" | "rsg"
```

With `"auto"`, the script uses `vorp_core` if it is running, otherwise `rsg-core`. Detection waits for the framework, so cas-wedding still works if it happens to start first. If neither is running, the console shows this once:

```
[cas-wedding] No supported framework is running yet (vorp_core or rsg-core).
```

Set `"vorp"` or `"rsg"` to skip detection, for example on a server that runs parts of both.

If the framework or its inventory is restarted while the server runs, the script hands its usable items (rings, invitations, certificates) back to it automatically.

## What the script reads and writes

|                             | VORP Core                              | RSG Core                                 |
| --------------------------- | -------------------------------------- | ---------------------------------------- |
| **Character**               | `charIdentifier` of the used character | `citizenid`                              |
| **Name**                    | `firstname` `lastname`                 | `charinfo.firstname` `charinfo.lastname` |
| **Gender**                  | `Male` / `Female`                      | `0` / `1`                                |
| **Job** (player officiants) | character `job`                        | `job.name`                               |
| **Money**                   | character cash (currency 0)            | `cash`                                   |
| **Items**                   | `vorp_inventory` exports               | `rsg-inventory` exports                  |

A couple is stored by character, not by player. Someone with several characters can be engaged on one and single on another.

Gender decides the role written in the register: a woman is the **Bride**, a man the **Groom**, and anyone else a **Spouse**. Any two characters can marry.

## Items

|                                  | VORP Core                                      | RSG Core                                              |
| -------------------------------- | ---------------------------------------------- | ----------------------------------------------------- |
| **Where items are defined**      | the `items` table (`install/vorp_items.sql`)   | `rsg-core/shared/items.lua` (`install/rsg_items.txt`) |
| **Item images**                  | `vorp_inventory/html/img/items/`               | `rsg-inventory/html/images/`                          |
| **Invitations and certificates** | one item row, each copy keeps its own metadata | `unique = true`, one slot per copy                    |
| **After adding items**           | restart the server                             | restart the server                                    |

Invitations and certificates carry metadata: the invitation's id, the guest's name, the marriage's id. The inventory shows it as the item's description, for example *Wedding invitation from Theodora & Elias, for Arthur Morgan*.

{% hint style="info" %}
On RSG, each printed invitation takes its own inventory slot. A couple printing 30 copies needs 30 free slots.
{% endhint %}

## Player officiants

A player can officiate a ceremony if their job is in this list:

```lua
Config.Ceremony.PlayerOfficiantJobs = { "priest", "preacher", "judge" }
```

Stock RSG Core has none of these jobs, and RSG replaces a job that is not defined with `unemployed`. On RSG, add the jobs to `rsg-core/shared/jobs.lua` or put your own job names in the list. The venue's NPC officiant always works, so ceremonies never depend on it. See [The Ceremony](/script-documentation/cas-wedding/ceremony.md#the-officiant).

## Other frameworks

`server/bridge.lua` is the only file that knows about a framework, and it is left open (not escrowed) for this. To run the script on another framework, port the functions in that file: `Char`, `Money`, `TakeMoney`, `GiveMoney`, `CanCarry`, `AddItem`, `CountItem`, `RemoveItem` and `RegisterUsable`.
