DirkScripts
Live Script Configurator
Every basic setting, backstory, spawn location, lifestyle, character state and VIP role in dirk_multichar is editable from the in-game Live Script Configurator. Changes save to the dirk_scriptConfig database table and apply live β no SQL imports, no Lua edits, no resource restart.
β Opening the configurator
You have two options, both registered by dirk_lib:
/dirk_multicharβ opens the configurator straight to the multichar config./dirk_configβ opens the chooser listing every dirk script on the server and lets you pick which one to configure.
The cog icon on the character-list title bar inside the multichar UI also opens the configurator (gated by dirk_lib's scriptConfig edit permission). Back / Esc / close drop you straight back into the character list β no bouncing through the chooser.
Only players with the configured admin permission (set up via dirk_lib) can access either command.
#Sidebar Controls
- Undo / Redo β full edit history.
- Save β persist pending changes (a badge shows the number of unsaved edits).
- History β timestamped audit log of every change, who made it, and the old vs new values.
- Discard β drop unsaved edits.
- Manual Edit (JSON) β open a raw JSON editor for the entire config.
- Reset Defaults β wipe everything and reload shipped defaults (with confirmation).
#Sections
The configurator has six top-level sections, listed in the sidebar:
Basic Β· Scene Β· Backstories Β· Spawn Locations Β· States Β· VIP Roles
#Basic
General script settings: logout flow, debug toggles, UI tweaks. Anything that doesn't belong inside a more specific tab lives here.
#Scene
Controls the character-selection scene itself:
- Drag-reorder character display positions (where each slot stands during selection).
- Scenario / Dict / Anim / Flag rows per position to drive what each character is doing on screen.
- Walk-and-set position picker β E to confirm, β« to cancel. Places positions in-world while you're standing where you want them.
- Customisation position β where the player stands during clothing handoff.
- Atmosphere β weather + time for the selection scene. Applies during selection, restores cleanly on hand-off to the spawn selector / first spawn.
#Backstories
Modal editor per backstory with four tabs:
| Tab | What lives here |
|---|---|
| General | Name, label, description. |
| Access | Locked toggle + Discord role gating (only when Locked is on). |
| Items | Compact SelectItem list with inline expand β pick items + quantity to grant on spawn. |
| Scenes | The scripted intro sequences. Each scene has its own walk-set position, scenario/anim row, and atmosphere. |
Modal height is fixed so switching tabs doesn't reshape the panel.
#Spawn Locations
Modal editor with:
- Name + label
- FontAwesome icon picker for the map / list display
- In-game group / rank picker backed by
lib.frameworkβ gate spawns by job, gang or any framework grouping - Randomised internal IDs (no more hand-typed
spawn_1slugs) - Use Spawn Selector toggle (was previously elsewhere β moved here to keep all spawn-related settings together)
#States
Two parts:
- Edit visual states β icon + colour + message + Disabled toggle per state. Disabled states block character usage entirely (good for "Coma", "In Hospital"-style flags).
- Online Players panel β search any online character and apply a state to them from the same tab.
#VIP Roles
- Add roles via Discord role ID β extra character slots are granted automatically when the player has any of these roles.
- Use ESX Character Slots Table toggle β when on, slot counts come from ESX's native
users.character_slotscolumn instead of the role-based mapping. ESX-only servers use this for parity with the rest of their slot tracking.
#scriptConfig + Lua API
dirk_multichar v1.5 reads everything from dirk_lib's scriptConfig at runtime. Lua-side consumers can subscribe to live changes:
lualib.scriptConfig.on('backstories', function() -- runs every time an admin saves the Backstories tab end)
Each section (basic, lifestyles, spawnLocations, vipRoles, characterPositions, cameraViews, defaultItems, characterStates) has its own watcher. Edits in the configurator apply live, no resource restart required.
The only Lua-side holdout is characterMetadata β its entries carry get(charId) callback functions that query the database, which can't be JSON-serialised. That lives in extras/characterMetadata.lua and remains a regular Lua file.
External resources can still register lifestyles at runtime via:
luaexports.dirk_multichar:registerLifestyle('mylifestyle', { label = 'My Lifestyle', description = '...', items = { ... }, })
