DirkScripts
Backstories
Backstories are admin-built character archetypes that players pick on character creation. Each one comes with its own scripted intro scene, starter inventory, and (optionally) Discord-role-gated access. They're the same thing as the Lifestyles referenced in the Lua API β internally the schema field is lifestyles, but the player-facing label is "Backstory".
#What a Backstory Contains
Each entry has four tabs in the admin editor:
| Tab | Purpose |
|---|---|
| General | Name, label, description β what the player sees when choosing. |
| Access | Locked toggle. When on, you can gate the backstory behind Discord role IDs so only specific players can pick it. |
| Items | Starter inventory β compact SelectItem list with inline expand for picking item + quantity. |
| Scenes | One or more scripted intro scenes that play after the player confirms their choice. |
#Scenes Inside a Backstory
A scene is a small scripted moment β for example, the character waking up on a beach, or arriving on a bus. Each scene has:
- A walk-and-set position (E to confirm, β« to cancel β same picker as the main Scene tab).
- A scenario / dict / anim / flag row driving what the character is doing.
- Its own atmosphere (weather + time) so the scene can override the server's current conditions.
Multiple scenes per backstory chain into a sequence.
#Player Flow
- Player clicks Create New Character in the multichar selector.
- After clothing customisation, they see the backstory list (filtered by their Discord roles if any backstories are locked).
- They pick one β scripted scene plays β character spawns with the starter items granted.
#Discord Role Gating
Inside the Access tab, the Locked toggle reveals a Discord role-ID input. Add as many roles as you want β the player needs at least one of them to see the backstory. This is also how the dirk_multichar configurator gates admin access elsewhere, so the same role model applies.
#Registering a Backstory From Another Resource
External resources can register a backstory at runtime via the lifestyle export β useful when a separate script (e.g. a jobs system) wants to surface its own archetype without admins manually adding it.
luaexports.dirk_multichar:registerLifestyle('mylifestyle', { label = 'My Backstory', description = 'A short description for the player.', items = { { name = 'phone', amount = 1 }, { name = 'wallet', amount = 1 }, }, -- additional fields mirror what's in the configurator's Backstories tab })
Registered backstories appear in the player's selector alongside admin-configured ones.
#Live Editing
Every backstory edit applies live β players choosing a backstory immediately after a save will see the new state. The Lua side subscribes to lib.scriptConfig.on('lifestyles', ...) and rebuilds its runtime cache on every save.
