player_inventory

A player_inventory gives, takes or sets an inventory item of the player who triggers it, without an
item_pickup in the world. With the flag Shared, it works on the team's shared items instead,
and anything can trigger it, the world too.
If it takes an item that came from an item_pickup, that pickup is used up and stays hidden until the next round
restart. A shared pickup with Reset at round start comes back at the next round start.
Items that this entity gives have no pickup in the world. A player loses a personal item when they die, lose their weapons or leave, and when a round restarts. Shared items aren't lost this way.
Attributes
The entity also has these common keys:
- Naming and triggering: Name
item_nameNames the item, with up to 31 characters.
If you leave this key empty and use Remove or Set with a Count of 0 or less, it takes every item.
item_iconSets the icon that a new item gets on the HUD when this entity gives it.
- Key (inv_key)
- Red keycard (inv_card_red)
- Blue keycard (inv_card_blue)
- Yellow keycard (inv_card_yellow)
Key (inv_key)operationSets what the entity does.
- Remove (-1) - It takes the item
- Use type (0) - The use type decides. On and Toggle give and Off takes. Set makes the count the value it was triggered with, for example from a
trigger_changevalueor acalc_entity - Give (1) - It gives the item
- Set (2) - It sets the count to Count
Use type (0)countSets how many it gives, takes or sets. A Give or a Remove counts 0 or less as 1, and a Set of 0 takes the item.
1collect_limitSets the most of the item that a Give or a Set gives.
If you leave this key empty or set 0, there is no limit, which means 32767.
0on_count_changeFires this target when the count changes.
on_item_limitFires this target when the item is new and the player already holds 16 different items.
on_max_count_limitFires this target when a Give or a Set finds the item at its Maximum already.
on_count_overflowFires this target when the count goes over Maximum. The count stays at the maximum unless you set Allow going over Maximum.
round_resetWith Yes and Remove On Fire, the entity turns off until the next round and doesn't remove itself. With Shared, the team's count of this item goes back at each round start to what it holds from item_pickup entities.
- No (0)
- Yes (1)
No (0)Flags
1Remove On FireThe entity removes itself after it fires once
2Allow going over MaximumA Give or a Set may go over Maximum
4SharedIt works on the team's shared items, and anything can trigger it
Taking an item
On Count Change only fires when the count changes. A Remove triggered by a player who has the item fires it, but a
Remove triggered by a player without the item fires nothing. A player_calc_ratio with the
Value "Inventory item count" gives how many of an item a player holds, and a
trigger_compare can compare that number.
See also
item_pickup- an item that players pick upplayer_hasinventory- checks whether a player has an item
Changes since 1.38
player_inventoryis new in SBO 2.1.0
