item_pickup

An item_pickup is an inventory item in the world, such as a keycard, which a player picks up and carries. The map
checks for it with a player_hasinventory and can take it away again with a
player_inventory.
Each player sees their items in a row of icons on the left of the HUD, and the items the whole team shares follow after "TEAM".
The inventory row with keycards and fuses
The item_pickup you place is the item itself. While a player carries it, it is hidden and remembers who holds it,
so it can always go back to where you placed it, which means it is never lost and never exists twice.
Attributes
The entity also has these common keys:
- Naming and triggering: Name and Target
- Position: Pitch Yaw Roll
- Appearance: all except Effects
Shows brackets around the object for players near it. Within Hint Distance, the brackets are faint and in the HUD color. When the player is close enough to use the object and looks at it, the brackets take the color of the choice.
- None (empty) - No brackets
- button - Yellow, and orange while a master locks the object
- charger - Green, and red while the charger is empty
- eyescanner - Yellow
- pickup - Yellow
None (empty)objecthint_distanceSets how far from the player's eyes the faint brackets show, in units, up to 4096. The object must be in front of the player and in sight.
If you leave this key empty or set 0, the distance is 512 units.
colormapColors the parts of the model that a player model colors with the player's chosen top and bottom colors. A model without such parts doesn't change.The 81 choices
modelSets the model of the item. The model and the Pickup sound are loaded with the map, so a trigger_changevalue that changes them later does nothing.
If you leave this key empty, it is the security card of Half-Life.
models/w_security.mdlitem_nameSets the name of the item, up to 31 characters, such as keycard_red, and every check and every player_inventory names the item by it.
If you leave this key empty, nobody can take the item.
item_iconPicks the icon of the item in the inventory row, as a name from sprites/hud.txt. You can also type any other name in hud.txt, and a name it doesn't have shows the key.
- Key (inv_key)
- Red keycard (inv_card_red)
- Blue keycard (inv_card_blue)
- Yellow keycard (inv_card_yellow)
Key (inv_key)countSets how many the item counts for, from 1 up to 32767.
1collect_limitSets how many of the item a player, or the team with Shared, can hold. A player can't take the item if that would make them hold more than this many, and 0 means no limit.
0return_timelimitSets how many seconds a dropped item lies untouched before it goes back to where you placed it, and with 0, it goes straight back when its holder dies.
45holder_keep_on_deathSets whether the holder keeps the item when they die.
- No (0) - The item drops where the holder died
- Yes (1) - The holder keeps the item when they die or are stripped, so in Bounty Killer and Battle Royale they respawn with it. It still goes back at a round restart or when they leave
No (0)round_resetFor a shared item only, sets whether the team loses it at each round start. Personal items always go back.
- No (0) - The team keeps the item
- Yes (1) - The item is taken back from the team and put on its spot at each round start
No (0)noiseSets the sound the player hears when they pick up the item.
items/gunpickup2.wavmessageSets a message shown to the player who takes the item.
Flags
4SharedThe item goes into one pool for the whole team. Any alive player can use it, and so can the world, such as a trigger_relay or the round hook game_round_start, and shared items stay across rounds
Players pick the item up by walking into it, the normal way. If you set USE only too, this flag wins
What happens to a personal item
| When | What happens to the item |
|---|---|
| Its holder dies | It drops where they died, and any alive player can take it there. Untouched for Return time, or out of reach (in a wall, the sky, lava or slime), it goes back to where you placed it. With Keep on death they keep it instead. |
Its holder is stripped (round start, player_weaponstrip) | It goes back to its place, unless Keep on death is set |
| Its holder leaves, or becomes a spectator or the Game Master | It goes back to its place at once |
| A round restarts | Every personal item goes back to its place before the players spawn |
A player_inventory takes it | It is used up: hidden until the next round restart puts it back |
Deaths and players who leave don't change shared items, and with Reset at round start, the team loses a shared item at each round start, and it goes back to its spot.
Checking for an item
A player_hasinventory with the same Item name checks for the item, and as the
Master of a door or a button, it only lets that entity work for a player who carries the item.

A door that opens only for the player who carries the red keycard
Only a player_hasinventory that has the flag Shared too finds a shared item, and a
player_inventory that takes the item away uses it up.
Notes
- Only alive players pick items up
- A player holds at most 16 different items, the team pool holds 16 more, and counts go from 0 up to 32767
- When the map changes, every item is cleared, so a player who reconnects starts with nothing
See also
player_hasinventory- checks for an itemplayer_inventory- gives, takes or sets an itemplayer_calc_ratio- Inventory item count gives how many of an item a player has
Changes since 1.38
item_pickupis new in SBO 2.1.0

