> ## Documentation Index
> Fetch the complete documentation index at: https://rust-co.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Everything you can change in config/config.lua, explained in plain words.

All settings live in one file: `rco-gym/config/config.lua`. Open it with any text editor (Notepad works, VS Code is nicer).

> [!TIP]
>
> Only change what comes after the `=` sign. Keep the quotes `'...'`, the commas and the brackets exactly as they are. After saving, restart the server.

## The basics

| Setting | What it does | Default |
| - | - | - |
| `Config.Locale` | Language of the texts on screen: `'en'` or `'pt-br'` | `'en'` |
| `Config.Framework` | Leave `'auto'`. Only write `'rsg'` or `'vorp'` if the script guesses wrong | `'auto'` |
| `Config.Debug` | Prints what the script does in the F8 console, for setting up. Turn it off before opening to players | `false` |
| `Config.UseDistance` | How close (metres) a player must stand to a station to see its keys | `1.2` |
| `Config.ShowDistance` | Within this distance (metres) of a gym's middle its equipment is placed and other players' training is shown | `60.0` |

### Another language

Copy `locales/en.json`, translate the texts on the right side of each line, save it as for example `locales/es.json` and set `Config.Locale = 'es'`. Anything you didn't translate shows in English.

## The gyms

`Config.Gyms` lists every gym of your server. The Strawberry gym comes ready as the first one, with its 16 stations. You can add as many gyms as you like, anywhere on the map, and place each station on its own.

```lua theme={"dark"}
Config.Gyms = {
    {   -- the Strawberry gym (comes ready)
        name = nil,
        blip = { coords = vector3(-1836.6, -407.0, 162.39), sprite = 'blip_shop_market_stall' },
        building = 'strawberry',
        stations = {
            { type = 'supino', coords = vector4(-1835.6349, -404.0478, 162.3875, -125.0) },  -- Bench press
            -- ... the other 15 stations
        },
        board = vector4(-1836.59, -402.61, 162.39, 55.0),
    },
    {   -- a gym of your own
        name = 'Saint Denis Gymnasium',
        blip = { sprite = 'blip_shop_market_stall' },
        building = 'props',
        stations = {
            { type = 'supino', coords = vector4(x, y, z, heading) },
            { type = 'halteres', coords = vector4(x, y, z, heading) },
            { type = 'tapete', coords = vector4(x, y, z, heading) },
        },
        board = vector4(x, y, z, heading),
    },
}
```

