> 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-advanced-taxi-job/offices-and-towns.md).

# Offices and towns

Move the CAS Advanced Taxi Job cab office, add offices in other towns, place the clerk, name pickup places and give each office a board map.

CAS Advanced Taxi Job ships with one office, the Tremont Cab & Motor Co. counter at Saint Denis Station. Every office has its own stand of cabs, its own named places and, when you want it, its own telegraph counter and board map. Drivers take the calls of the office they started their shift at.

## Recording coordinates

Stand on the spot in game and type `/taxipoint`. The position and heading are printed in the server console and shown to you as `vector4(x, y, z, heading)`. The command needs the ace `command.taxipoint`; see [Server settings](/script-documentation/cas-advanced-taxi-job/server-config.md).

## An office

```lua
Config.Offices = {
    {
        Id = 'stdenis',
        Label = 'Tremont Cab & Motor Co.',
        Town = 'Saint Denis',
        Street = 'Saint Denis Station',
        Coords = vector3(2735.98, -1393.99, 46.18),
        PromptRadius = 2.0,
        Clerk = {
            Model = 's_m_m_sdticketseller_01',
            Scenario = 'WORLD_HUMAN_SHOPKEEPER',
            Coords = nil,
        },
        Blip = { Sprite = 'blip_ambient_coach', Name = 'Cab Office' },
        Stand = {
            vector4(2748.80, -1406.30, 46.10, 120.21),
            vector4(2754.85, -1402.78, 46.10, 120.21),
            vector4(2760.90, -1399.26, 46.10, 120.21),
        },
        Return = vector3(2748.80, -1406.30, 46.10),
        ReturnRadius = 25.0,
        Map = { Image = 'stdenis', Bounds = { 2330.0, -1560.0, 3050.0, -946.0 } },
    },
}
```

| Field          | Description                                                                                                                                                                                                                                   |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Id`           | Unique id. `Config.Points`, `Config.LongHauls` and `Config.Calls.Telegraphs` refer to it.                                                                                                                                                     |
| `Label`        | Office name.                                                                                                                                                                                                                                  |
| `Town`         | Town shown on the office sheet and the board.                                                                                                                                                                                                 |
| `Street`       | Where the office is, shown under the title.                                                                                                                                                                                                   |
| `Coords`       | The counter. The **Talk to the clerk** prompt appears here.                                                                                                                                                                                   |
| `PromptRadius` | How close to stand for the prompt.                                                                                                                                                                                                            |
| `Clerk`        | The clerk behind the counter. See below.                                                                                                                                                                                                      |
| `Blip`         | Map blip sprite and name. `Blip = false` hides it.                                                                                                                                                                                            |
| `Stand`        | Where rented cabs appear, one cab per spot. The first free spot is used, so the number of spots is the number of company cabs this office has. Record them with `/taxipoint` standing where the cab should be, facing the way it should face. |
| `Return`       | Bring a rented cab back here to end the shift.                                                                                                                                                                                                |
| `ReturnRadius` | How close the cab must be.                                                                                                                                                                                                                    |
| `Map`          | The dispatch board map: an image name from the table below and the world box it shows. Leave it out for no map.                                                                                                                               |

## The clerk

Each office can have a clerk behind its counter: `Clerk = { Model, Scenario, Coords }`. He waits with the `Scenario` and looks at a player who comes to the counter or has the office open. With `Coords = nil`, the default, there is no clerk until staff place him; the counter prompt works either way.

The easiest way to place him is in game. Stand behind the counter where he should stand (within 40 m of the office), face the customers and type `/taxiclerk` (ace `command.taxiclerk`). He appears there at once for every player, the counter prompt moves 1.2 m in front of him, and the spot is kept on the server across restarts. The server console prints the `Coords` line to copy into the config.

## Named places

Pickups and drops are named places of the office. Every office needs at least two, at least `Dispatch.MinMiles` (0.17 mile) apart.

```lua
Config.Points = {
    stdenis = {
        { Name = 'Saint Denis Station', Coords = vector3(2747.23, -1394.92, 46.23) },
        { Name = 'Bastille Saloon', Coords = vector3(2632.93, -1225.34, 53.38) },
        -- ...
    },
}
```

Put each place on the pavement in front of the door, where a passenger would wait. The same names are offered as destinations on the player wire form and name a player's pickup when they stand within `Calls.NameRadius` of one.

## Long hauls

Senior cabbies get passengers who leave town. Their drops are listed per office:

```lua
Config.LongHauls = {
    stdenis = {
        { Name = 'Rhodes', Coords = vector3(1289.91, -1300.89, 77.04) },
        { Name = 'Van Horn', Coords = vector3(2985.92, 568.21, 44.63) },
        { Name = 'Annesburg', Coords = vector3(2931.48, 1283.01, 44.65) },
        { Name = 'Lagras', Coords = vector3(2128.90, -619.20, 42.45) },
    },
}
```

## Telegraph counters

```lua
Config.Calls.Telegraphs = {
    { Office = 'stdenis', Coords = vector3(2747.23, -1394.92, 46.23) },
}
```

Players wire for a cab at these counters. The wire goes to the drivers of the office named in `Office`.

## Board maps

The dispatch board shows the office's map with every call on it. Maps for nine towns are included. Copy the line for your town into the office:

| Town        | `Map`                                                                       |
| ----------- | --------------------------------------------------------------------------- |
| Saint Denis | `{ Image = 'stdenis', Bounds = { 2330.0, -1560.0, 3050.0, -946.0 } }`       |
| Valentine   | `{ Image = 'valentine', Bounds = { -660.0, 453.0, 60.0, 1067.0 } }`         |
| Blackwater  | `{ Image = 'blackwater', Bounds = { -1170.0, -1627.0, -450.0, -1013.0 } }`  |
| Rhodes      | `{ Image = 'rhodes', Bounds = { 950.0, -1577.0, 1670.0, -963.0 } }`         |
| Strawberry  | `{ Image = 'strawberry', Bounds = { -2150.0, -697.0, -1430.0, -83.0 } }`    |
| Annesburg   | `{ Image = 'annesburg', Bounds = { 2560.0, 1033.0, 3280.0, 1647.0 } }`      |
| Armadillo   | `{ Image = 'armadillo', Bounds = { -4040.0, -2917.0, -3320.0, -2303.0 } }`  |
| Tumbleweed  | `{ Image = 'tumbleweed', Bounds = { -5870.0, -3257.0, -5150.0, -2643.0 } }` |
| Van Horn    | `{ Image = 'vanhorn', Bounds = { 2610.0, 243.0, 3330.0, 857.0 } }`          |

`Bounds` is the world box the picture shows: `{ min x, min y, max x, max y }`. Keep the numbers that come with the image; with other numbers the pins no longer sit on the right streets. An office whose `Image` is not in the list shows *No map for this town* and the board's list still works.

## Adding an office, step by step

1. Pick the town and stand at the counter you want. `/taxipoint` gives `Coords`.
2. Record two to four `Stand` spots in the street outside and one `Return` spot.
3. Add the office to `Config.Offices` with a new `Id` and the `Map` line of the town.
4. Add at least two named places under `Config.Points[<Id>]`, more makes better trips.
5. Optional: a telegraph counter in `Config.Calls.Telegraphs` and long hauls in `Config.LongHauls[<Id>]`.
6. `ensure cas-taxi`, then talk to the clerk at the new counter, and place him with `/taxiclerk` if you want one.
