Item ammo crate: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(The old code does not display properly with Expand, so I just reworked it.)
Line 18: Line 18:
}}
}}
{{important|Used crate model depends on value from here {{not|{{bms}}}}.}}
{{important|Used crate model depends on value from here {{not|{{bms}}}}.}}
:{| class=standard-table
 
! Value || Ammo Type || Comment
{{expand|title=Half Life 2 series.|
|-
* {{ent|item_ammo_pistol}} (0) - {{hl2ep2|only}}
| 0 || [[item_ammo_pistol]] || {{hl2ep2|only}}
 
|-
* {{ent|item_ammo_smg1}} (1)
| 1 || [[item_ammo_smg1]] ||
 
|-
* {{ent|item_ammo_ar2}} (2)
| 2 || [[item_ammo_ar2]] ||
 
|-
* {{ent|item_rpg_round}} (3)
| 3 || [[item_rpg_round]] ||
 
|-
* {{ent|item_box_buckshot}} (4) - {{hl2ep2|only}}
| 4 || [[item_box_buckshot]] || {{hl2ep2|only}}
 
|-
* {{ent|weapon_frag}} (5)
| 5 || [[weapon_frag]] ||
 
|-
* {{ent|item_ammo_357}} (6) - Uses [[weapon_smg1|SMG]] crate, but provides correct ammo. Can confuse players!
| 6 || [[item_ammo_357]] || Uses SMG crate, but provides correct ammo. Can confuse players!
 
|-
* {{ent|item_ammo_crossbow}} (7) -  Uses SMG crate, but provides correct ammo. Can confuse players!
| 7 || [[item_ammo_crossbow]] || Uses SMG crate, but provides correct ammo. Can confuse players!
 
|-
* {{ent|item_ammo_ar2_altfire}} (8) - Exact same crate as regular AR2 ammo. Can confuse players!
| 8 || [[item_ammo_ar2_altfire]] || Exact same crate as regular AR2 ammo. Can confuse players!
 
|-
* {{ent|item_ammo_smg1_grenade}} (9) - {{hl2ep2|only}} Different crate model, with grenades inside, but icon is still SMG. Can confuse players!
| 9 || [[item_ammo_smg1_grenade]] || {{hl2ep2|only}} Different crate model, with grenades inside, but icon is still SMG. Can confuse players!
}}
|}
{{KV|CanMove|intn=isdynamicmoving|bool|Doesn't work. Mentioned only once in ''bm_c4a4a''. It was probably planned to provide movement to the crate for one of the rooms.|only=bms}}
{{KV|CanMove|intn=isdynamicmoving|bool|Doesn't work. Mentioned only once in ''bm_c4a4a''. It was probably planned to provide movement to the crate for one of the rooms.|only=bms}}
{{KV|Ammo Count|intn=ammocount|integer|Amount of specified ammo to give.|only=bms}}
{{KV|Ammo Count|intn=ammocount|integer|Amount of specified ammo to give.|only=bms}}

Revision as of 03:48, 18 May 2025

English (en)Translate (Translate)
C++ Class hierarchy
CItem_AmmoCrate
CBaseAnimating
CBaseEntity
C++ item_ammo.cpp
Item ammo crate smg1.png
Item ammo crate bms.png

item_ammo_crate is a point entity available in Half-Life 2 series Half-Life 2 series and Black Mesa Black Mesa. This entity places a large crate containing an unlimited supply of a certain type of ammo (specified by Ammo Type). The player can open it as many times as desired, by pressing the +use key (E by default), and get a complete refill of the specified ammo type. Most inputs, outputs and properties are same as CBaseAnimating.

PlacementTip.gifPlacement Tip:This entity should not be placed in areas with many opponents, since this crate provides the player with a big advantage against any opponents in the area.
Note.pngNote:It can be used if it received damage and if player holds weapon_crowbar. This means that a player can open it with the crowbar or with grenades if holding crowbar, distance doesn't matter.


Keyvalues

Model (model) <model path> (only in Black Mesa)
Model to use for this entity.


Ammo Type (AmmoType) <choices>
Decides which ammo will be inside the crate.
Warning.pngWarning:The fgd defaults to pistol, which are only available in Half-Life 2: Episode Two Half-Life 2: Episode Two.
Icon-Important.pngImportant:Used crate model depends on value from here (not in Black Mesa).
Half Life 2 series.
  • item_ammo_357 (6) - Uses SMG crate, but provides correct ammo. Can confuse players!
  • item_ammo_smg1_grenade (9) - (only in Half-Life 2: Episode Two) Different crate model, with grenades inside, but icon is still SMG. Can confuse players!
CanMove (isdynamicmoving) <boolean> (only in Black Mesa)
Doesn't work. Mentioned only once in bm_c4a4a. It was probably planned to provide movement to the crate for one of the rooms.
Ammo Count (ammocount) <integer> (only in Black Mesa)
Amount of specified ammo to give.

Outputs

OnUsed
Fires when used by the player.

See also