> For the complete documentation index, see [llms.txt](https://acestudios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://acestudios.gitbook.io/docs/tactical-and-military/tactical-hud/configuration.md).

# Configuration

Configure ace\_armorcams through Config.lua.

All settings are in `ace_armorcams/Config.lua`.

## Main settings

```lua
Config.MainSettings = {
    ScriptName = 'Tactical-Hud',
    ToggleZoomButton = 'Q',
    SwitchViewKey = 'E',
    DebugCommandActive = true,
    ServerDebugName = true,
}
```

| Option               | Type    | Default          | Description                                                                                      |
| -------------------- | ------- | ---------------- | ------------------------------------------------------------------------------------------------ |
| `ScriptName`         | string  | `'Tactical-Hud'` | Name used throughout the script.                                                                 |
| `ToggleZoomButton`   | string  | `'Q'`            | Key that toggles zoom in the commander camera.                                                   |
| `SwitchViewKey`      | string  | `'E'`            | Key that switches between driver and gunner view on vehicles with `DriverControlsWeapon = true`. |
| `DebugCommandActive` | boolean | `true`           | Enables the `/SeatID` command, which shows your current seat ID.                                 |
| `ServerDebugName`    | boolean | `true`           | Prints `ACESTUDIOS` in the server console.                                                       |

{% hint style="info" %}
Set `DebugCommandActive = false` on live servers once you've finished setting up vehicles.
{% endhint %}

## HUD presets

A preset pairs the overlay textures and range readout position. Vehicles refer to presets by name.

```lua
Config.HudPresets = {
    ['TANK'] = {
        texturedict = 'ace_armorcamstxd',
        gunnertexture = 'ace_tankhud_gunner_zoomlevel',
        commandertexture = 'ace_crowhud_zoomlevel',
        MaxZoomLevel = 3,
        RangeNumberLocationOnScreen = {x = 0.5, y = 0.8, s = 0.7}
    },
}
```

| Field                         | Description                                                                                                                                                                                                                  |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `texturedict`                 | Texture dictionary that contains the overlays. The default is `ace_armorcamstxd`, and you don't need to change it.                                                                                                           |
| `gunnertexture`               | Texture name of the gunner seat overlay.                                                                                                                                                                                     |
| `commandertexture`            | **Base** texture name of the commander overlay. For zoom, add one texture per zoom level with the number at the end (for example `mytexture1`, `mytexture2`, `mytexture3`), then enter the name **without** the number here. |
| `MaxZoomLevel`                | Number of commander zoom levels (the ReadMe describes levels 1–3).                                                                                                                                                           |
| `RangeNumberLocationOnScreen` | Screen position (`x`, `y`, from 0.0 to 1.0) and scale (`s`) of the range numbers shown in gunner and commander mode.                                                                                                         |

### Adding a preset

1. Open `stream/ace_armorcamstxd.ytd` in **OpenIV** and add your gunner overlay plus one commander overlay per zoom level.
2. Add a new entry to `Config.HudPresets` that uses your texture names.

## Vehicles

```lua
Config.Vehicles = {
    ['khanjali'] = {
        HudPreset = 'IFV',
        DriverControlsWeapon = true,

        DriverSeat = -1,
        DisableDriveWhileInGunnerMode = true,
        LockZAxisRotForCommander = true,
        GunnerSeat = false,
        CommanderSeat = 0,

        CommanderCameraPos = {x = 0.0, y = -1.1, z = 1.5},
        DriverCameraPos = {x = 0.0, y = 2.5, z = 0.2},
    }
}
```

The table key (for example `'khanjali'`) is the vehicle's spawn name.

| Field                           | Required | Description                                                                                         |
| ------------------------------- | :------: | --------------------------------------------------------------------------------------------------- |
| `HudPreset`                     |     ✅    | Name of an entry in `Config.HudPresets`.                                                            |
| `DriverControlsWeapon`          |     ✅    | If `true`, the driver seat can switch between driver view and gunner view with `SwitchViewKey`.     |
| `DriverSeat`                    |     ✅    | Seat ID of the driver (usually `-1`).                                                               |
| `DisableDriveWhileInGunnerMode` | Optional | Blocks driving while the driver is in gunner view. Only applies when `DriverControlsWeapon = true`. |
| `LockZAxisRotForCommander`      | Optional | Locks the commander camera view to 45°.                                                             |
| `GunnerSeat`                    |     ✅    | Seat ID of the gunner, or `false` to turn off the separate gunner seat.                             |
| `CommanderSeat`                 |     ✅    | Seat ID for the commander view, or `false` to turn it off.                                          |
| `CommanderCameraPos`            |     ✅    | Offset of the commander camera from the vehicle.                                                    |
| `DriverCameraPos`               |     ✅    | Offset of the driver camera from the vehicle.                                                       |

### Adding a vehicle

{% stepper %}
{% step %}

### Find the seat IDs

Make sure `DebugCommandActive = true`, sit in each seat of the vehicle, and run `/SeatID`.
{% endstep %}

{% step %}

### Add the entry

Copy one of the existing vehicle entries, rename the key to your vehicle's spawn name, and fill in the seat IDs and preset.
{% endstep %}

{% step %}

### Adjust camera positions

Restart the resource and adjust `CommanderCameraPos` and `DriverCameraPos` until the cameras sit where you want them.
{% endstep %}
{% endstepper %}
