Configuration

5 min readUpdated 2 weeks ago

Overview

  • shared/config.lua: settings, commands, editor, item definitions, bone list, theme colors
  • open/client.lua and open/server.lua: hooks you can edit to add your own rules

Default positions come from shared/config.lua and from the live catalog you build in game with /carryadmin. Each player's own adjustments are saved on top of those, per player.

General

shared/config.lua
1Config.Debug = false
2Config.Locale = 'en'
3Config.Theme = 'default'
4Config.WeaponComponents = true
5Config.FlashlightPersist = true
6Config.UpdateInterval = 1000
  • Debug: Console output for troubleshooting
  • Locale: Language file to load from the locales/ folder
  • Theme: theme of the editor, which also picks its accent color from Config.ThemeColors. Values: default, cyberpunk, wasteland, noir, fantasy, classic
  • WeaponComponents: Render weapon attachments (scopes, suppressors, grips) on holstered weapons
  • FlashlightPersist: Remember flashlight on/off state per weapon serial across holster and draw
  • UpdateInterval: Milliseconds between prop refresh checks. This loop is a safety net, a ped change is picked up the moment it happens

UI Theme

shared/config.lua
1Config.UITheme = {
2    preset = nil,
3    colors = {
4        primary = nil,
5        accent = nil,
6        background = nil,
7        surface = nil,
8        text = nil,
9    },
10}
  • preset: theme preset of the editor panels. nil follows the shared theme set in ml_bridge
  • colors: CSS hex values for single colors. Any nil value follows the shared theme

Theme Colors

shared/config.lua
1Config.ThemeColors = {
2    default   = { r = 229, g = 140, b = 59,  a = 200 },
3    cyberpunk = { r = 255, g = 0,   b = 136, a = 200 },
4    wasteland = { r = 180, g = 80,  b = 40,  a = 200 },
5    noir      = { r = 220, g = 40,  b = 40,  a = 200 },
6    fantasy   = { r = 218, g = 165, b = 32,  a = 200 },
7    classic   = { r = 160, g = 100, b = 60,  a = 200 },
8}

One accent color per theme, used for the silhouette outline and the bone markers in the editor. Change them to match your server's branding.

Commands

shared/config.lua
1Config.Commands = {
2    Edit = 'carryedit',
3    Reset = 'carryreset',
4    ConfigEditor = 'carryadmin',
5}
  • Edit: Open the position editor for an item (/carryedit [itemName]). With no item name it opens a picker with everything the player is carrying
  • Reset: Reset an item's position to default (/carryreset [itemName])
  • ConfigEditor: Open the admin catalog manager and editor (/carryadmin, requires admin permissions)

Position Limits

shared/config.lua
1Config.MaxPositionOffset = 0.30
2Config.MinPropDistance = 0.12
3Config.MinDistanceFactor = 0.75
  • MaxPositionOffset: largest offset from the attachment bone a player position may use, per axis, in meters
  • MinPropDistance: minimum distance from the bone center, in meters, checked on the server. An item whose default sits closer uses its default distance instead
  • MinDistanceFactor: How much of an item's default clearance from the body a player has to keep. 0.75 means the item may give up a quarter of that margin, no more. The position is judged on the worst moment of the idle animation, so an item that sinks into the body on part of the cycle still counts as buried. Raise it to be stricter, set it to 0 to turn the check off. The admin editor is never limited by it

Editor

shared/config.lua
1Config.Editor = {
2    Silhouette = {
3        Enabled = true,
4        ValidColor = { r = 80, g = 220, b = 120, a = 200 },
5        InvalidColor = { r = 255, g = 60, b = 60, a = 220 },
6    },
7
8}
  • Silhouette.Enabled: Glowing outline drawn around the item being edited
  • ValidColor: Outline color while the position can be saved. Set it to nil to follow Config.Theme instead
  • InvalidColor: Outline color while the item is buried inside the body. The save stays blocked until it is pulled back out

Players move and turn the item with the 3D gizmo and the mouse. Hold Shift for finer steps.

Bone List

shared/config.lua
1Config.BoneList = {
2    { id = 24818, label = 'Upper Back (Spine3)' },
3    { id = 57005, label = 'R. Hand' },
4}

The bones offered in the editor, drawn as clickable markers on the character and listed in the panel. Add any GTA bone hash with your own label. The picker also takes a bone id typed by hand.

Item Definitions

Each item maps an inventory item to a model, a bone, and per-gender offsets.

shared/config.lua
1Config.Items = {
2    {
3        name = 'WEAPON_CARBINERIFLE',
4        prop = 'w_ar_carbinerifle',
5        bone = 24818,
6        isWeapon = true,
7        defaultPosition = {
8            male = {
9                x = -0.02, y = -0.14, z = 0.13,
10                rx = 0.0, ry = 2.5, rz = 5.0,
11            },
12            female = {
13                x = 0.08, y = -0.14, z = 0.12,
14                rx = 0.0, ry = 0.0, rz = 0.0,
15            },
16        },
17    },
18}
  • name: inventory item name. Write it exactly as the inventory does
  • prop: Model to attach. With isWeapon = true the model is the weapon itself, taken from name, and this field is only a label
  • bone: Bone hash the item hangs on (see Config.BoneList)
  • isWeapon: true = weapon asset loader, with components and tint. false = plain prop
  • defaultPosition: Separate offsets for male and female peds. x/y/z = position, rx/ry/rz = rotation in degrees

Players adjust these positions with /carryedit, and their version is saved for them alone, server side.

Admin Config Editor

Use /carryadmin to add items, pick bones and set positions from inside the game. Saves go to the database and reach every connected player live, with no restart.