This is a complete rewrite of Backpack by Ryan with added features and bug fixes.
It adds portable inventory boxes to the game. They function just like normal inventory boxes except they also pick up items that are dropped on top of them. Punching one will place it on your back and allow you to carry it around the level.
Backpacks are able to store more ammo than a regular inventory box. By default backpacks store up to 4 boxes worth of ammo per slot. This means one slot holds 4 barricade boards or 40 rounds of 9mm or 80 rounds of .22.
Backpacks are randomly colored to help distinguish them.
nmrih-backpack-X.Y.Z.zip
into the server's nmrih/addons/sourcemod
directorynmrih-backpack-assets.zip
into your game server and your FastDL server (they're automatically added to the downloads table)Some old features are currently unavailable, though I plan on adding them
weight
, admin_can_use
, admin_can_wear
, zombie_can_wear
, colorize
You can configure backpack types, behavior and appareance in addons/sourcemod/configs/backpack2.cfg
.
itembox_model
- Model to use on dropped backpacks.ornament_model
- Model to render on the player's backsounds
- Sound effects used by this backpack, see config for examplesmax_left [0-8]
, max_middle [0-4]
, max_right [0-8]
- Size limit for each column of the backpack
Example:
"Giraffe Plushie"
{
"ornament_model" "models/survival/item_dufflebag_backpack.mdl"
// Custom physics model
"itembox_model" "models/anxiety/giraffe.mdl"
// Play Pugman's bleeding sounds
"sounds"
{
"backpack_open"
{
"player/bleed/pugman/bleeding02.wav" "1"
"player/bleed/pugman/bleeding03.wav" "1"
"player/bleed/pugman/bleeding04.wav" "1"
}
}
// Half the capacity of a normal backpack
"max_left" "4"
"max_middle" "2"
"max_right" "4"
}
Keys not mentioned here should be left as-is unless you know what you're doing, as they're required for the plugin to function properly.
loot
yes/no
- Whether this item can be spawned as random loot for backpacks dropped by zombies
capacity
- Allows you to override the maximum capacity for a given ammo box. This affects random loot and ammo stacking.
For example:
// Make backpacks able to hold (20 * sm_backpack_ammo_stack_limit) boards per slot
"ammobox_board"
{
"capacity" "20"
...
}
columns
- This allows you to override the placement for a given item. Valid values are left
, middle
and right
, and they can be combined to allow for multiple columns.
For example:
// Move pills to the ammo column
"item_pills"
{
"id" "44"
"columns" "right"
}
// Allow hammer to overflow into the "gear" column if the "weapon" column is full
"me_sledge"
{
"id" "40"
"columns" "left middle"
}
// Prevent maglite from being added to backpacks
"item_maglite"
{
"id" "42"
"columns" ""
}
Configuration variables are saved to cfg/sourcemod/plugin.backpack2.cfg
Command | Description | Default Value |
---|---|---|
sm_backpack_loot_ammo_min | Minimum ammo boxes to place in backpacks spawned as loot | 0 |
sm_backpack_loot_ammo_max | Maximum ammo boxes to place in backpacks spawned as loot | 4 |
sm_backpack_loot_ammo_min_pct | Minimum fill percentage for ammo boxes spawned as backpack loot | 40 |
sm_backpack_loot_ammo_max_pct | Maximum fill percentage for ammo boxes spawned as backpack loot | 100 |
sm_backpack_loot_gear_min | Minimum gear items to place in backpacks spawned as loot | 0 |
sm_backpack_loot_gear_max | Maximum gear items to place in backpacks spawned as loot | 1 |
sm_backpack_loot_weapon_min | Minimum weapons to place in backpacks spawned as loot | 0 |
sm_backpack_loot_weapon_max | Maximum weapons to place in backpacks spawned as loot | 2 |
sm_backpack_show_hints | Whether to show screen hints on how to use backpacks | 1 |
backpack2_version | Plugin version and description | |
sm_backpack_hints_interval | Rate in seconds at which hints are updated | 1.0 |
sm_backpack_ammo_stack_limit | Number of ammo pickups that can be stored per ammo slot | 4 |
sm_backpack_count | Number of backpacks to create at round start | 1 |
sm_backpack_colorize | Randomly colorize backpacks to help distinguish them | 1 |
sm_backpack_glow_distance | Glow backbacks in this range of the player | 90 |
sm_backpack_blink | Whether dropped backpacks pulse their brightness | 0 |
sm_backpack_zombie_spawn_chance | Chance for a zombie to spawn with a backpack | 0.005 |
sm_backpack <userid|#name>
- Gives target a backpack, requires ADMFLAG_CHEATS