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

# Configuration

Configure CAS Metabolism V2 for RedM — need drain rates, rate multipliers, body weight, temperature, the HUD and language, all from one commented config file.

Everything lives in `config/config.lua`. It is commented line by line, so this page only covers the settings most servers actually change.

***

## The first five minutes

```lua
Config.Framework = 'auto'      -- 'auto', 'vorp' or 'rsg'
Config.Locale = 'en'           -- 'en' or 'tr'
Config.Storage = 'framework'   -- 'framework' or 'database'
Config.Table = 'cas_metabolism_v2'
```

**`Config.Storage`** is worth a moment:

|             |                                                                                                                                                                                                                      |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `framework` | Keep values in the player's own character record where the framework has room for it, and fall back to the resource's own table where it does not. VORP has no room, so on VORP this behaves the same as `database`. |
| `database`  | Always the table named in `Config.Table`.                                                                                                                                                                            |

{% hint style="info" %}
Only change `Config.Table` if another resource already owns that name. If the table exists but belongs to something else, the console says so on start instead of quietly failing.
{% endhint %}

***

## How fast needs drain

```lua
Config.Needs = {
    hunger = { rate = 0.35, warnAt = 25, criticalAt = 10, damage = 2, lethal = true },
    thirst = { rate = 0.45, warnAt = 25, criticalAt = 10, damage = 3, lethal = true },
    ...
}
```

`rate` is **points per minute**. At `0.45`, thirst takes about 3 hours 40 minutes to empty from full.

`damage` is a **percentage of the character's maximum health**, taken every `damageEverySeconds` (10 by default). So with thirst at `3`, an empty thirst kills in about five and a half minutes — and the same five and a half minutes whether the character has 200 health or 800.

Set `lethal = false` on a need and it stops at 1 health instead of killing.

***

## Making it harder or easier

```lua
Config.RateMultipliers = {
    exertion = 1.8,      -- sprinting, fighting
    riding = 1.25,
    sleeping = 0.25,
    hotWeather  = { thirst = 1.6, hunger = 1.0 },
    coldWeather = { thirst = 1.0, hunger = 1.5 },
}
```

***

## Turning whole systems off

Each of these has its own `enabled` flag, and switching one off costs nothing elsewhere:

```lua
Config.Stress.enabled      = true
Config.Alcohol.enabled     = true
Config.Weight.enabled      = true
Config.Relief.enabled      = true
Config.Temperature.enabled = true
Config.Smoking.enabled     = true
Config.Voice.enabled       = true
```

***

## The HUD

```lua
Config.Hud = {
    settingsCommand = 'hud',    -- /hud opens the settings panel
    settingsKey = 'F7',         -- players can rebind this themselves
    refresh = 500,

    hideWhen = {
        gameMenus = true,       -- map, satchel, shops, pause menu
        cutscene = true,
        deathScreen = true,
        cinematicCam = true,
        sprinting = false,      -- hide the bar while running
    },
}
```

### Character selection and creation screens

The HUD stays off them. If you use a character creator other than the one shipped with your framework, add its events here:

```lua
Config.Hud.characterScreen = {
    enabled = true,
    covers   = { 'your-creator:client:open' },
    releases = { 'your-creator:client:done' },
}
```

Anything in `covers` hides the bar, anything in `releases` gives it back. An event that never fires costs nothing, so leaving the defaults in place is safe.

***

## Weight

A character fills out when kept fed and wastes away when kept hungry. It is slow on purpose — roughly six hours of play to gain a visible step, four to lose one.

```lua
Config.Weight = {
    enabled = true,
    middle = 50.0,        -- the build the player created
    gainAbove = 80,       -- hunger above this puts weight on
    loseBelow = 35,       -- hunger below this takes it off
    tickSeconds = 300,
    build = true,         -- also reshape shoulders, chest and legs
    buildReverse = false,
}
```

{% hint style="warning" %}
**Check `buildReverse` once on your server.** RDR2 does not document which way its five body shapes run. Use `/weight 100` and `/weight 0` with debug on: if your character gets *narrower* through the shoulders as they gain weight, set `buildReverse = true`.
{% endhint %}

***

## Language

```lua
Config.Locale = 'en'
```

`en` and `tr` ship complete. To add your own, copy `locales/en.lua` to `locales/xx.lua`, translate the right-hand side of each line, and set `Config.Locale = 'xx'`. Every locale file is loaded automatically.