| Setting | What it does |
| - | - |
| `name` | The name of the gym's blip. `nil`: "Gymnasium" in the player's language |
| `blip` | `{ coords = vector3(...), sprite = '...' }`: where the blip stands and its icon (a name from the game's blips). Without `coords` the blip goes in the middle of the gym. `false`: no blip |
| `building` | `'strawberry'`: the gym building this resource brings, with the equipment already inside. `'props'`: the script places the equipment, solid, wherever you put the stations (outdoors, in a building, in another MLO) |
| `stations` | The stations, each with its `type` and its `coords` |
| `board` | The record board: where the player stands to read it, facing it. The board goes on the wall 1 m in front of him. Leave it out for no board |

### Build a gym piece by piece

1. Copy the Strawberry entry, give the copy a `name` and set `building = 'props'`.
2. Keep only the station lines you want. Copy a line to have that station twice (two benches: two `supino` lines).
3. For each station, stand where the player should use it, facing the way he should face, and take your position and heading with the coords tool your server already uses. Write them as `vector4(x, y, z, heading)`.
4. Restart the server.

The coords are the player's own position while standing on the floor, so take them on foot, not on a horse or in a vehicle.

### The station types

| Type | Station | Floor it needs (metres, across × along the way the player faces) |
| - | - | - |
| `supino` | Bench press | 1.9 × 2.7, the bench behind the player's spot |
| `agachamento` | Squat rack | 1.9 × 1.6 |
| `halteres` | Dumbbell rack (curl and press) | 3.7 × 1.3, the rack 0.4 m in front |
| `tapete` | Floor mat (push-ups, sit-ups, squats) | 1.1 × 1.9 |
| `barra_fixa` | Pull-up bar | 2.0 × 2.3, 2.6 m tall: ceiling of 2.7 m or more |
| `paralelas` | Parallel bars | 0.9 × 2.5, 1.15 m tall |
| `escada` | Horizontal ladder | 1.5 × 3.2 (from 0.5 m behind the spot to 2.7 m in front), 2.3 m tall: ceiling of 2.6 m |
| `argolas` | Gymnastic rings | 1.2 × 1.2. They hang from a point 4.0 m above the floor |
| `corda` | Climbing rope | 1.0 × 1.2. The rope hangs from a point 4.0 m above the floor, and the climb reaches 3 m |
| `saco` | Heavy bag | 1.2 × 1.6. It hangs from a point 4.0 m above the floor |
| `bola` | Speed bag | 1.0 × 1.3. Its platform goes on a wall 0.95 m in front of the player (1.4 to 1.9 m up) |
| `polias` | Pulley machine (pulldown, row, chest press) | 1.0 × 1.6, two columns 0.75 m in front of and behind the player, 2.1 m tall |
| `barra_no_chao` | Barbell on the floor (clean and press, barbell curl) | 1.9 × 1.6 |
| `medicine_ball` | Medicine ball for two | 0.8 × 4.0: the partner catches 3 m in front |
| `corda_de_pular` | Skipping rope | 1.4 × 1.5 |

> [!TIP]
>
> Keep about 0.7 m between stations. Each exercise has its own camera, 1.5 to 3.5 m from the station, mostly in front and to one side: a wall in that spot puts the camera behind the wall. The rings, the climbing rope and the heavy bag look best under a beam or a ceiling about 4 m up.

> [!NOTE]
>
> `cam = 2` on a bench line uses the bench's other camera, from its other side. The second bench of the Strawberry gym uses it.

### Removing the Strawberry gym

Delete (or comment out) its entry in `Config.Gyms`: its stations and its blip are gone. The Strawberry building comes with the resource's files (the `stream/mlo` and `stream/placas` folders) and no setting stops it from loading. To take the house back to the game's own, delete those two folders too.

## Keys

| Setting | What it does | Default |
| - | - | - |
| `Config.ExerciseKeys` | One key for each exercise a station offers, in order | **E**, **G**, **F** |
| `Config.RepKey` | The main key of the minigames, and start in the load picker | **SPACE** |
| `Config.GameKeys` | The other keys of the minigames: left, right, up, down. Left and right also choose the load and turn the pages of the record board | **A**, **D**, **W**, **S** |
| `Config.LeaveKey` | Ends the set and leaves the station, and closes the load picker and the record board | **X** |

> [!NOTE]
>
> Keys are written as the game's control hashes (like `0xCEFD9220`), not as letters: the hash of each key is on the [Keys](https://rust-co.mintlify.site/keys.md) page. In the load picker and on the record board the arrows and **Esc** also work.

## The minigames

| Setting | What it does | Default |
| - | - | - |
| `Reps` | Repetitions in a set. The set ends by itself after them | `10` |
| `Ease` | Every timing window and target zone times this: `1.3` is easier, `0.8` harder | `1.0` |
| `Pause` | Seconds the result stays on screen before the next round | `0.7` |
| `KeyLag` | Seconds a key press takes to reach the screen. Timing is judged that much earlier | `0.035` |
| `HeavyLoad` | With the player's top load the windows are this much narrower (from half the top load up) | `0.2` (20%) |
| `Tired` | With the muscle group worn out, the windows are this much narrower | `0.15` (15%) |
| `LightLoad` | A light set (half the top load or less: a warm-up) is this many times easier | `1.15` |

All of them are inside `Config.Minigame = { ... }`.

## Strength

Inside `Config.Progression = { ... }`:

| Setting | What it does | Default |
| - | - | - |
| `MaxLevel` | The top level of each muscle group | `50` |
| `XpForMax` | Experience a group needs for the top level (about 50 hours of training that group) | `17500` |
| `Curve` | How much harder each level gets than the one before. `1` = every level the same | `1.5` |
| `XpPerRep` | Experience of one good repetition with a good load | `1.0` |
| `SecondaryShare` | Share the other groups of the exercise get | `0.33` |
| `PartnerShare` | Share the spotter or the medicine ball partner gets for each good repetition of the one training | `0.5` |
| `RecordXp` | Bonus for beating your own record in an exercise | `25` |
| `MinRepGap` | Seconds: repetitions faster than this are not counted | `1.2` |
| `MinReps` | Good repetitions a set needs to count. A set left with fewer gives nothing: no experience, record or tiredness | `5` |
| `EasyShare` | Experience share of the easier exercises (`1` = full): the horizontal ladder (`escada`, a crossing is worth 8 repetitions, so 2) and the rope climb (`corda`) | `{ escada = 0.25, corda = 0.5 }` |

### Titles

`Config.Titles = { 5, 30, 70, 120, 180, 230 }`: the sum of the five groups' levels (5 to 250) where each title of the period starts. Their names are in the locales (`title_1` to `title_6`): Weakling, Beginner, Amateur athlete, Athlete, Strongman / Strongwoman, Champion.

## Tiredness, training every day and the spotter

| Setting | What it does | Default |
| - | - | - |
| `Config.Fatigue.PerRep` | Tiredness (0 to 100) a good repetition adds to its main group. About 7 sets of 10 wear it out | `1.5` |
| `Config.Fatigue.RestHours` | Hours a fully tired group takes to rest completely | `24` |
| `Config.Fatigue.TiredShare` | Experience a fully tired group still gets. `1` = tiredness doesn't matter | `0.25` |
| `Config.Fatigue.StaminaPerRep` | The game's own stamina each good repetition takes: after a set the player runs out sooner. `0` = off | `4.0` |
| `Config.Streak.PerDay` | Extra experience for each day in a row with at least one set | `0.03` (3%) |
| `Config.Streak.MaxDays` | The day in a row where the bonus stops growing (the 6th day: +15%) | `6` |
| `Config.Spotter.Save` | When the one on the bench misses a repetition, the spotter has a moment to press his key and save it | `true` |

## Warm-up and strains

Inside `Config.Injury = { ... }`. A light set (half the top load or less, or an exercise without a load) of `WarmupReps` good repetitions warms the player up for `WarmupMinutes`. A missed repetition with a heavy load while not warmed up may strain the muscle group: the set ends and that group can't be trained for `StrainHours`.

| Setting | What it does | Default |
| - | - | - |
| `Enabled` | `false` turns warm-up and strains off | `true` |
| `WarmupReps` | Good repetitions of a light set that warm up | `5` |
| `WarmupMinutes` | How long the warm-up lasts | `20` |
| `HeavyShare` | A load this share of the top load or more is heavy | `0.85` (85%) |
| `Chance` | Chance a heavy missed repetition while cold strains the group | `0.35` (35%) |
| `StrainHours` | Hours a strained group can't be trained | `6` |

## Loads

| Setting | What it does | Default |
| - | - | - |
| `Config.WeightUnit` | How loads are shown: `'lb'` or `'kg'` | `'lb'` |
| `Config.BarWeight` | The empty barbell. Plates of 5, 10 and 15 lb go on it in pairs | `20` |

`Config.MaxLoad` sets the top load of each exercise with gear, in pounds: the first number at level 1, the second at the top level. The player's top load grows between them with the level of the exercise's main group.

| Name in the config | Exercise | Default |
| - | - | - |
| `supino` | Bench press | `{ 40, 220 }` |
| `agacha` | Barbell squat | `{ 40, 260 }` |
| `dbarra` | Clean and press | `{ 30, 150 }` |
| `rosca_barra` | Barbell curl | `{ 30, 110 }` |
| `rosca` | Dumbbell curl (the rack has 5, 10, 15, 20, 25, 30, 40 and 50 lb) | `{ 5, 50 }` |
| `desenv` | Dumbbell press | `{ 5, 40 }` |
| `puxada` | Pulley pulldown (the weight stack goes in steps of 10 lb) | `{ 30, 150 }` |
| `remada` | Pulley row | `{ 30, 150 }` |
| `peito` | Pulley chest press | `{ 20, 100 }` |

## Muscle on the body

Inside `Config.Muscle = { ... }`. The look stays the appearance creator's: the gym adds the muscle on top of it each time the creator puts the body on, and never changes what the creator saved.

| Setting | What it does | Default |
| - | - | - |
| `Enabled` | `false`: strength still goes up, the body doesn't change | `true` |
| `GrowthPerDay` | Share of the full size the body can grow (or shrink) in a day: the player gets strong first, the body follows | `0.2` |
| `Male` / `Female` | How much each part grows at the top level (`arms`, `shoulders`, `backWidth`, `back`, `chest`, `thighs`, `calves`; the body sliders go from -1 to 1) | see the file |
| `Decay` | A group not trained for `GraceDays` loses experience every day, down to nothing, and the body shrinks back to the one the player created | `true` |
| `GraceDays` | Days a group can rest before it starts to shrink | `7` |
| `DecayPerDay` | Share of the group's best ever lost per day after the grace days (`0.02`: all of it in 50 days) | `0.02` |
| `Pump` | Right after a set, the group it worked shows this share of its full size more | `0.25` |
| `PumpMinutes` | Minutes the pump takes to go away | `30` |

## Outside the gym

Inside `Config.Benefits = { ... }`. Each one is turned off with `0`.

| Setting | What it does | Default |
| - | - | - |
| `Melee` | Extra damage with the fists and melee weapons at the top level of arms, chest and shoulders | `0.4` (+40%) |
| `StaminaRanks` | Ranks of the game's own stamina wind adds at its top level (wind comes from the rope climb, skipping rope, the bags and the medicine ball) | `3` |

## Sounds

| Setting | What it does | Default |
| - | - | - |
| `Config.Sound.Volume` | The equipment, heard by everyone near. `0` = off | `0.8` |
| `Config.Sound.UI` | The minigame's ticks and the bell at the end of a set, only for the one training. `0` = off | `0.5` |
| `Config.Sound.Range` | Metres the equipment can be heard to | `20.0` |

## For developers

Another resource can read a player's levels on the server, for example to let strong characters carry more:

```lua theme={"dark"}
local levels = exports['rco-gym']:GetLevels(source)
-- { chest = 12, back = 9, shoulders = 10, arms = 15, legs = 8, wind = 4 }, or nil if the player has no character loaded
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.