pebble_airdrops · v1.0.0

Configuration

pebble_airdrops has two config files, both open to edit:

  • config/shared.lua: the plane, the crate, sounds, animations, the map circle and the drop zones seeded on first start.
  • config/server.lua: the admin command, access, webhooks, and the defaults for the schedule, hacking, announcements, police alert and loot.

Config or admin panel?

Most gameplay values also live in the database and are edited in /airdropadmin. Which one wins depends on the value:

Values Where they live
Drop zones (Config.Locations) Seeded into the database on the first start. After that, edit them in the panel; config changes no longer apply.
The first drop type (ServerConfig.Loot, ServerConfig.Hack, ServerConfig.CrateLifetimeMinutes) Seeded once, like the zones. Add and edit drop types in the panel.
Settings: schedule, plane (height, speed, spawn distance, fall speed), announcements, police alert, Discord embeds The config values apply until staff save that group in the panel. Reset in the panel forgets the saved values, so the group follows the config again.
Everything else (models, blips, lights, sounds, animations, admin access, webhooks) Config only. Restart the resource after a change.

config/shared.lua

Plane

Config.Plane = {
    model = `titan`,
    pilot = `s_m_m_pilot_02`,
    height = 450.0,        -- metres above the sea; the crate drops from here
    speed = 40.0,          -- metres per second
    spawnDistance = 2500.0, -- the plane starts this far from the drop zone, in a random direction
    blip = { sprite = 307, colour = 6, scale = 0.9 },
}

Crate

Option Default
prop `pebble_airdrop_crate` The default crate model. Its screen and light strips only work on this model; other models get the fill light. Drop types can override it.
parachute `prop_v_parachute` Parachute model.
parachuteOffset 5.8 Height of the parachute above the crate's origin.
fallSpeed 8.0 Metres per second under the parachute.
blip sprite 306, colour 1 Blip on the landed crate, with its label.
lights red / orange / green RGB colours while locked, unlocking and open: the strips, the screen accents and the fill light.
fillLight range = 3.5, intensity = 4.0, height = 0.77, angle = 55.0 Spot lights just outside each side, aimed down so the strips also light the ground.
screen distance = 60.0 The screen and strips only render for players within this distance.
beep Beep_Red, every 1500 ms Beacon beep while locked or unlocking. During the last fastSeconds of the unlock it beeps every fastInterval ms. range is how far it's heard.

Sounds, flare and map circle

-- Landing thud, hack success and fail, and the lid creak. volume is 0 to 1.
Config.Sounds = {
    enabled = true,
    volume = 0.6,
    range = 60.0,
    cues = { landed = true, hackSuccess = true, hackFail = true, lid = true },
}

-- Road flare on the landing spot shortly before the drop; it goes out when the crate lands.
Config.Beacon = { flare = { enabled = true } }

-- Area shown on the map while the plane is inbound, offset from the real spot.
Config.ZoneBlip = { radius = 250.0, colour = 1, alpha = 90, sprite = 550, label = "Airdrop" }

Animations

Config.Animations holds the hack and open animations for pebble_airdrop_crate. hackOffset and openOffset are where the player stands, relative to the crate. The clips are made for these exact spots, so leave them as they are unless you swap the animations. walkTimeout is how long (ms) the player walks to the spot before snapping into place, and fallbackHack is the animation used on other crate models.

Drop zones

Config.Locations = {
    { label = "Drop Zone 1", coords = vec3(1043.14, 2411.59, 53.37), weight = 10 },
    -- ...
}

Put each zone's coords on the ground; the crate lands there. A higher weight makes the zone come up more often. These are only seeded on the first start. Placing zones in the admin panel is easier: you get a ghost crate on your crosshair.

config/server.lua

Admin and webhooks

Option Default
ServerConfig.AdminCommand "airdropadmin" Command that opens the panel.
ServerConfig.AdminAce "pebble_airdrops.admin" Ace that grants access.
ServerConfig.AdminGroups { "admin", "god", "superadmin" } Framework groups that also grant access.
ServerConfig.Webhook "" Discord webhook for the admin audit log. Empty only logs to the database.
ServerConfig.DiscordWebhook "" Discord webhook for public drop embeds. The convar pebble_airdrops:discordWebhook wins over it.
ServerConfig.Discord Which drop events post an embed (started, landed, hacked, opened, ended) and who gets pinged: "", "@here", "@everyone" or a role like "<@&123>".

Schedule

