# Demo mode

`/mdtdebug` fills the MDT with believable data and lets you trigger events on demand. It is meant for recording showcases, screenshots and testing. It is not a gameplay feature.

:::hint{type="danger" title="Disable it in production"}
Set `Config.DebugTools.enabled = false` on a live server. With that setting `/mdtdebug`, the demo seed and the fake player layer are not registered at all. If you keep it on, only players with an allowed ace can use it, see below.
:::

## Requirements

- The player must have one of the aces in `Config.DebugTools.aces`. The default list is `koja-mdt.debug` and `command`.
- For `seed`, `unseed` and the data commands (`call`, `wave`, `panic`, `alpr`, `warrant`, `mail`) the player must also be a registered officer in the MDT, that is, hold a job from `shared/departments.lua`. Otherwise the command fails (for `seed` with a message that the player must be an MDT officer).
- Without the ace the commands answer with a no permission message.

Give the ace in `server.cfg`:

```cfg title="server.cfg"
add_ace group.admin koja-mdt.debug allow
```

:::hint{type="info" title="Language"}
The notifications printed by `/mdtdebug` are in Polish and are not part of the translation files. The commands and their effects work in any language.
:::

## Commands

Type `/mdtdebug` with no action to print the help line. Chat shows a suggestion with all actions.

| Command | Description |
|---|---|
| `/mdtdebug seed` | Fills the MDT with demo data (see below). If demo data already exists it is removed first. Reopen the MDT afterwards. |
| `/mdtdebug unseed` | Removes everything the seed created. |
| `/mdtdebug call [code]` | Creates one dispatch call at a random place. Codes: `10-71`, `10-68`, `10-50`, `10-16`, `10-60`, `10-66`, `10-10`, `10-55`, `10-90`, `10-52`, `F-STR`. Without a code a random scenario is used. |
| `/mdtdebug call here` | Creates a random call at your own position and street. |
| `/mdtdebug wave [n]` | Creates `n` random calls (1 to 8, default 4) one after another, 7 to 12 seconds apart. |
| `/mdtdebug panic` | Creates a panic call (10-99) from one of the demo officers. |
| `/mdtdebug alpr` | Creates an ALPR hit call (code `10-ALPR`) for a stolen demo vehicle and writes it to the ANPR log. |
| `/mdtdebug warrant` | Creates a pending arrest warrant in your department and notifies the department, so a judge can approve it. |
| `/mdtdebug mail` | Delivers a mail from a demo officer to your inbox with a notification. |
| `/mdtdebug cam [mode]` | Spawns a fake officer with a recording bodycam. Mode is `run` (default), `walk` or `drive`. The first two move on foot, `drive` puts the officer in a siren-lit patrol car. Watch it in the MDT under Body cameras. |
| `/mdtdebug citizen [car]` | Spawns a fake citizen in front of you, optionally with a car. Write a citation for them or look them up in the MDT. |
| `/mdtdebug mood [mood]` | Mood is `sign`, `refuse` or `random`. Sets how fake citizens react to citations and ID requests. `random` uses `Config.DebugTools.signChance`. |
| `/mdtdebug event [kind]` | Kind is `shot`, `taser` or `note`. Fires a bodycam event on all your fake officers' cameras and reports how many cameras received it. |
| `/mdtdebug clear` | Deletes the fake officers and citizens you spawned. |

Fake peds are also removed when you disconnect and when the resource stops.

## What seed creates

The seed writes into your database with identifiers starting with `demo:` and remembers the row ids it created, so `unseed` removes exactly those rows. The data is attached to the department of the player who ran the command.

| Area | Content |
|---|---|
| Officers | 12 demo members across LSPD, BCSO, SAHP, EMS, LSFD and a DOJ judge, with callsigns, badges, a week of duty sessions, division memberships, certifications, and rewards and strikes |
| People | 15 demo citizens with flags, notes and licenses. They appear in people search while the seed is active |
| Vehicles | 12 demo vehicles linked to those owners, some stolen, wanted, uninsured or unregistered |
| Reports | Several reports with officers, suspects, victims, witnesses, charges and vehicles, some closed and processed |
| Evidence | Locker items with chain of custody entries |
| Warrants | Warrants linked to reports, including pending ones |
| BOLOs and bulletins | 4 BOLOs and 4 bulletins |
| Citations | Tickets linked to reports |
| Court | Cases with charges, hearings and docket entries |
| Custody | Jail records and impounds |
| Mail, calendar, notifications | Mails in your inbox, 4 calendar events and notification entries |
| ANPR | Several ANPR log entries |

The demo people and vehicles are injected into the framework bridge only while the seed is active. They are not written into your framework tables.

## Typical showcase recording

::::steps
### Prepare

Join with a police job, go on duty and open the MDT once.

### Seed

Run `/mdtdebug seed` and reopen the MDT. Dashboard, people, vehicles and reports are now filled.

### Add live action

Use `/mdtdebug wave 4` for calls arriving, `/mdtdebug panic` for a panic alert, `/mdtdebug alpr` for a plate hit and `/mdtdebug mail` for a new mail.

### Add field actors

Spawn `/mdtdebug cam drive` for a bodycam stream and `/mdtdebug citizen car` for a citation scene. Use `/mdtdebug mood sign` so the citizen always signs.

### Clean up

Run `/mdtdebug clear` and `/mdtdebug unseed`.
::::

## Config

| Option | Default | Description |
|---|---|---|
| `Config.DebugTools.enabled` | `true` | Master switch. `false` disables all of the above. |
| `Config.DebugTools.aces` | `{ 'koja-mdt.debug', 'command' }` | Aces allowed to use the tools. |
| `Config.DebugTools.signChance` | `0.75` | Sign chance for the `random` mood. |
| `Config.DebugTools.officerModel` | `'s_m_y_cop_01'` | Fake officer ped. |
| `Config.DebugTools.citizenModels` | five models | Fake citizen peds. |
| `Config.DebugTools.patrolVehicle` | `'police'` | Vehicle for `cam drive`. |
| `Config.DebugTools.citizenVehicle` | `'sultan'` | Vehicle for `citizen car`. |
