Configuration

14 min readUpdated 2 weeks ago

Overview

  • shared/config/config.lua: general settings, raid HUD, admin alerts, loot key, presets, stealth, NPC defaults, limits, permissions and battlepass
  • shared/config/camps.lua: camps seeded into the database on first boot. Ships empty
  • shared/config/peds.lua: ped models offered in the editor (pedModelList)
  • shared/config/weaponlist.lua: weapons offered in the editor (WeaponsList)
  • shared/config/zombies.lua: walk styles and attack animations for zombie NPC groups
  • server/config_server.lua: log channels

Camps are built and edited in the admin panel and saved in the database. The HUD and loot key values below are first boot defaults: once you save the settings window in the panel, the saved values are used.

General

shared/config/config.lua
1Config.Settings = {
2    Locale = 'en',
3    Debug = false,
4    CreatorCommand = 'campsadmin',
5    MoveHudCommand = 'raidhud',
6    SyncRadius = 250.0,
7    UnloadDelay = 120,
8    CombatGrace = 60,
9    CorpseCleanupDelay = 60,
10    SeedExampleCamps = true,
11    BlipsEnabled = true,
12    NotifyOnEnter = true,
13}
14
15Config.Theme = 'default'
16Config.Admin.MinimizeKey = 'F9'
  • Locale: language file loaded from the locales/ folder
  • Debug: prints extra console output
  • CreatorCommand: opens the admin panel. Needs the Creator permission
  • MoveHudCommand: lets any player drag and resize their own raid HUD. '' turns it off
  • SyncRadius: players within this range of a camp see its NPCs and live blips
  • UnloadDelay: seconds with no player inside SyncRadius before an active camp despawns and goes back to idle
  • CombatGrace: seconds after the last contact before an engaged camp can reset to full strength
  • CorpseCleanupDelay: seconds a dead camp NPC stays on the ground
  • SeedExampleCamps: on first boot, with an empty ml_camps table, copies the camps of shared/config/camps.lua into the database
  • BlipsEnabled: false hides every camp blip
  • NotifyOnEnter: notifies a player who walks into an active camp
  • Theme: theme of the raid HUD and the admin panel. 'default', 'wasteland', 'cyberpunk', 'noir' or 'fantasy'
  • MinimizeKey: hides and restores the admin panel. F1 to F12, or a single letter or digit

UI Theme

shared/config/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 for this resource. nil follows the shared theme set in ml_bridge
  • colors: CSS hex values for single colors. Any nil value follows the shared theme

Raid HUD

shared/config/config.lua
1Config.HUD = {
2    Enabled = true,
3    Position = 'top-right',
4    ResetVisibilityDefault = 'timer',
5}
  • Enabled: shows the raid HUD while the player is inside a camp
  • Position: 'top-right', 'top-center', 'left-center' or 'bottom-right'. Players can move their own copy with /raidhud
  • ResetVisibilityDefault: what the HUD shows after a clear. 'timer' shows the respawn countdown, 'status' a cleared badge with no countdown, 'hidden' hides the HUD. With 'status' or 'hidden' players cannot wait out the timer at the camp. Each camp can override it in the editor

Admin Alerts

shared/config/config.lua
1Config.Alerts = {
2    Enabled = true,
3    AbandonedSeconds = 480,
4    StaleCooldownSeconds = 120,
5}

Alerts show on the Home and Live tabs of the panel. They only flag a camp and never act on it.

  • Enabled: turns the alerts on or off
  • AbandonedSeconds: an active camp with no players for this long is flagged as abandoned
  • StaleCooldownSeconds: a camp still on cooldown this long after its timer ended is flagged as stuck

Loot Key

shared/config/config.lua
1Config.LootKey = {
2    Mode = 'virtual',
3    Item = 'camp_key',
4    ConsumeOnOpen = true,
5}
  • Mode: 'virtual' tracks the key on the server with no item. 'item' hands out an inventory item, which you must register (see Installation)
  • Item: item name of the key in item mode
  • ConsumeOnOpen: removes the key when its holder opens the first crate

Turn the key on per camp with Require key in the editor. One random camp NPC carries it. When that NPC dies, the nearest raider gets the key. If the camp is cleared before the carrier dies, the first credited raider gets it. One key opens every crate of that camp for its holder. In item mode the key carries metadata.camp, so it only opens the camp it came from.