ServerConfig.AutoDrop = {
    enabled = true,
    mode = "interval",        -- "interval" or "windows"
    intervalMinutes = 180,
    initialDelayMinutes = 30, -- 0 waits a full interval
    randomOffsetMinutes = 15, -- each interval moves by up to this much either way
    minPlayers = 1,
    minPolice = 0,            -- on-duty players with a police alert job
    zoneCooldown = 1,         -- skip the last N zones when picking a random one; 0 allows repeats
    windows = {
        { days = {}, start = "20:00", ["end"] = "23:00", minDrops = 2, maxDrops = 3 },
    },
    announceMinutes = 5,      -- take-off warning; 0 disables it
}
  • Interval mode drops initialDelayMinutes after the resource starts, then every intervalMinutes, give or take randomOffsetMinutes.
  • Windows mode drops a random number of times (minDrops to maxDrops) inside each time window. days are 1 (Monday) to 7 (Sunday); leave it empty for every day. end may pass midnight. Times follow the server's time zone.

A scheduled drop that is due while fewer than minPlayers players or minPolice police are online is postponed and retried. In windows mode it's skipped once it would fall outside its window. The take-off warning only goes out when the drop can actually start.

Hacking

These seed the first drop type. Every drop type has its own copy in the panel.

Option Default
difficulty { "easy", "medium", "medium", "hard" } One minigame layer per entry: easy, medium or hard.
keys { "w", "a", "s", "d" } The packet keys players type.
delayMinutes 0 Minutes after landing before anyone can hack. 0 makes it hackable right away.
unlockMinutes 5 Minutes from a successful hack until the crate opens.
minigame / duration true / 10 minigame = false replaces the minigame with a progress bar of duration seconds.
item / itemCount nil / 1 Item needed to start a hack; nil needs none.
consume "always" When the item is used up: keep, always, success or failure.
lockoutAttempts / lockoutMinutes 3 / 1 Players who fail this many hacks in a row wait this long. 0 attempts turns it off.
policeAlert true false never alerts police for this drop type, even when the alert is on.
minPolice 0 On-duty police needed before anyone can hack.

ServerConfig.CrateLifetimeMinutes (default 20) is how long the crate stays after landing.

Announcements

ServerConfig.Announcements = {
    warning  = { enabled = true,  type = "inform",  message = "An airdrop takes off in {minutes} minutes" },
    inbound  = { enabled = true,  type = "inform",  message = "A supply plane is inbound. Check your map." },
    landed   = { enabled = false, type = "inform",  message = "The supply crate has landed" },
    hackable = { enabled = false, type = "warning", message = "The supply crate can be hacked now" },
    hacked   = { enabled = false, type = "warning", message = "Someone hacked the supply crate. It opens in {minutes} minutes" },
    unlocked = { enabled = false, type = "success", message = "The supply crate is open" },
    ended    = { enabled = false, type = "inform",  message = "The airdrop is over" },
}

type is inform, success, warning or error. See Announcements for when each one fires and what the placeholders mean.

Police alert

ServerConfig.PoliceAlert = {
    enabled = false,
    jobs = { "police", "sheriff" },
    code = "10-90",
    title = "Airdrop tampering",
    message = "Someone is breaking into a supply crate",
    blip = { sprite = 306, colour = 1, scale = 1.0 },
}

Sent through your dispatch resource (via pebble_bridge) when someone starts a hack. jobs also decides who counts as police for minPolice.

Loot

ServerConfig.Loot = {
    template = "airdrop_crate",
    label = "Supply Crate",
    rolls = { min = 8, max = 10 },
    guaranteed = { RARE = 2 },
    pools = {
        COMMON = { { item = "water", min = 2, max = 4 }, { item = "bandage", min = 2, max = 5 } },
        UNCOMMON = { { item = "ammo-9", min = 24, max = 48 }, { item = "armour", min = 1, max = 1 } },
        RARE = { { item = "ammo-rifle", min = 30, max = 60 }, { item = "WEAPON_PISTOL", min = 1, max = 1 } },
        EPIC = { { item = "WEAPON_SMG", min = 1, max = 1 } },
        LEGENDARY = { { item = "WEAPON_CARBINERIFLE", min = 1, max = 1 } },
    },
}

Each crate rolls between rolls.min and rolls.max items. guaranteed adds that many items of a rarity on every crate. Use item names from your own inventory: the defaults are ox_inventory names.

With pebble_looting running, template is created from this table the first time and staff edit it in /lootadmin from then on. Without it, the table is rolled as written.

Translations

Every player-facing message is in locales/en.json. To translate, copy it to a new file (for example locales/de.json), translate the values and set ox_lib's locale in server.cfg:

setr ox:locale "de"