> ## 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 the config folder, explained in plain words.

The settings live in three files of `rco-steamline/config/`:

* `config.lua`: the general options, companies, trains, the boiler, keys, passengers, freight, wear and the server trains;
* `offices.lua`: the railroad offices and the workshops;
* `supply.lua`: the coal piles and water towers.

Open them 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 with your game closed.

## 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 your server runs both | `'auto'` |
| `Config.MoneyAccount` | The money players pay with: `'cash'` (RSG cash, VORP dollars) or `'gold'` (VORP gold). On RSG, `'bank'` works too | `'cash'` |
| `Config.DisableGameTrains` | Turns off the game's own random trains, so they never run into the players' trains | `true` |
| `Config.Command` | The admin command (see [Admin](https://rust-co.mintlify.site/rco-steamline/admin.md)) | `'steamline'` |
| `Config.MaxTrains` | Player trains in the world at the same time, the whole server. The server's own trains leave to make room for them | `6` |
| `Config.Debug` | Prints extra messages in the server and F8 consoles. Turn it on only to find a problem | `false` |

`Config.Volume` sets the resource's own sounds, from `0` (off) to `1`. Each one fades out with distance.

| Setting | The sound | Default |
| - | - | - |
| `Shovel` | The coal shovel, heard by the players near | `0.8` |
| `Injector` | The injector's valve and singing, at the cab | `0.7` |
| `Water` | The water falling from a tower's spout into the tender | `0.6` |
| `Repair` | The repair work at the engine and on the track, heard within 6 m | `0.8` |

## Companies

No company, no train: every player who wants a train opens a company at a railroad office, even alone. The roles only control the company; anyone in it drives, shovels coal and checks tickets.

| Setting | What it does | Default |
| - | - | - |
| `Config.Company.OpenPrice` | Paid from the pocket to open a company | `20.0` |
| `Config.Company.MaxMembers` | People in one company, the owner included | `20` |
| `Config.Company.MaxTrainsOut` | Trains one company may have in the world at once | `2` |
| `Config.Company.InviteSeconds` | How long a job offer waits for an answer | `60` |
| `Config.Company.Commission` | % of a freight contract's pay shared by the members who carried it. Each company's owner can change it for his company at the office | `10` |

## Wear and repairs

Wear goes from `0` (new) to `100` (worn out) for the wheels, the brakes and the boiler. Worn wheels make the train slower, worn brakes stop it worse and a worn boiler makes less pressure.

| Setting | What it does | Default |
| - | - | - |
| `WheelsPerKm` / `WheelsPerOverspeed` | Wheel wear per km driven / per second above `OverspeedMph` | `0.4` / `0.05` |
| `BrakesPerKm` / `BrakesPerHardBrake` | Brake wear per km / per second of hard braking (brake over 70% while moving) | `0.2` / `0.08` |
| `BoilerPerKm` / `BoilerPerLowWater` | Boiler wear per km / per second with low boiler water under a high fire | `0.2` / `0.01` |
| `BoilerPerHighPressure` | Boiler wear per second with the pressure at the top | `0.005` |
| `HighPressure` | The share of the boiler's top pressure that counts as "the top" | `0.9` |
| `OverspeedMph` | Above this speed (mph) the wheels wear faster | `25` |
| `MaxLoss` | The share of speed, braking and pressure lost at 100 wear (`0.35` = 35%) | `0.35` |
| `Repair` | The full price of each part, from 100 wear to new: `wheels` $50, `brake` $30, `boiler` \$100. Less wear costs less. | |
| `PartsShare` | The crew repairs the train itself and pays only this share of that price | `0.4` |

All of them are inside `Config.Wear`. Wheels at 50 wear cost `50 × 50% × 0.4 = $10` to repair. See [Maintenance](https://rust-co.mintlify.site/rco-steamline/maintenance.md).

## Trains

| Setting | What it does | Default |
| - | - | - |
| `Config.GraceSeconds` | A train with no crew member near brakes to a stop and is removed after this many seconds, parked back at the yard it was called from | `300` |
| `Config.CrewRadius` | Metres: a crew member closer than this keeps the train alive | `150.0` |
| `Config.SwitchRadius` | Metres: the driver throws a switch from the cab when it is this close, and only when no other train is on it | `400.0` |

### The catalogue

`Config.Trains` is what the office sells. A company buys the engine once (it comes with its tender), then its cars one at a time (`Config.Cargo.Price`).

```lua theme={"dark"}
Config.Trains = {
    steamline = { label = 'Steamline', price = 1800.0,
        description = 'Engine and tender. Pulls the cars your company buys.' },
}
```

Change the `label`, the `price` (paid from the company's till) or the `description` shown in the catalogue. Keep the name `steamline`.

### The yards

`Config.Yards` lists the stations where trains are called and parked. A station not listed is not a stop: no tickets, passengers or freight there.

```lua theme={"dark"}
station_rho = { label = 'Rhodes', coords = vector3(1215.30, -1299.80, 75.58), heading = 31.18, radius = 150.0,
    call = vector4(1237.50, -1315.35, 76.90, 110.55) },
```

| Setting | What it does |
| - | - |
| the name before `=` | The station's id (`station_rho`). Keep it: it is the railway's own name for that station |
| `label` | The name shown on the yard screen |
| `coords` | A point on the station's own track, where the train is created |
| `heading` | Optional: the way the train faces there by default |
| `radius` | Metres: no train may be called while another train is closer than this |
| `call` | Optional: where the player stands to call a train, when it is not at `coords`: `vector4(x, y, z, heading)` |
| `counter` | Optional, for a station with no office: its ticket counter, where the NPCs getting off walk to and leave |

### The booths

`Config.Booths` puts the Steamline booth of each station, where trains are called and freight contracts are taken: `[station id] = vector4(x, y, z, heading of the counter)`. A station not listed uses its yard's `call` point.

## Boiler and cab

Pressure in psi, coal in kg, water in litres, time in seconds. All of them are inside `Config.Boiler`.

| Setting | What it does | Default |
| - | - | - |
| `TenderCoalMax` / `FireboxCoalMax` | Coal the tender / the firebox holds | `1500` / `150` |
| `TenderWaterMax` / `BoilerWaterMax` | Water the tender / the boiler holds | `20000` / `4000` |
| `BurnRate` | kg of coal burned per second with the fire fully open and the throttle open | `0.12` |
| `WaterPerPsi` | Litres turned to steam per psi used | `1.33` |
| `PressurePerKg` | Psi made by each kg of coal burned: higher builds pressure faster and holds more of it under way | `40.0` |
| `CoolRate` | Share of the pressure lost each second as the boiler cools (`0.004` = 0.4%) | `0.004` |
| `InjectorRate` | Litres per second the injector moves from the tender to the boiler | `20` |
| `DamageRate` | Boiler damage per second with low water under a high fire (`1.0` = ruined) | `0.01` |
| `DryBoiler` | The boiler runs dry with the fire on: `'stop'` (the train only stops) or `'explode'` | `'stop'` |
| `WreckClearSeconds` | With `'explode'`: seconds until the wreck is cleared and sent to the nearest workshop's yard | `60` |
| `SpeedMax` | m/s at full pressure with a light train (`12` = 27 mph). Heavier trains are slower | `12.0` |
| `Start` | What a train has the first time it is called: coal and water in the tender and the boiler, the pressure and the fire. Later calls bring back what it had when parked | |

Every call is a warm start: the fire is lit and the boiler has pressure, so the train can leave at once.

| Setting | What it does | Default |
| - | - | - |
| `Config.ThrottleNotches` | Steps of the throttle | `8` |
| `Config.ShovelKg` | kg of coal one shovel moves from the tender to the firebox | `15` |
| `Config.ShovelSeconds` | Seconds between two shovels | `2.5` |

## Keys

Keys are written as the game's code of the key, not as a letter. The [keys page](https://rust-co.mintlify.site/keys.md) has the code of each one. Some keys are shared on purpose: each prompt only shows where the other does not. Avoid F (on foot it is also melee, hogtie and cut free), the number keys (hotbar) and the arrows.

| Setting | What it does | Default |
| - | - | - |
| `ThrottleUp` / `ThrottleDown` | Throttle one step up / down | **W** / **S** |
| `ReverserBack` / `ReverserFwd` | Reverser back / forward, with the train stopped | **A** / **D** |
| `Brake` | Brake, hold | **Space** |
| `Emergency` | Emergency brake | **X** |
| `Whistle` | Whistle | **H** |
| `Cruise` | Holds the current speed | **C** |
| `Injector` | Injector on and off | **R** |
| `FireUp` / `FireDown` | Fire up / down, in the cab | **U** / **L** |
| `Shovel` | Coal from the tender to the firebox, in the cab | **B** |
| `MapCollapse` | Folds the cab map, again to show it | **Q** |
| `Switch` | Throws the next switch to its other exit | **Z** |
| `Interact` | Coal pile, tender, water tower, cargo, switch lever, office, repair, seat | **G** |
| `TakeControls` | Near the engine: sit in the driver's seat | **U** |
| `Fireman` | Near the engine: work the fire; again to leave | **J** |
| `Yard` | At the booth: the yard screen | **J** |
| `Ticket` | The ticket counter (office or platform) | **L** |
| `Check` | Conductor: check a passenger's ticket | **G** |
| `Workers` | At a broken rail with a caboose near: its workers repair it | **J** |
| `Camera` | In the cab or seated: the next train camera | **V** |

All of them are inside `Config.Keys`.

## Coal and water

| Setting | What it does | Default |
| - | - | - |
| `Config.CoalPerTrip` | kg each shovel trip from the pile adds to the tender | `75` |
| `Config.WaterRate` | Litres per second while a tower's spout is open | `150` |

The coal piles and water towers are in `config/supply.lua`, one per station with the station's id, plus towers along the line:

```lua theme={"dark"}
Config.Supply.station_val = { -- Valentine
    coal = vector3(-161.99, 636.58, 112.67), water = vector3(-156.58, 642.53, 112.67), waterHeading = 53.4,
    hide = { { model = 'p_watertower_med_05', coords = vector3(-158.99, 644.32, 116.44) } } }
```

| Setting | What it does |
| - | - |
| `coal` | Where the coal pile stands (players shovel here, then walk to the tender) |
| `coalHeading` | Optional: the pile's heading, its -Y side to the track. Without it, `waterHeading` |
| `water` | Where the water tower stands, on the ground, 3.2 m from the middle of the track (its spout reaches the tender) |
| `waterHeading` | The tower's heading: its spout swings out toward the tower's -Y side, so face that side to the track |
| `hide` | Game objects the resource's own props replace, hidden while ours is near |
| `label` | The name shown, for a tower away from a station |

Edit, remove or add entries freely. A tower along the line has only `water`.

## Offices and workshops

`config/offices.lua` has the railroad offices: the station's office where companies are opened and run, which is also its ticket counter.

```lua theme={"dark"}
{ label = 'Rhodes Station', station = 'station_rho', coords = vector3(1231.19, -1296.21, 76.90),
  cargoPoint = vector3(1221.020, -1299.076, 75.908), cargoHeading = 45.9 },
```

| Setting | What it does |
| - | - |
| `label` | The name shown |
| `station` | The yard (an id of `Config.Yards`) the tickets leave from |
| `coords` | Where the counter is. The NPCs getting off walk there and leave |
| `cargoPoint` | Where the freight of a contract waits, beside the platform track. A station without one has no freight |
| `cargoHeading` | The track's heading at the cargo point |
| `pileShift` | Optional: metres along `cargoHeading` to the delivery pile (default `6`; `0` = on the cargo point) |

`Config.Workshops` lists the workshop sidings, where a stopped company train is repaired: `label`, `coords` (the middle) and `radius` (how close, in metres, the train must be). Annesburg, Emerald, Flatneck and Heartland Oil Fields come ready. Every station repairs too: a company train stopped within its yard's `radius` gets the same repair. Where a station and a workshop overlap, the workshop is used.

## Passengers

Money in \$, time in seconds, distances in metres. All of them are inside `Config.Passenger`.

| Setting | What it does | Default |
| - | - | - |
| `TicketItem` | The inventory item of the ticket | `'rco_train_ticket'` |
| `TicketSeconds` | How long a ticket is good for after it is bought | `24 * 3600` |
| `BasePrice` / `PricePerKm` | Ticket price = `BasePrice + PricePerKm × km` along the track. NPC passengers pay the same for the stretch they rode | `0.10` / `0.40` |
| `MinMeters` | No ticket for a trip shorter than this | `300` |
| `ArrivalMinutes` | Arrival notices for trains less than this many minutes away | `10` |
| `NpcMaxOff` / `NpcMaxOn` | At most this many NPC passengers get off / on at each stop | `4` / `4` |
| `WaitMin` / `WaitMax` | NPCs waiting on the platform for an arriving company train | `2` / `6` |
| `StopSeconds` | The train must stand this long at a station before the NPCs move | `1` |
| `WaitSeconds` | Waiting NPCs give up after this long with no stop | `180` |

A 10 km trip costs `0.10 + 0.40 × 10 = $4.10`.

## Freight

Money in \$, time in seconds. All of them are inside `Config.Cargo`.

| Setting | What it does | Default |
| - | - | - |
| `MaxOwned` | Cars one company may own | `12` |
| `Price` | The price of one car, paid from the company's till; sold only to a company that owns an engine | passenger `900`, boxcar (`closed`) `55`, flatcar (`flatbed`) `110`, caboose `170` |
| `Contracts` | Contracts one car carries | flatcar `2`, boxcar `1` |
| `Types` | What contracts carry: the name, and how many pieces `{ min, max }` one contract asks for | crates `{ 6, 12 }` (whole stacks of 3), barrels `{ 4, 12 }`, logs `{ 8, 16 }` |
| `PerStation` | Contracts on offer at each office | `3` |
| `RefreshSeconds` | Offers nobody took are replaced after this long | `1800` |
| `MaxActive` | Contracts one train may hold at once | `3` |
| `PayBase` / `PayPerTonKm` | Payment = `PayBase + PayPerTonKm × tons × km` along the track | `5.0` / `0.18` |
| `DeadlineBase` / `DeadlinePerKm` | Time to deliver after accepting: base + per km | `900` / `120` |
| `LatePay` | The share paid when the deadline has passed | `0.5` |
| `ExpireGrace` | Seconds after the deadline when the contract is cancelled and its pieces vanish | `600` |

## Track maintenance

Repair points appear along the lines. A company with a train stopped near one repairs it: the caboose's workers do it when the train has a caboose, or the player does it by hand with the tools from the tender.

| Setting | What it does | Default |
| - | - | - |
| `Config.Maintenance.Points` | Repair points open at once on the whole railway | `6` |
| `Config.Maintenance.RemoteAt` | Metres from the nearest station: from here on a break is as likely as anywhere; closer in it gets rarer (none at the station itself) | `1500.0` |
| `Config.Maintenance.Pay` | \$ paid to the company's till for each repair | `2.0` |

## Customisation prices

`Config.CustomPrices` is what each change of the engine's look costs, paid from the company's till. Taking a piece off is free.

| Setting | The change | Default |
| - | - | - |
| `tint` | Locomotive paint | `8.0` |
| `tenderTint` | Tender paint | `5.0` |
| `front` | Locomotive front colour | `3.0` |
| `livery` | Locomotive livery | `12.0` |
| `tenderLivery` | Tender livery | `8.0` |
| `star` | Door star | `1.5` |
| `candles` | Pair of brass candlesticks beside the headlight | `3.0` |
| `toolbox` | Toolbox on the tender | `2.5` |

## Server trains

The server's own trains run a timetable when no player train needs the line. A train exists in the world only near players; far from everyone, its place is worked out from the timetable. It gives the line up to a player train that needs it, and is taken off if it stands still too long.

| Setting | What it does | Default |
| - | - | - |
| `enabled` | `false` turns the server trains off | `true` |
| `Speed` | m/s on the run (`12` = 27 mph), for a route without its own speed | `12.0` |
| `Dwell` | Seconds standing at each stop, for a route without its own dwell | `45` |
| `SpawnRadius` | Metres: a player this close to where the timetable puts it brings it into the world | `300.0` |
| `DespawnRadius` | Metres: with nobody this close, it leaves the world (the timetable goes on) | `450.0` |
| `GraceSeconds` | Standing still away from a station this long: taken off and set back | `120` |
| `YieldSeconds` | After giving the line up (or being taken off), it stays out of the world this long | `300` |
| `Fares` | Sells tickets at the counter, as the company "Railroad" | `true` |
| `FareCompany` | The id of a company that receives the fares; `nil` = the money goes nowhere | `nil` |

All of them are inside `Config.NpcTrain`. `Config.NpcRoutes` lists the routes: each one is its own train with its own timetable, stop to stop and back.

```lua theme={"dark"}
{ name = 'Bayou Express', stops = { 'station_rho', 'station_nb' },
  train = 'steamline', cars = { 'passenger', 'passenger', 'caboose' }, speed = 14.0 },
```

| Setting | What it does |
| - | - |
| `name` | The train's name, shown to players |
| `stops` | Yard ids in order (`Config.Yards`) |
| `train` | A train id from `Config.Trains` |
| `cars` | Its cars in order (`'passenger'`, `'closed'`, `'flatbed'`): up to 3, plus an optional `'caboose'` last |
| `speed` / `dwell` | Optional: m/s on the run / seconds at each stop |

Four routes come ready: Heartland Local (Valentine, Emerald, Rhodes), Lannahechee Line (Saint Denis, Annesburg), Bayou Express (Rhodes, Saint Denis) and Cumberland Line (Riggs, Wallace, Valentine). A route whose stops the track does not join is left out, with a warning in the server console.


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