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

# Configuration

Every CAS Clothing Studio setting in config.lua: language, staff access, clothing-store towns, tailor counters, jobs, base garments, restart times, AI Design and debug.

Everything is in `config.lua`. The AI key and the restart times can also be set in `server.cfg`.

## At a glance

| Setting               | What it does                                                                                             |
| --------------------- | -------------------------------------------------------------------------------------------------------- |
| `Config.Locale`       | Language of every screen and prompt (`locales/<code>.json`). Shipped: en, tr, de, fr, es, pt-BR, ru, pl. |
| `Config.AdminGroups`  | Framework groups that may open the studio (the ACE `cas.clothingstudio` always works).                   |
| `Config.Command`      | The studio command (default `clothingstudio`).                                                           |
| `Config.Towns`        | The clothing-store towns designs can be sold in, with the coords of each town's store.                   |
| `Config.TownRange`    | How far (metres) a clothing store may be from a town's coords and still sell that town's designs.        |
| `Config.UseTailors`   | The Studio's own tailor counters: `"auto"`, `true` or `false`.                                           |
| `Config.Tailors`      | The counters: a `town` from `Config.Towns` and the counter's `coords`.                                   |
| `Config.Jobs`         | Jobs the studio offers when a design is given to a job.                                                  |
| `Config.BaseItems`    | The piece put on first when a player wears a design of a category they wear nothing of.                  |
| `Config.RestartTimes` | When the server restarts, for "live after the next restart" (or `cs_restart_times`).                     |
| `Config.Debug`        | Debug prints and the test commands. Keep it `false` on a live server.                                    |

## Language

```lua
Config.Locale = "en"
```

Shipped: `en`, `tr`, `de`, `fr`, `es`, `pt-BR`, `ru`, `pl`. See Languages to add your own.

## Who may open the studio

```lua
Config.AdminGroups = { "admin", "superadmin" }
Config.Command = "clothingstudio"
```

The ACE always works too:

```cfg
add_ace group.admin cas.clothingstudio allow
```

## Towns

The towns designs can be sold in. The studio's **Clothing shops** list shows these, and a clothing store sells the designs of the town whose coords are nearest to the player, within `Config.TownRange` metres. The coords are each town's clothing store.

```lua
Config.Towns = {
    { id = "valentine",  label = "Valentine",       coords = vector3(-326.1, 774.48, 117.46) },
    { id = "rhodes",     label = "Rhodes",          coords = vector3(1324.66, -1291.59, 77.08) },
    { id = "blackwater", label = "Blackwater",      coords = vector3(-761.61, -1291.98, 43.85) },
    { id = "strawberry", label = "Strawberry",      coords = vector3(-1791.07, -392.71, 160.29) },
    { id = "saintdenis", label = "Saint Denis",     coords = vector3(2555.5, -1161.0, 53.73) },
    { id = "tumbleweed", label = "Tumbleweed",      coords = vector3(-5479.838, -2932.866, -0.367) },
    { id = "armadillo",  label = "Armadillo",       coords = vector3(-3688.229, -2624.204, -10.218) },
    { id = "vanhorn",    label = "Van Horn",        coords = vector3(3023.333, 562.773, 44.715) },
    { id = "wallace",    label = "Wallace Station", coords = vector3(-1295.960, 397.696, 95.434) },
}
Config.TownRange = 80.0
```

{% hint style="info" %}
Moved a clothing store, or added one? Add its town here with the store's coords. A store farther than `Config.TownRange` from every town sells no designs; its Designs row then shows only the designs the character already owns.
{% endhint %}

## Tailor counters

The Studio's own counters, for servers without a supported clothing store (or as an extra place to buy).

```lua
Config.UseTailors = "auto"
Config.Tailors = {
    { town = "valentine",  coords = vector3(-326.1, 774.48, 117.46) },
    { town = "rhodes",     coords = vector3(1324.66, -1291.59, 77.08) },
    { town = "blackwater", coords = vector3(-761.61, -1291.98, 43.85) },
    { town = "strawberry", coords = vector3(-1791.07, -392.71, 160.29) },
}
Config.TailorBlip = "blip_shop_tailor"
Config.TailorDistance = 2.0
Config.TailorKey = 0xC7B5340A -- ENTER
```

| `Config.UseTailors` | What happens                                                                                                            |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `"auto"` (default)  | On only while no supported clothing script is integrated. With one, players buy and wear designs in the clothing store. |
| `true`              | Always on. Next to an integrated clothing script the counters only sell; players wear from the clothing store.          |
| `false`             | Never on.                                                                                                               |

Each counter's `town` is an `id` from `Config.Towns`: the counter sells that town's designs.

## Jobs

The jobs the studio offers under **A job** when you hand a design out, as your framework stores the job names:

```lua
Config.Jobs = { "sheriff", "marshal", "deputy", "doctor", "ranger" }
```

## Base garments

When a player wears a design of a category they wear nothing of (a coat design, with no coat on), this piece goes on first, then the design. One list for men, one for women.

```lua
Config.BaseItems = {
    male = {
        vests = "CLOTHING_ITEM_M_VEST_000_TINT_001", coats = "CLOTHING_ITEM_M_COAT_000_TINT_001",
        shirts_full = "CLOTHING_ITEM_M_SHIRT_000_TINT_001", pants = "CLOTHING_ITEM_M_PANTS_000_TINT_001",
        -- ...
    },
    female = {
        -- ...
    },
}
```

## Restart times

Shown in the studio as "Next restart 18:00, in 2 h 10 min" and "live after the next restart". Server local time.

```lua
Config.RestartTimes = { "06:00", "18:00" }
```

Or from `server.cfg`, which wins:

```cfg
set cs_restart_times "06:00,18:00"
```

## AI Design

Optional. Set these in `server.cfg`, never in `config.lua`:

```cfg
set cs_ai_provider "fal"        # fal | google | openai
set cs_ai_key "YOUR_KEY"
set cs_ai_model ""              # optional: a model other than the default
```

Without a key the studio's AI Design button says it is off, and everything else works. The requests are paid by your own account at the provider.

## Debug

```lua
Config.Debug = false
```

`true` adds debug prints and the test commands (see Commands). Keep it `false` on a live server.
