Weapon ammo spawn: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added Outputs)
(→‎Flags: Added Warning about flag 8)
 
(12 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{note|The current description of this entity is based on unofficial data based on data mining. Anything that may be read here is largely incomplete or, in some cases, incorrect.}}
{{CD|CWeaponAmmoSpawn}}
[[File:ammunition_pile_l4d2.png|thumb|An ammunition pile.]]
{{this is a|model entity|name=weapon_ammo_spawn|series=Left 4 Dead}} Ammo restocks can spawn at this area, which replenishes ammo for all weapons except the [[weapon_grenade_launcher|Grenade Launcher]] and [[weapon_rifle_m60|M60]].


== Entity description ==
== Keyvalues ==
A possible spawnpoint for ammo restock in Left 4 Dead.
{{KV Targetname}}
{{KV|World Model|intn=model|string|The [[model]] this entity should appear as. 128-character limit.}}
{{KV WeaponSpawn}}
 
== Flags ==
{{Fl WeaponSpawn}}
{{Warning|Do NOT use the <b>Infinite items (overrides count)</b> flag. Not only it doesn't make sense, but it also breaks the manipulation of this entity by [[Left 4 Dead 2/Scripting/Director Scripts/AllowWeaponSpawn|{{code|AllowWeaponSpawn}}]] and [[Left 4 Dead 2/Scripting/Director Scripts/ConvertWeaponSpawn|{{code|ConvertWeaponSpawn}}]]. For example, it breaks the ammo to laser conversion in Tank Run.}}


== Outputs ==
== Outputs ==
* '''OnPlayerTouch'''
{{O WeaponSpawn}}
:Fires an Output when Player touches the ammo stock.
* '''OnCacheInteraction'''
:Fires an Output when the Player uses the ammo stock.
* '''OnIgnite'''
:Fires an Output when the ammo stock is on fire.
* '''OnKilled'''
:Fires an Output when it gets removed.
 
== Keyvalues ==
{{kv weapon l4d}}
{{note|Ammo and count is usually unspecified for ammo spawnpoints.}}
== Flags ==
{{fl weapon l4d}}


[[Category:Left 4 Dead Entities]]
[[Category:Weapons]]
[[Category:Left 4 Dead Weapons]]
[[Category:Left 4 Dead 2 Weapons]]

Latest revision as of 17:36, 14 October 2025

C++ Class hierarchy
CWeaponAmmoSpawn
CWeaponSpawn
CItem
CBaseAnimating
CBaseEntity
An ammunition pile.

weapon_ammo_spawn is a model entity available in Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series. Ammo restocks can spawn at this area, which replenishes ammo for all weapons except the Grenade Launcher and M60.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

World Model (model) <string>
The model this entity should appear as. 128-character limit.
Count (count) <integer>
Max number of weapons given before disappearing.
Weapon Skin (weaponskin) <integer>
Some weapons have multiple versions of their textures, called skins. Set this to a number other than -1 to make the given weapon use that skin instead of the default.
Glow Range (glowrange) <float>
Set a custom glow range for this spawner. 0 means use the default range.
Glow Backface Multiple (glowbackfacemult) <float> (only in Left 4 Dead 2) !FGD
If this object has a glow effect, multiply the effect by this much on the sides of the object that are facing away from the viewer.

Flags

Enable Physics : [1]
Must Exist : [2]
Infinite items (overrides count) : [8] (only in Left 4 Dead 2)
Absorb any dropped weapon type : [4] (only in Left 4 Dead 2)
Don't cluster with similar items : [131072] (only in Left 4 Dead)
Warning.pngWarning:Do NOT use the Infinite items (overrides count) flag. Not only it doesn't make sense, but it also breaks the manipulation of this entity by AllowWeaponSpawn and ConvertWeaponSpawn. For example, it breaks the ammo to laser conversion in Tank Run.

Outputs

OnItemSpawn  (removed since Left 4 Dead 2)
Fired if this object is spawned on the map. If the weapon is removed during the weapon spawn pass, this will not fire.