Behaviour lives in shared/config.lua. The NPCs themselves are created in the /interactions panel and stored in the database: see the Features guide. Restart the resource after changing the config.
General
| Option | Type | Default | What it does |
|---|---|---|---|
debug | boolean | false | Prints traces to the console: NPCs and shops registered, trades. Also enabled by setting the convar cuxial_interactions_debug to 1. |
ui.accent | string (hex) | configurable | Accent colour of the dialogue, the shop and the panel. |
interaction | string | 'target' | How the player starts a conversation, for NPCs that do not set their own. 'target' = option of your target resource. 'sprite' = key prompt on the NPC; needs bl_sprites running, otherwise the target is used. 'none' = no option; the NPC only opens through the Interact export. |
Target · target
| Option | Type | Default | What it does |
|---|---|---|---|
icon | string | 'fas fa-comment-dots' | Font Awesome class of the target option, for NPCs without their own icon. |
distance | number | 2.5 | Metres from which the option can be used, for NPCs without their own distance. |
Key prompt · sprite
Only used with interaction = 'sprite'.
| Option | Type | Default | What it does |
|---|---|---|---|
key | string | 'E' | Letter drawn on the prompt. |
control | number | 38 | GTA control that opens the conversation. 38 is E. Change it together with key. |
shape | string | 'hex' | Shape of the prompt, passed to bl_sprites. |
distance | number | 2.5 | Metres from which the prompt reacts, for NPCs without their own distance. |
Points without a ped always use the target, even in sprite mode.
NPCs · npc
| Option | Type | Default | What it does |
|---|---|---|---|
spawnDistance | number | 60.0 | Metres at which the ped is created and removed, for NPCs without their own spawn distance. |
zOffset | number | -1.0 | Added to the Z of the coordinates when the ped is created. With -1.0 you can use the coordinates taken while standing on the spot, as "Here" does in the panel. |
modelTimeout | number | 5000 | Milliseconds to wait for a ped model to load. |
animTimeout | number | 2000 | Milliseconds to wait for an animation dictionary to load. |
fallbackModel | string | 'a_m_y_business_01' | Model used when an NPC has no model or its model does not exist. |
watchInterval | number | 1000 | Milliseconds between checks of the points attached to a ped created by another resource (entity / netId). |
Camera · camera
| Option | Type | Default | What it does |
|---|---|---|---|
enabled | boolean | true | true moves the camera in front of the NPC while talking. false keeps the player's camera. Each NPC can also turn it off for itself. |
forward | number | 1.2 | Metres in front of the NPC where the camera is placed. |
height | number | 0.52 | Metres above the NPC position. |
yawOffset | number | 181.0 | Degrees added to the NPC rotation so the camera faces it. |
transition | number | 2000 | Milliseconds of the camera blend, in and out. |
settle | number | 1500 | Milliseconds the window waits before it appears, so the camera gets there first. |
The camera only starts when the NPC has a ped. Points without a ped open the window at once.
Dialogue · dialog
| Option | Type | Default | What it does |
|---|---|---|---|
hidePlayer | boolean | true | true makes the player's ped invisible while the window is open, so it does not block the camera. false leaves it visible. |
hideDelay | number | 2000 | Milliseconds after opening until the player is hidden. |
textSpeed | number | 25 | Milliseconds per character of the typing effect, for pages without their own speed. |
conditionInterval | number | 500 | Milliseconds the result of the conditions of an NPC or a button is reused before checking again. |
Shop · shop
| Option | Type | Default | What it does |
|---|---|---|---|
account | string | 'cash' | Account used by shops without their own: where sales are paid and purchases are charged. 'cash', 'bank' or 'black_money'. |
currency | string | '$' | Symbol shown next to prices and in the trade notifications. |
maxDistance | number | 6.0 | Metres from the shop within which the server accepts a trade, for shops without their own distance. |
maxQuantity | number | 1000 | Maximum units in a single trade. |
cooldown | number | 300 | Milliseconds a player must wait between two trades. |
fetchCooldown | number | 250 | Milliseconds a player must wait between two openings of a shop catalogue. |
image | string | 'nui://ox_inventory/web/images/%s.webp' | Image of an item without its own image. %s is the item name. With another inventory, point it to its image folder, or change the hook itemImage. |
Shop limits · limits
| Option | Type | Default | What it does |
|---|---|---|---|
enabled | boolean | true | false ignores every limit set on shops and items: nothing is counted or blocked. |
maxWindow | number | 2592000 | Seconds of the longest window a limit can use (30 days). Records older than this are deleted. |
purgeCron | string | '0 * * * *' | Cron expression of the cleanup of expired records. The default runs every hour. |
maxRows | number | 100000 | Maximum records loaded in memory per shop. |
Player looks · skins
Used by the NPCs with a player skin.
| Option | Type | Default | What it does |
|---|---|---|---|
resource | string | 'cuxial_appearance' | Resource that applies the appearance to the ped. If it is not running, the ped keeps the base model. |
activeDays | number | 7 | Only characters played in the last days given here are used. |
pool | number | 8 | Appearances loaded the first time one is needed. If more NPCs use a player skin, more are loaded. They are kept until the resource restarts. |
defaultModel | string | 'mp_m_freemode_01' | Model used when a stored appearance has no model. |
retry | number | 60 | Seconds until the server looks again when it found no appearance. |
Paid revive · maria
Settings of the "Revive" button action. The player must be down; the price is charged before reviving, and returned if the revive fails.
| Option | Type | Default | What it does |
|---|---|---|---|
cost | number | 1200 | Price, for actions that leave the cost empty. |
account | string | 'bank' | Account the price is taken from, for actions without their own. |
job | string | 'ambulance' | Job whose on-duty members are counted. |
maxOnDuty | number | 2 | With this many on duty, or more, the NPC refuses and sends the player to a hospital. Actions with "Ignore on-duty EMS" skip this check. |
revive | table | { resource = 'cuxial_medical', export = 'RevivePlayer' } | Server export called to revive the player. If the resource is not running nothing is charged. |
maxDistance | number | 8.0 | Metres from the NPC within which the server accepts the request. |
cooldown | number | 3000 | Milliseconds a player must wait between two requests. |
Commands · commands
| Option | Type | Default | What it does |
|---|---|---|---|
admin.name | string | 'interactions' | Name of the command that opens the panel. |
admin.restricted | string | 'group.admin' | ACE group allowed to use the command. |
Panel · admin
| Option | Type | Default | What it does |
|---|---|---|---|
permission | string | 'admin' | Permission checked with Cuxial Bridge on every action of the panel. |
placeRange | number | 40.0 | Maximum metres between you and the NPC while placing it with the gizmo. |
previewDistance | number | 2.2 | Metres in front of you where the preview NPC appears. |
auditDays | number | 90 | Days the history is kept. Older entries are deleted every day at 04:00. |
accounts | table | { 'cash', 'bank', 'black_money' } | Accounts that can be chosen in shops and revive actions. Add the accounts your framework uses. |
limits | table | see below | Size limits of each NPC. |
admin.limits:
| Key | Default | Maximum of |
|---|---|---|
pages | 30 | Pages per dialogue |
buttons | 9 | Buttons per page |
actions | 8 | Actions per button |
items | 60 | Items per shop |
limits | 4 | Limits per shop and per item |
clothing | 24 | Clothing pieces per NPC |
text | 1500 | Characters of the text of a page |
args | 4096 | Bytes of the JSON arguments of an action |
def | 262144 | Bytes of a whole NPC in JSON |
Button actions · actions
| Option | Type | Default | What it does |
|---|---|---|---|
cooldown | number | 400 | Milliseconds a player must wait between two buttons that go through the server. |
distanceSlack | number | 3.0 | Metres added to the distance of the NPC when the server checks it. |
latentBytes | number | 32768 | NPC updates larger than this are sent to players as latent events, to avoid network spikes. |
inputLength | number | 64 | Maximum characters of each text value typed by the player. |
Example NPCs · seed
| Option | Type | Default | What it does |
|---|---|---|---|
enabled | boolean | true | Installs the seed file on every start. Each row goes in only once; what you delete in the panel does not come back. |
file | string | 'install/examples.sql' | SQL file inside the resource. Only INSERT IGNORE lines of the resource tables are run. Paste here the lines given by Export SQL to move NPCs between servers. |
Common changes
Talk with a key instead of the target
interaction = 'sprite',bl_sprites must be running. To change a single NPC, choose "Sprite" in its General tab instead.
Turn the camera off
camera = {
enabled = false,
},
dialog = {
hidePlayer = false,
},Keep the other keys of both blocks as they are.
Let other staff groups open the panel
commands = {
admin = { name = 'interactions', help = 'Interactions panel', restricted = 'group.mod' },
},
admin = {
permission = 'mod',
-- keep the rest
},Copy NPCs to another server
- In the panel of the first server, press Export SQL on each NPC and copy the lines.
- Paste them at the end of
install/examples.sql(or of the file set inseed.file) on the second server. - Restart the resource. The NPCs are installed once, with the status they had.
