Item ammo crate: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added AmmoType value 9 (SMG Altfire))
 
(42 intermediate revisions by 15 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:item_ammo_crate}}
{{LanguageBar|title = item_ammo_crate}}
[[Image:item_ammo_crate.jpg|thumb|250px|right|An item_ammo_crate, containing SMG1 ammo.]]
{{CD|CItem_AmmoCrate|file1=item_ammo.cpp}}
{{hl2 point|item_ammo_crate}}
[[File:item_ammo_crate_smg1.png|200px||thumb|right|Ammo crate model with [[Weapon smg1|SMG1]] ammo for {{hl2|1}}.]]  
[[File:item_ammo_crate_bms.png|200px||thumb|right|Ammo crate model with [[item_grenade_rpg|RPG]] ammo for {{bms|1}}.]]


==Entity description==
{{this is a|model entity|name=item_ammo_crate|game=Half-Life 2 series|game1=Black Mesa}} This entity places a large crate containing an ''unlimited'' supply of a certain type of ammo (specified by '''Ammo Type'''). The {{ent|player}} can open it as many times as desired, by pressing the {{Ent|+use}} key ({{Key|E}} by default), and get a complete refill of the specified ammo type. Most inputs, outputs and properties are same as [[CBaseAnimating]].
This entity places a large crate contains an ''unlimited'' supply of a certain type of ammo (specified by ''AmmoType''). The player can open it as many times as desired, by pressing the +[[use]] key, and max out this type of ammo.
 
