item_inventory_box

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)

item_inventory_box is a point entity available in No More Room in Hell No More Room in Hell.

Entity Description

The item_inventory_box is the infamous Supply Crate that brings stacks of weapons, medicine and ammo to the Survival Maps every resupply wave, as well as being commonly found in custom Objective Maps. With a bit of work, you can fill it with any item you please, and in different quantities using I/O.

KeyValues

Name (targetname) <string>
The name that other entities refer to this entity by.
Entity Scripts (vscripts) <string>
Name(s) of script files that are executed after all entities have spawned.
Script think function (thinkfunction) <string>
Name of a function in this entity's script scope which will be called automatically.
Pitch Yaw Roll (Y Z X) (angles) <angles>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Enable Glow Effect (glowable) <boolean>
Sets the 'glowable' state. If you want to use glow properties and inputs, you'll need to enable this first.
Glow Start Disabled (glowstartdisabled) <boolean>
Glow starts disabled.
Glow Show Compass Blip (glowblip) <boolean>
Should this glow show a 'blip' in the player compass?
Glow Color (glowcolor) <color255>
Glow color.
Glow Distance (glowdistance) <integer>
Max distance for a player to see the glow, in units. Use -1 for no limit.
World Model (model) <model path>
Default : models/props/army/heli_supplycrate.mdl.
Spawn Empty? (spawnempty) <boolean>
Should the inventory box spawn without contents?
Spawn Solid? (spawnsolid) <boolean>
Should the inventory box have collisions on spawn?
Uncategorized? (uncategorized) <boolean>
Should the inventory box have no categories? This means any item can be inserted in the box without specific sections.
Background Texture Override (background) <texture>
Optional background texture override, when empty, a default texture will be used.

Flags

Remove empty box : [1]
When the Supply Box is emptied of items, remove it.

Inputs

AddItem
Adds an item to the inventory box. If the box is full, this input fails.
AddRandomWeapon
Adds a random weapon item to the inventory box, with a parameter of item count. Use -1 to fill all the empty slots.
AddRandomGear
Adds a random gear item to the inventory box, with a parameter of item count. Use -1 to fill all the empty slots.
AddRandomAmmo
Adds a random ammo item to the inventory box, with a parameter of item count. Use -1 to fill all the empty slots.
RandomizeContents
Randomizes new contents, and replaces all existing items.
RemoveAllItems
Removes all items in the inventory box.
AllowEmpty
Sets whether or not the box will be removed once it's been emptied, with a boolean parameter. e.g. you can execute this input before RemoveAllItems on boxes that die when empty, to prevent them from disappearing.

Outputs

OnOpen
Fires when this supply box is opened.
OnClose
Fires when this supply box is closed.
OnPlayerTakeItem
Fires when a Player takes an item from the supply box.
OnUser1 to OnUser4
Fired in response to the FireUser inputs.