Camp Types and Crates

shared/config/config.lua
1Config.CampTypes = {
2    bandit    = { label = 'Bandit Camp',       blip = { sprite = 84,  color = 1,  scale = 0.9 } },
3    military  = { label = 'Military Outpost',   blip = { sprite = 489, color = 5,  scale = 0.9 } },
4    scavenger = { label = 'Scavenger Den',      blip = { sprite = 364, color = 47, scale = 0.9 } },
5    cartel    = { label = 'Cartel Stronghold',  blip = { sprite = 51,  color = 1,  scale = 0.9 } },
6}
7
8Config.CrateProps = {
9    { model = 'prop_box_ammo04a',      label = 'Ammo Crate' },
10    { model = 'prop_box_ammo01a',      label = 'Ammo Box' },
11    { model = 'prop_box_wood04a',      label = 'Wooden Crate' },
12    { model = 'prop_box_wood02a_pile', label = 'Wooden Crate (pile)' },
13    { model = 'prop_mil_crate_01',     label = 'Military Crate' },
14    { model = 'prop_barrel_02a',       label = 'Barrel' },
15    { model = 'prop_cs_cardbox_01',    label = 'Cardboard Box' },
16    { model = 'prop_ld_case_01',       label = 'Briefcase' },
17    { model = 'prop_money_bag_01',     label = 'Money Bag' },
18    { model = 'prop_drug_package',     label = 'Package' },
19}
  • CampTypes: types offered in the editor, with their default blip. A camp can use any other type name and override its own blip
  • CrateProps: crate models offered in the editor. Admins can also type any prop model

Aggression

shared/config/config.lua
1Config.Aggression = {
2    defensive  = { combatMovement = 1, combatAbility = 1, useCover = true,  canCharge = false },
3    balanced   = { combatMovement = 2, combatAbility = 1, useCover = true,  canCharge = false },
4    aggressive = { combatMovement = 2, combatAbility = 2, useCover = true,  canCharge = true  },
5    berserk    = { combatMovement = 2, combatAbility = 2, useCover = false, canCharge = true  },
6}
  • combatMovement: 1 holds ground, 2 advances on the player
  • combatAbility: 1 average, 2 professional
  • useCover: the NPC takes cover in firefights
  • canCharge: the NPC can rush the player at close range

Each NPC group picks one preset by name. A new key here shows up in the editor.

Stealth

shared/config/config.lua
1Config.Stealth = {
2    crouchRangeMult = 0.55,
3    sprintHearMult = 0.8,
4    detectTicks = 2,
5    alertRadius = 35.0,
6}
  • crouchRangeMult: a crouched player is seen at this fraction of the NPC seeing range
  • sprintHearMult: a sprinting player is heard within the hearing range multiplied by this value
  • detectTicks: detection cycles a player must stay in view before an NPC engages. Hearing alone needs one more
  • alertRadius: when one NPC engages, the camp NPCs within this range join in

Shooting within hearing range, hurting an NPC or aiming at one starts combat at once. The NPC blip goes from neutral to suspicious to alerted as detection builds.

NPC Defaults

shared/config/config.lua
1Config.NpcDefaults = {
2    health = 200,
3    armor = 0,
4    accuracy = 35,
5    aggression = 'balanced',
6    detectionRange = 40.0,
7    fovAngle = 110.0,
8    behavior = 'static',
9    headshotKills = true,
10    canRagdoll = true,
11    weaponMode = 'fixed',
12    weapon = 'WEAPON_PISTOL',
13    patrolStopChance = 0.5,
14    patrolWaitDefault = 5,
15}

Values used when an NPC group leaves a field empty. The fields are explained under Camp Definition.

  • headshotKills: true kills an NPC with one headshot whatever its health. false makes a headshot count as a body shot
  • canRagdoll: false keeps the NPC on its feet when shot, hit by a car or caught in a blast
  • patrolStopChance: chance from 0 to 1 that a random stop waypoint pauses the NPC on a lap
  • patrolWaitDefault: seconds a stop waypoint pauses the NPC when the point has no duration of its own

Limits

shared/config/config.lua
1Config.Limits = {
2    maxNpcsPerCamp = 40,
3    maxHealth = 5000,
4    maxArmor = 500,
5    maxRadius = 300.0,
6    maxRaiders = 64,
7    minRespawnDelay = 30,
8    minResetDelay = 30,
9}

