Documentation › Hunting System › Features › Traps

Traps

Snare and cage traps that catch animals while you are away.

Players buy a trap from the hunter, place it inside a hunting zone and come back later. Every few minutes an armed trap may catch an animal from that zone. Bait raises the chance. The catch waits in the closed trap until the owner takes it out, then it is skinned, bled or carried like any other kill.

The trap models (s_h_trap_01 … 04) are streamed by the resource itself. If you also run a separate s_hunting_props resource, remove it to avoid duplicate models.

How players use them

Buy and place

Buy a Snare Trap (level 2) or Cage Trap (level 4) in the shop and use it from the inventory. A preview follows the camera: rotate with E / Q, place with Enter, cancel with Backspace (the item comes back).

Bait (optional)

Use Add bait at the trap. One hunting_bait adds baitBonus to the catch chance until the next catch.

Wait

After armMinutes the trap rolls a catch every checkInterval seconds. When something is caught the trap closes, the blip turns green and the owner gets a notification.

Take out the animal

At the trap choose Take out the animal. The dead animal lies next to the trap and goes through the normal skinning, blood and carcass flow. Uncollected catches escape after escapeMinutes.

Every catch costs one point of durability; at 0 the trap breaks. Pick up trap returns the item (and unused bait). Only the owner sees the trap options; other players just see the trap.

Traps are saved in the database and survive restarts. Own traps are shown as blips, as points on the tablet map, as squares on the mini radar and in the Traps tab of the tablet (status, durability, GPS).

Configuration

config/config_traps.lua (most values are also editable live in Admin → General → Traps):

lua
Config.Traps = {
    enable        = true,
    maxPerPlayer  = 4,     -- placed traps per player
    onlyInZones   = true,  -- only inside hunting zones
    minDistance   = 15.0,  -- metres between two traps
    checkInterval = 60,    -- seconds between catch rolls
    armMinutes    = 3,     -- settle time after placing / emptying
    escapeMinutes = 90,    -- catch escapes if not collected (0 = never)
    expireDays    = 7,     -- untouched traps are removed on restart (0 = never)
    clearOnRestart = true, -- remove every placed trap when the resource starts
    baitBonus     = 25,    -- + catch chance while baited
    types = {
        small = { item = 'hunting_trap_small', openModel = 's_h_trap_01', closedModel = 's_h_trap_02',
                  catchChance = 12, durability = 5, animals = { 'a_c_boar', 'a_c_coyote', 'a_c_deer', 'a_c_mtlion' } },
        cage  = { item = 'hunting_trap_cage',  openModel = 's_h_trap_03', closedModel = 's_h_trap_04',
                  catchChance = 7,  durability = 8, animals = { 'a_c_rabbit_01', 'a_c_coyote' } },
    },
}

A trap only catches species that live in its zone and are listed in animals.

While a trap holds bait, the bait lies visibly inside it (baitProp in each trap type: model, offset and rotation in trap space). Admins can position it in game with /trapbait next to a trap: arrows move, PgUp / PgDn change height, Q / E rotate (Ctrl / Alt tilt), R switches the bait model, and Enter copies the ready baitProp line for config_traps.lua. By default the snare catches boars, coyotes, deer and mountain lions, and the cage catches rabbits and coyotes.

With zone migration on, traps used where a zone used to be keep working with Config.ZoneDrift.outsideChance % of the normal chance.

If the open and closed models look reversed in game, swap openModel and closedModel.