item_item_crate

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)
Class hierarchy
CItem_ItemCrate
CPhysicsProp
CBreakableProp
CBaseProp
CBaseAnimating
CBaseEntity
item_itemcrate.cpp
Item item crate.png

item_item_crate is a model entity available in Half-Life 2 Half-Life 2, Half-Life 2: Episode One Half-Life 2: Episode One, Half-Life 2: Episode Two Half-Life 2: Episode Two, and Half-Life 2: Deathmatch Half-Life 2: Deathmatch. It's the standard supply crate that creates specified content when broken.

By default, it contains item_dynamic_resupply, an entity that spawns whatever item the player needs most (health, armor, ammo). By changing the crate's Item Type, you can make it drop specific items.

Keyvalues

Crate Contains (CrateType) <integer> Obsolete
Deprecated.
Do not alter. Numbers other than 0 will cause the crate to spawn nothing after being broken. (If that's desired, try to use a prop_physics instead as it's not as memory-intensive.)
Item Type (ItemClass) <pointentityclass>
Classname of the entity to spawn when the crate is broken. Default item_dynamic_resupply
Item Count (ItemCount) <integer>
Number of items to drop upon breakage.

Outputs

OnCacheInteraction
!activator = The player that broke this by jumping on it, grabbed it, picked it by gravity gun. If broken via throwing with gravity gun the activator is NULL. If broken by gravity gun M1 attack the activator is the player and output fires twice. If broken by throwing prop_physics on it or other physical entity then that entity is the activator. If broken by hitscan weapons the player is the activator. If broken by grenade, rockets, crossbow, combine energy ball the activator is the projectile which is probably NULL for the first three mentioned by the time output is processed[confirm]. If broken by Break input then its the activator of the input.
!caller = This entity, if broken then by the time the output is process it will be NULL[confirm]
This output fires when the player proves they have "found" this item.
Fires on:
  • Player Touch (whether or not player actually acquires the item).
  • Picked up by +use.
  • Picked up by gravity gun.
  • Punted by gravity gun.
Note.pngNote:Other Keyvalues / Inputs / Outputs are same as prop_physics.

See also