Item ammo crate: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(This entity can be parented.)
(updates)
Line 1: Line 1:
[[Image:item_ammo_crate.jpg|thumb|250px|right|An item_ammo_crate, containing SMG1 ammo.]]
{{lang|Item ammo crate}}
{{hl2 point|item_ammo_crate}}
[[File:item_ammo_crate.jpg|thumb|250px|right|An item_ammo_crate, containing SMG1 ammo.]]
{{hl2 point|item_ammo_crate}} 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 {{ent|+use}} key ({{key|E}} by default), and get a complete refill of the specified ammo type.


==Entity description==
{{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.}}
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|
{{note|When this entity is killed via the <code>Kill</code> input, it will not tell an owner (if any) that it was <code>Kill</code>ed.{{why}} Normal <code>Kill</code> behavior can still be reached through <code>KillHierarchy</code>.}}
*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.
 
*This entity can be parented, despite the field being absent from the FGD. Manually add the parentname keyvalue by disabling SmartEdit.}}
{{code class|CItem_AmmoCrate|item_ammo.cpp}}


==Keyvalues==
==Keyvalues==
{{KV Targetname}}
{{KV|Ammo Type (AmmoType)|choices|Decides which ammo will be inside the crate.}}
{{KV Angles}}
{{KV|AmmoType|choices|Decides wich ammo will be inside the crate.}}
:{| class=standard-table
:{| class=standard-table
! Literal Value || Ammunition || Functions
! Literal Value || Ammunition || Functions
Line 33: Line 32:
| 8 || [[item_ammo_ar2_altfire]] || Yes
| 8 || [[item_ammo_ar2_altfire]] || Yes
|-
|-
| 9 || [[item_ammo_smg1_grenade]] || No [Yes (Episode 2)]]]
| 9 || [[item_ammo_smg1_grenade]] || No [Yes (Episode 2)]
|}
|}
:{{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.}}
:{{Warning|Some crate models are missing, so only about half of these settings will work. If the game can't find the model, the crate will not work.}}
{{KV BaseAnimating|base=1}}
{{KV BaseEntity|base=1}}


==Inputs==
==Inputs==
{{I Targetname}}
{{I BaseAnimating}}
{{I BaseEntity|base=1|prel4d=1}}


==Outputs==
==Outputs==
{{O Targetname}}
{{IO|OnUsed|Fires when <code>+use</code>d by the player.}}
{{IO|OnUsed|Fires when +used by the player {{PlAct}}.}}
{{O BaseAnimating}}
{{O BaseEntity}}


==See also==
==See also==
*[[Crates]] - For basic crates
*[[Crates]] - For basic crates
[[Category:Items]]

Revision as of 03:22, 11 September 2018

English (en)Translate (Translate)
An item_ammo_crate, containing SMG1 ammo.

Template:Hl2 point 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.

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:When this entity is killed via the Kill input, it will not tell an owner (if any) that it was Killed.[Why?] Normal Kill behavior can still be reached through KillHierarchy.
C++ In code, it is represented by theCItem_AmmoCrateclass, defined in theitem_ammo.cppfile.

Keyvalues

Ammo Type (AmmoType) ([todo internal name (i)]) <choices>
Decides which ammo will be inside the crate.
Literal Value Ammunition Functions
0 item_ammo_pistol No [Yes (Episode 2)]
1 item_ammo_smg1 Yes
2 item_ammo_ar2 Yes
3 item_rpg_round Yes
4 item_box_buckshot No [Yes (Episode 2)]
5 weapon_frag Yes
6 item_ammo_357 No
7 item_ammo_crossbow No
8 item_ammo_ar2_altfire Yes
9 item_ammo_smg1_grenade No [Yes (Episode 2)]
Warning.pngWarning:Some crate models are missing, so only about half of these settings will work. If the game can't find the model, the crate will not work.
Note.pngNote:Content moved to Rendering and studio model related KIO/Keyvalues for continuation of page history


Inputs

Note.pngNote:Content moved to Rendering and studio model related KIO/Inputs for continuation of page history


Outputs

OnUsed
Fires when +used by the player.
Note.pngNote:Content moved to Rendering and studio model related KIO/Outputs for continuation of page history


See also