The server clamps every camp to these values, camps saved from the panel included.

Permissions

shared/config/config.lua
1Config.Permissions = {
2    Creator = {
3        useDefaultAdmins = true,
4        ace = { 'ml_camps.creator', 'admin', 'god', 'superadmin', 'command', 'group.admin', 'group.superadmin' },
5    },
6    LiveActions = {
7        useDefaultAdmins = true,
8        ace = { 'ml_camps.admin', 'admin', 'god', 'superadmin', 'group.admin', 'group.superadmin' },
9    },
10}
  • Creator: opens the panel, creates, edits and deletes camps, changes the global settings
  • LiveActions: force clear, force reset and teleport from the Live tab. Without this block it uses Creator
  • useDefaultAdmins: also accepts every player ml_bridge treats as admin
  • ace: ACE permissions accepted for that tier, for example add_ace group.mod ml_camps.creator allow

The checks live in open/handlers_server.lua, where you can replace them.

Battlepass

shared/config/config.lua
1Config.Battlepass = { Enabled = true }
  • Enabled: with ml_battlepass running, clearing a camp advances battlepass objectives for every player who took part. false turns it off. Without ml_battlepass this setting does nothing

Camp Definition

Camps are normally built in the editor. The fields below are what the editor saves and what shared/config/camps.lua accepts for the first boot seed. After the first boot the database is used and the file is not read again.

shared/config/camps.lua
1Config.Camps['bandit_grapeseed'] = {
2    id = 'bandit_grapeseed',
3    label = 'Grapeseed Bandit Camp',
4    type = 'bandit',
5    enabled = true,
6    center = { x = 2447.0, y = 4968.0, z = 45.5 },
7    radius = 60.0,
8    respawnEnabled = true,
9    respawnDelay = 1800,
10    resetDelay = 600,
11    maxRaiders = 6,
12    hud = { resetVisibility = 'inherit' },
13    blip = { enabled = true, sprite = 84, color = 1, scale = 0.9, showRadius = true },
14    npcs = { },
15    loot = { },
16}
  • id: unique key, letters, numbers and underscore only
  • type: a Config.CampTypes key or any other name
  • enabled: a disabled camp keeps its data and never spawns
  • center, radius: the camp zone. A player who walks in activates the camp and counts as a raider
  • respawnEnabled: false makes a spawn-once camp. After a clear it stays depleted until staff press Force Reset
  • respawnDelay: seconds a cleared camp stays on cooldown
  • resetDelay: seconds an engaged camp must be up before it can go back to full strength. It also needs CombatGrace seconds with no contact
  • maxRaiders: players who get loot credit on a clear, in the order they entered
  • resetOnRestart: true makes the camp ignore its saved cooldown or cleared state when the script restarts
  • hud.resetVisibility: 'inherit', 'timer', 'status' or 'hidden'
  • blip: map blip. showRadius draws the zone circle. The color follows the live camp status

NPC Groups

shared/config/camps.lua
1npcs = {
2    {
3        modelPool = { 'g_m_y_lost_01', 'g_m_y_lost_02', 'g_m_y_lost_03' },
4        count = 4,
5        weaponMode = 'fixed', weapon = 'WEAPON_PISTOL',
6        health = 200, armor = 0, accuracy = 30,
7        aggression = 'balanced', detectionRange = 40.0,
8        behavior = 'patrol', spawnMode = 'auto',
9    },
10}
  • model, modelPool: one ped model, or a list to pick from on each spawn. Addon peds work
  • count: NPCs spawned from this group
  • weaponMode: 'fixed' uses weapon, 'random' picks from weaponPool on each spawn
  • health, armor, accuracy: combat stats, clamped by Config.Limits
  • aggression: a Config.Aggression preset
  • detectionRange, fovAngle: seeing and hearing range in meters, and field of view in degrees
  • behavior: 'static' holds position, 'patrol' walks patrolPoints in a loop or wanders when there are none, 'guard' defends a guardRadius around its spawn
  • spawnMode: 'auto' scatters the NPCs around the center, 'fixed' cycles through spawnPoints
  • patrolPoints: route placed in game from the editor. A pass-through point only shapes the walk. A stop pauses the NPC for a set number of seconds. A random stop pauses it on some laps only. Press R while placing to change the type, and use the mouse wheel to set the direction a paused NPC faces