{{Placement 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.}}
{{ModernPlacementTip|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|It can be used if it received damage and if player holds {{ent|weapon_crowbar}}. This means that a player can open it with the crowbar or with grenades if holding crowbar, distance doesn't matter.}}
 
__NOTOC__


==Keyvalues==
==Keyvalues==
{{KV Targetname}}
{{KV|Model|intn=model|studio|Model to use for this entity.|only=bms}}
{{KV Angles}}
{{KV|Ammo Type|intn=AmmoType|choices|Decides which ammo will be inside the crate.
{{KV|AmmoType|choices|Decides wich ammo will be inside the crate.}}
 
:{| class=standard-table
{{warning|The [[fgd]] defaults to pistol, which are only available in {{hl2ep2|4}}.}}
! Literal Value || Ammunition || Functions
 
|-
{{important|Used crate model depends on value from here {{not|{{bms}}}}.}}
| 0 || [[item_ammo_pistol]] || No [Yes (Episode 2)]
 
|-
{{expand|title=Half Life 2 series.|
| 1 || [[item_ammo_smg1]] || Yes
* {{ent|item_ammo_pistol}} (0) - {{hl2ep2|only}}
|-
 
| 2 || [[item_ammo_ar2]] || Yes
* {{ent|item_ammo_smg1}} (1)
|-
 
| 3 || [[item_rpg_round]] || Yes
* {{ent|item_ammo_ar2}} (2)
|-
 
| 4 || [[item_box_buckshot]] || No [Yes (Episode 2)]
* {{ent|item_rpg_round}} (3)
|-
 
| 5 || [[weapon_frag]] || Yes
* {{ent|item_box_buckshot}} (4) - {{hl2ep2|only}}
|-
 
| 6 || [[item_ammo_357]] || No
* {{ent|weapon_frag}} (5)
|-
 
| 7 || [[item_ammo_crossbow]] || No
* {{ent|item_ammo_357}} (6) - Uses [[weapon_smg1|SMG]] crate, but provides correct ammo. Can confuse players! Fixed in {{mapbase|4}}.
|-
 
| 8 || [[item_ammo_ar2_altfire]] || Yes
* {{ent|item_ammo_crossbow}} (7) -  Uses SMG crate, but provides correct ammo. Can confuse players! Fixed in {{mapbase|4}}.
|-
 
| 9 || [[item_ammo_smg1_grenade]] || No [Yes (Episode 2)]]]
* {{ent|item_ammo_ar2_altfire}} (8) - Exact same crate as regular AR2 ammo. Can confuse players! Fixed in {{mapbase|4}}.
|}
 
:{{Warning|Some crate models are missing, so only about half of these settings will work. If the game can't find the model for the AmmoType, the model will instead be replaced by a glowing red model saying "ERROR", and the crate will not work.}}
* {{ent|item_ammo_smg1_grenade}} (9) - {{hl2ep2|only}} Different crate model, with grenades inside, but icon is still SMG. Can confuse players!
 
* {{ent|weapon_slam}} (10) - {{mapbase|only}}
 
* Empty (11) - {{mapbase|only}}
 
{{bug|tested={{hl2ep2}}|Not using one of these will result instant crash.}}
}}
 
{{expand|title=Black Mesa.|
* [[item_ammo_glock|9mm Rounds]] (9mm) - ammo type used for {{ent|weapon_mp5}} (main ammo), {{ent|weapon_glock}} and {{ent|weapon_assassin_glock}}.
 
* [[Item ammo 357 (Black Mesa)|357]] (357) - ammo type used for {{ent|weapon_357}}.
 
* [[Item ammo crossbow (Black Mesa)|Bolts]] ([[grenade_bolt|bolt]]) - ammo type used for {{ent|weapon_crossbow}}.
 
* [[Item ammo shotgun|Buckshot]] (buckshot) - ammo type used for {{ent|weapon_shotgun}}.
 
* [[Item ammo energy|Energy]] (energy) - ammo type used for {{ent|weapon_gluon}} and {{ent|weapon_tau}}.
 
* [[Item grenade mp5|MP5 Grenade]] ([[grenade_mp5]]) - ammo type used for {{ent|weapon_mp5}} (secondary ammo).
 
* [[Item grenade rpg|RPG]] ([[grenade_rpg]]) - ammo type used for {{ent|weapon_rpg}}.
 
* [[Item weapon frag|Frag Grenades]] ([[grenade_frag]]) - ammo type used for {{ent|weapon_frag}}.
 
* [[Item weapon satchel|Satchels]] ([[grenade_satchel]]) - ammo type used for {{ent|weapon_satchel}}.
 
* [[Item weapon tripmine|Tripmines]] ([[grenade_tripmine]]) - ammo type used for {{ent|weapon_tripmine}}.
 
* [[Item weapon snark|Snark]] ([[npc_snark|snark]]) - not in [[FGD]], ammo type used for {{ent|weapon_snark}}.
 
* [[Item weapon hivehand|Hornet]] ([[grenade_hornet]]) - not in [[FGD]], ammo type used for {{ent|weapon_hivehand}}.
 
* {{w|.50 BMG}} (50cal) - not in [[FGD]], not used for any of the weapons that can be picked up by the player by default.
 
* [[npc_sentry_ground|Sentry]] (sentry) - not in [[FGD]],  not used for any of the weapons that can be picked up by the player by default.
 
* Sniper Round (SniperRound) - not in [[FGD]], not used for any of the weapons that can be picked up by the player by default.
 
* Sniper Penetrated Round (SniperPenetratedRound) - not in [[FGD]], not used for any of the weapons that can be picked up by the player by default.
 
{{note|Not using one of these will result entity disappear.}}
{{bug|hidetested=1|Player will not get a new weapon ({{ent|weapon_tripmine}}, {{ent|weapon_satchel}}, {{ent|weapon_frag}} or {{ent|weapon_snark}}) if didn't pick up it before. Interaction with this entity adds the ammo amount, but not giving anything.}}
}}


==Inputs==
}}
{{I Targetname}}
{{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}}


==Outputs==
==Outputs==
{{O Targetname}}
{{O|OnUsed|activator = the player that used this|Fires when [[+use|used]] by the player.}}
{{IO|OnUsed|Fires when +used by the player {{PlAct}}.}}


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

Latest revision as of 05:57, 2 August 2025

English (en)Translate (Translate)
C++ Class hierarchy
CItem_AmmoCrate
CBaseAnimating
CBaseEntity
C++ item_ammo.cpp
Ammo crate model with SMG1 ammo for Half-Life 2.
Ammo crate model with RPG ammo for Black Mesa.

item_ammo_crate is a model 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_smg1_grenade (9) - (only in Half-Life 2: Episode Two) Different crate model, with grenades inside, but icon is still SMG. Can confuse players!
  • Empty (11) - (only in Mapbase)
Icon-Bug.pngBug:Not using one of these will result instant crash.  (tested in: Half-Life 2: Episode Two)
Black Mesa.
  • Wikipedia icon .50 BMG (50cal) - not in FGD, not used for any of the weapons that can be picked up by the player by default.
  • Sentry (sentry) - not in FGD, not used for any of the weapons that can be picked up by the player by default.
  • Sniper Round (SniperRound) - not in FGD, not used for any of the weapons that can be picked up by the player by default.
  • Sniper Penetrated Round (SniperPenetratedRound) - not in FGD, not used for any of the weapons that can be picked up by the player by default.
Note.pngNote:Not using one of these will result entity disappear.
Icon-Bug.pngBug:Player will not get a new weapon (weapon_tripmine, weapon_satchel, weapon_frag or weapon_snark) if didn't pick up it before. Interaction with this entity adds the ammo amount, but not giving anything.
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
!activator = the player that used this
!caller = this entity
Fires when used by the player.

See also