Skip to content

Configuration

Every option of Cuxial Interactions in shared/config.lua, block by block.

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 ​

OptionTypeDefaultWhat it does
debugbooleanfalsePrints traces to the console: NPCs and shops registered, trades. Also enabled by setting the convar cuxial_interactions_debug to 1.
ui.accentstring (hex)configurableAccent colour of the dialogue, the shop and the panel.
interactionstring'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 ​

OptionTypeDefaultWhat it does
iconstring'fas fa-comment-dots'Font Awesome class of the target option, for NPCs without their own icon.
distancenumber2.5Metres from which the option can be used, for NPCs without their own distance.

Key prompt · sprite ​

Only used with interaction = 'sprite'.

OptionTypeDefaultWhat it does
keystring'E'Letter drawn on the prompt.
controlnumber38GTA control that opens the conversation. 38 is E. Change it together with key.
shapestring'hex'Shape of the prompt, passed to bl_sprites.
distancenumber2.5Metres 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 ​

OptionTypeDefaultWhat it does
spawnDistancenumber60.0Metres at which the ped is created and removed, for NPCs without their own spawn distance.
zOffsetnumber-1.0Added 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.
modelTimeoutnumber5000Milliseconds to wait for a ped model to load.
animTimeoutnumber2000Milliseconds to wait for an animation dictionary to load.
fallbackModelstring'a_m_y_business_01'Model used when an NPC has no model or its model does not exist.
watchIntervalnumber1000Milliseconds between checks of the points attached to a ped created by another resource (entity / netId).

Camera · camera ​

OptionTypeDefaultWhat it does
enabledbooleantruetrue 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.
forwardnumber1.2Metres in front of the NPC where the camera is placed.
heightnumber0.52Metres above the NPC position.
yawOffsetnumber181.0Degrees added to the NPC rotation so the camera faces it.
transitionnumber2000Milliseconds of the camera blend, in and out.
settlenumber1500Milliseconds 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 ​

OptionTypeDefaultWhat it does
hidePlayerbooleantruetrue makes the player's ped invisible while the window is open, so it does not block the camera. false leaves it visible.
hideDelaynumber2000Milliseconds after opening until the player is hidden.
textSpeednumber25Milliseconds per character of the typing effect, for pages without their own speed.
conditionIntervalnumber500Milliseconds the result of the conditions of an NPC or a button is reused before checking again.

Shop · shop ​

OptionTypeDefaultWhat it does
accountstring'cash'Account used by shops without their own: where sales are paid and purchases are charged. 'cash', 'bank' or 'black_money'.
currencystring'$'Symbol shown next to prices and in the trade notifications.
maxDistancenumber6.0Metres from the shop within which the server accepts a trade, for shops without their own distance.
maxQuantitynumber1000Maximum units in a single trade.
cooldownnumber300Milliseconds a player must wait between two trades.
fetchCooldownnumber250Milliseconds a player must wait between two openings of a shop catalogue.
imagestring'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 ​

OptionTypeDefaultWhat it does
enabledbooleantruefalse ignores every limit set on shops and items: nothing is counted or blocked.
maxWindownumber2592000Seconds of the longest window a limit can use (30 days). Records older than this are deleted.
purgeCronstring'0 * * * *'Cron expression of the cleanup of expired records. The default runs every hour.
maxRowsnumber100000Maximum records loaded in memory per shop.

Player looks · skins ​

Used by the NPCs with a player skin.

OptionTypeDefaultWhat it does
resourcestring'cuxial_appearance'Resource that applies the appearance to the ped. If it is not running, the ped keeps the base model.
activeDaysnumber7Only characters played in the last days given here are used.
poolnumber8Appearances loaded the first time one is needed. If more NPCs use a player skin, more are loaded. They are kept until the resource restarts.
defaultModelstring'mp_m_freemode_01'Model used when a stored appearance has no model.
retrynumber60Seconds until the server looks again when it found no appearance.

Settings of the "Revive" button action. The player must be down; the price is charged before reviving, and returned if the revive fails.

OptionTypeDefaultWhat it does
costnumber1200Price, for actions that leave the cost empty.
accountstring'bank'Account the price is taken from, for actions without their own.
jobstring'ambulance'Job whose on-duty members are counted.
maxOnDutynumber2With 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.
revivetable{ resource = 'cuxial_medical', export = 'RevivePlayer' }Server export called to revive the player. If the resource is not running nothing is charged.
maxDistancenumber8.0Metres from the NPC within which the server accepts the request.
cooldownnumber3000Milliseconds a player must wait between two requests.

Commands · commands ​

OptionTypeDefaultWhat it does
admin.namestring'interactions'Name of the command that opens the panel.
admin.restrictedstring'group.admin'ACE group allowed to use the command.

Panel · admin ​

OptionTypeDefaultWhat it does
permissionstring'admin'Permission checked with Cuxial Bridge on every action of the panel.
placeRangenumber40.0Maximum metres between you and the NPC while placing it with the gizmo.
previewDistancenumber2.2Metres in front of you where the preview NPC appears.
auditDaysnumber90Days the history is kept. Older entries are deleted every day at 04:00.
accountstable{ 'cash', 'bank', 'black_money' }Accounts that can be chosen in shops and revive actions. Add the accounts your framework uses.
limitstablesee belowSize limits of each NPC.

admin.limits:

KeyDefaultMaximum of
pages30Pages per dialogue
buttons9Buttons per page
actions8Actions per button
items60Items per shop
limits4Limits per shop and per item
clothing24Clothing pieces per NPC
text1500Characters of the text of a page
args4096Bytes of the JSON arguments of an action
def262144Bytes of a whole NPC in JSON

Button actions · actions ​

OptionTypeDefaultWhat it does
cooldownnumber400Milliseconds a player must wait between two buttons that go through the server.
distanceSlacknumber3.0Metres added to the distance of the NPC when the server checks it.
latentBytesnumber32768NPC updates larger than this are sent to players as latent events, to avoid network spikes.
inputLengthnumber64Maximum characters of each text value typed by the player.

Example NPCs · seed ​

OptionTypeDefaultWhat it does
enabledbooleantrueInstalls the seed file on every start. Each row goes in only once; what you delete in the panel does not come back.
filestring'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 ​

shared/config.lua
lua
interaction = 'sprite',

bl_sprites must be running. To change a single NPC, choose "Sprite" in its General tab instead.

Turn the camera off ​

shared/config.lua
lua
camera = {
    enabled = false,
},
dialog = {
    hidePlayer = false,
},

Keep the other keys of both blocks as they are.

Let other staff groups open the panel ​

shared/config.lua
lua
commands = {
    admin = { name = 'interactions', help = 'Interactions panel', restricted = 'group.mod' },
},
admin = {
    permission = 'mod',
    -- keep the rest
},

Copy NPCs to another server ​

  1. In the panel of the first server, press Export SQL on each NPC and copy the lines.
  2. Paste them at the end of install/examples.sql (or of the file set in seed.file) on the second server.
  3. Restart the resource. The NPCs are installed once, with the status they had.

© Cuxial