A group can also use Zombie Mode: no guns, a shambling walk, melee lunges and damage per hit. Walk styles and attack animations come from shared/config/zombies.lua.

Horde Mode

Turn on Horde Mode in the editor and the camp fights in waves. Crates unlock after the last wave.

shared/config/camps.lua
1horde = { enabled = true, waves = 3, delay = 15, scaling = 100, spawnMode = 'perimeter' },
  • waves: number of waves, up to 10
  • delay: seconds between two waves, up to 300
  • scaling: size of each wave compared with the one before, from 50 to 300 percent. 100 keeps the same size
  • spawnMode: 'perimeter' sends later waves in from the camp edge, already hostile. 'layout' uses the spawn points of the first wave

Loot

shared/config/camps.lua
1loot = {
2    rewardType = 'both',
3    delivery = 'prop',
4    requireKey = false,
5    props = {
6        { model = 'prop_box_ammo04a' },
7    },
8    fixedLoots = {
9        { items = { 'bandage' }, min = 1, max = 2 },
10    },
11    probabilityLoots = {
12        loop = 3,
13        items = {
14            { items = { 'lockpick' },      min = 1, max = 1, probability = 40.0 },
15            { items = { 'weapon_pistol' }, min = 1, max = 1, probability = 8.0 },
16        },
17    },
18    moneyConfig = { account = 'cash', min = 200, max = 600 },
19}
  • rewardType: 'money', 'items' or 'both'
  • delivery: 'direct', the default, gives each credited raider a loot roll of their own on the clear. 'prop' rolls the loot once and spreads the items and the money across the crates. A camp with no crates pays directly
  • requireKey: turns on the loot key for this camp
  • props: one crate per entry. Place them in game from the editor, or leave coords out to spawn them near the center. The first credited raider who searches a crate takes its share
  • fixedLoots: guaranteed drops. Each entry picks one item from items and gives between min and max. Items can carry itemMetadata
  • probabilityLoots: chance tables. The whole set rolls loop times, up to 10, and each entry drops with its probability percent
  • moneyConfig: 'cash' or 'bank', a random amount between min and max, up to 100000

With ML Inventory running, the loot editor also offers a Clothing reward: a fixed piece, or a random piece from a series of drawables, with a photo of each model.

Item Names

Every item in a loot table must exist in your inventory, or that drop is skipped. The item picker in the editor only lists registered items.

Log Channels

server/config_server.lua
1Config.Logs = {
2    Enabled = true,
3    Provider = 'discord',
4    Channels = {
5        Activated   = { webhook = '', dataset = 'ml_camps_activated' },
6        Cleared     = { webhook = '', dataset = 'ml_camps_cleared' },
7        Loot        = { webhook = '', dataset = 'ml_camps_loot' },
8        Key         = { webhook = '', dataset = 'ml_camps_key' },
9        Reset       = { webhook = '', dataset = 'ml_camps_reset' },
10        Despawn     = { webhook = '', dataset = 'ml_camps_despawn' },
11        CampEdit    = { webhook = '', dataset = 'ml_camps_campedit' },
12        LiveActions = { webhook = '', dataset = 'ml_camps_live' },
13        Settings    = { webhook = '', dataset = 'ml_camps_settings' },
14        Exploit     = { webhook = '', dataset = 'ml_camps_exploit' },
15    },
16}
  • Enabled: turns every log on or off
  • Provider: 'discord', 'fivemanage', 'ox_lib', 'both' (Discord and FiveManage) or 'all'
  • Activated: a raid starts
  • Cleared: a camp is cleared, with the credited raiders
  • Loot: a player loots a crate, with the items and money
  • Key: a player gets a camp key
  • Reset: a camp goes back to full strength
  • Despawn: a camp despawns with no players nearby
  • CampEdit: staff create, edit or delete a camp
  • LiveActions: staff force clear, force reset or teleport
  • Settings: staff change the HUD or key settings
  • Exploit: a player fails a server check, such as looting from out of range or calling an admin action without permission

Each channel has its own webhook and FiveManage dataset. Leave a webhook empty to skip that channel on Discord.

Camps Configuration, FiveM Docs | Micio Mods