Skip to content

Configuration

Every key in tCAD's config.lua, with its type, default and the reason for it — storage backend, first-boot seed, the export switch, the open key, and the ACE permission map.

Everything settable is in config.lua at the resource root. It is validated at boot by product code, so a malformed value is named in the console against the field that is actually wrong — not as an error in an innocent file further down.

Both locations are escrow_ignore'd, so your edits survive every update. See Updating.

Every key at a glance

KeyTypeDefaultWhat it decides
Config.storagestring'auto'Which storage backend to use
Config.seedstring'full'Which world is created on the first boot
Config.exposeWebbooleanfalsePublish the CAD to a browser through tLib's HTTP router
Config.exports.allow911booleantrueLet another resource file a 911 call on a player's behalf
Config.acePermissionstring'tcad.use'The ACE object needed to open the CAD at all
Config.openKeystring'F10'The default keybind. '' ships unbound
Config.permissionstable19 keysEvery capability, mapped to an ACE object

Nothing in this file is required. Every value has a working default, because the first thing a new owner does is start the resource without having read it.

Config.storage

lua
Config.storage = 'auto'
ValueEffect
'auto'Detect, in order: tDB, then oxmysql, then JSON. The default
'tdb'Force the SQL adapter via tDB
'oxmysql'Force the SQL adapter via a real oxmysql
'json'Force the file backend. No database resource needed at all

'tdb' and 'oxmysql' reach the same adapter. tDB declares provide 'oxmysql' and registers the oxmysql export names, so one code path is satisfied by either resource. The two names exist so you can pin the choice rather than rely on detection order.

Detection compares GetResourceState against 'started', never against ~= 'missing'. A leftover database folder you stopped months ago reads as present under the looser test and would knock out the live one.

An unrecognised value is reported by name, with the legal set, and detection is used. It is not a silent fallback: a transposed 'tbd' once selected detection while the console reported the detected backend as though it had been asked for.

Config.seed

lua
Config.seed = 'full'

Which world the CAD creates on its first boot, before any staff configuration.

ValueWhat is created
'full'Six agencies, ten departments, 24 status codes. The default
'minimal'Three agencies, three departments, 18 status codes — an LSPD patrol division, an LS Fire & EMS fire division, and a communications desk

Both backends seed the same world for the same setting, from one shared table. They did not always: the file backend used to seed three agency types and the SQL one six, so three department views were unreachable depending on which database a server happened to be running. That is now structurally impossible rather than discouraged.

Seeding only ever happens into empty tables. Changing this value on a server that has already booted does nothing — the seed is gated on emptiness, so a staff member's edit to a label survives every restart. Use tcad_reseed in the server console to re-run it.

Config.exposeWeb

lua
Config.exposeWeb = false

Publish the CAD to a web browser and the desktop app through tLib's HTTP router, in addition to the in-game NUI.

false by default and deliberately so: the in-game CAD does not need it, and turning it on opens the CAD to anything that can reach tLib's listener. tLib's router adds no authentication of its own — hidden is not authenticated — so a browser surface carries its own login.

Config.exports.allow911

lua
Config.exports = {
    allow911 = true,
}

Lets another resource — a phone script, a radio dispatcher — put a 911 call into the CAD on a player's behalf.

This is the one export that checks no permission, and that is deliberate rather than an oversight: a civilian dialling 911 holds no CAD grant and must not be given one. Granting tcad.use to group.user to make 911 work would hand every player the whole CAD, which is a far worse trade.

It is bounded on every other axis instead:

  • a fixed payload, with callType forced to 911;
  • priorityId is not accepted — a caller does not triage their own call;
  • attributable to a connected player holding a licence identifier;
  • rate limited per player and globally.

Set it to false to refuse it. Every other export still works; this one answers disabled, a code distinct from rate_limited and from starting, so a phone resource can tell "your server turned this off" from "try again".

It defaults to true, and that is forced rather than chosen: the key is newer than some installs, config.lua is escrow_ignore'd, and every existing copy is therefore missing it. A default of false would silently break 911 on every server that upgrades without touching their config. An absent key behaves identically to allow911 = true.

Config.acePermission

lua
Config.acePermission = 'tcad.use'

The ACE object a player needs to open the CAD at all. Answered through tlib.permission.has, so a framework resolver registered with tLib can answer it instead of ACE.

Config.openKey

lua
Config.openKey = 'F10'

Covered in full under Installation, including why a default keybind is a one-way door and why '' is the safest value on a busy server.

Config.permissions

Nineteen capabilities, each mapped to an ACE object name. Renaming a value is supported and is the point of the indirection. Deleting a key is not: the resource raises at the call site naming the missing key, rather than silently denying everyone — a CAD that refuses every action with no explanation is indistinguishable from a broken one.

Permissions is the full table, with what each key gates and which ones reach personal data. Read that page before granting anything.

Validating a change

tcad_config

in the server console prints every key with its resolved value and names anything malformed. Run it after every edit — config.lua is read at resource start, so a change needs a restart of tCAD, and a typo that parses as valid Lua is otherwise invisible until the feature it governs misbehaves.

Was this page helpful?