Item item crate: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.)
(-added class hierarchy, cleanup (page load time from like 13s to 0.7))
Line 1: Line 1:
{{lang|Item item crate}}
{{lang|Item item crate}}
{{CD|CItem_ItemCrate|file1=item_itemcrate.cpp}}
[[File: item_item_crate.png | right | 300px]]
[[File: item_item_crate.png | right | 300px]]


Line 5: Line 6:


By default, it contains {{ent|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.
By default, it contains {{ent|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.
{{code class|CItem_ItemCrate|item_itemcrate.cpp}}{{note|This is ''not'' a {{ent|CItem}} however.}}
__TOC__
{{clr}}
==Flags==
{{Fl BasePropPhysics}}


==Keyvalues==
==Keyvalues==
{{KV|Crate Contains (CrateType)|int|deprecated=1|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 {{ent|prop_physics}} instead as it's not as memory-intensive.)}}
{{KV|Crate Contains|intn=CrateType|int|deprecated=1|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 {{ent|prop_physics}} instead as it's not as memory-intensive.)}}
{{KV|Item Type (ItemClass)|pointentityclass|[[Classname]] of the entity to spawn when the crate is broken. Suggested point entity: {{ent|item_dynamic_resupply}}}}
{{KV|Item Type|intn=ItemClass|pointentityclass|[[Classname]] of the entity to spawn when the crate is broken. Suggested point entity: {{ent|item_dynamic_resupply}}}}
{{KV|Item Count (ItemCount)|int|Number of items to drop upon breakage.}}
{{KV|Item Count|intn=ItemCount|int|Number of items to drop upon breakage.}}
{{KV BreakableProp}}
{{KV BasePropPhysics}}
{{KV BaseAnimating|base=1}}
{{KV BaseEntity|base=1}}


==Inputs==
{{I BasePropPhysics}}
{{I BreakableProp}}
{{I BaseAnimating}}
{{I BaseEntity|base=1|prel4d=1}}
==Outputs==
==Outputs==
{{IO|OnCacheInteraction|This output fires when the player proves they have "found" this item.
{{IO|OnCacheInteraction|This output fires when the player proves they have "found" this item.
Line 35: Line 19:
:*Picked up by gravity gun.
:*Picked up by gravity gun.
:*Punted by gravity gun.}}
:*Punted by gravity gun.}}
{{O BasePropPhysics}}
 
{{O Breakable|prop=1}}
{{OtherKIO|prop_physics}}
{{O BaseAnimating}}
{{O BaseEntity}}


==See also==
==See also==

Revision as of 06:17, 1 July 2024

English (en)Translate (Translate)
C++ Class hierarchy
CItem_ItemCrate
CPhysicsProp
CBreakableProp
CBaseProp
CBaseAnimating
CBaseEntity
C++ item_itemcrate.cpp
Item item crate.png

item_item_crate is a point 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. Suggested point entity: item_dynamic_resupply
Item Count (ItemCount) <integer>
Number of items to drop upon breakage.

Outputs

OnCacheInteraction
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