weapon_ammo_spawn

From Valve Developer Community
Jump to: navigation, search
Nuvola apps ksnapshot.png
This article or section needs a screenshot to help visually convey the subject.
You can upload screenshots at Special:Upload. For help, see Help:Images.

weapon_ammo_spawn is a point entity available in Left 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

World Model (model) <string>
The model this entity should appear as. 128-character limit.

WeaponSpawn:

Count (count) <integer>
Max number of weapons given before disappearing.

WeaponSpawnSingle:
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.
Collisions (solid) <choices>
Collision type.
  • 0 : Not Solid
  • 2 : Use Bounding Box
  • 6 : Use VPhysics

Model:

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.



Base:
Name (targetname) <string>
The name that other entities use to refer to this entity.
Parent (parentname) <targetname>
Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (parentname [targetname],[attachment])
Tip.pngTip:Entities transition to the next map with their parents
Tip.pngTip:phys_constraint can be used as a workaround if parenting fails.
Origin (X Y Z) (origin) <coordinates>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Note.pngNote:Hammer does not move the entities accordingly only in the editor.
Pitch Yaw Roll (X Y Z) (angles) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Note.pngNote:This works on brush entities, although Hammer doesn't show the new angles.
Classname (classname) <string> !FGD
Determines the characteristics of the entity before it spawns.
Tip.pngTip:Changing this on runtime still has use, like making matching an entry in S_PreserveEnts will persist the entity on new rounds!
Spawnflags (spawnflags) <flags> !FGD
Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.
Effects (effects) <flags> !FGD
Combination of effect flags to use.
Entity Scripts (vscripts) <scriptlist> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions. Scripts executed on the worldspawn entity will be placed in root scope.
Think function (thinkfunction) <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Name of the function within this entity's script that'll be called automatically every 100 milliseconds, or a user-defined interval if the function returns a number. Avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) <boolean> (in all games since Left 4 Dead 2) !FGD
Set to Yes to lag compensate this entity. Should be used very sparingly!

Flags


WeaponSpawn:
  •  [4] : Absorb any dropped weapon type (only in Left 4 Dead 2)
  •  [131072] : Don't cluster with similar items (only in Left 4 Dead)

WeaponSpawnSingle:
  •  [1] : Enable Physics
  •  [2] : Must Exist
  •  [8] : Infinite items (overrides count) (only in Left 4 Dead 2)

Inputs

Outputs


WeaponSpawnSingle:
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.