From Valve Developer Community
Revision as of 16:41, 5 October 2020 by Rayman1103 (talk | contribs) (Flags: Updated Flags)
Jump to: navigation, search

<Left 4 Dead 2> weapon_spawn is a point entity available in Left 4 Dead 2. It is a configurable spawner for any non-melee weapon.


Selection <choices>
Spawn the selected weapon or weapon category
Value Description
any Any primary or secondary weapon
any_pistol Any Pistol
weapon_pistol Pistol
weapon_pistol_magnum Magnum Pistol
any_primary Any Primary Weapon
tier1_any Any tier 1 primary
tier2_any Any tier 2 primary
any_smg Any tier 1 SMG
any_rifle Any tier 2 Rifle
any_sniper_rifle Any tier 2 Sniper Rifle
any_shotgun Any Shotgun
tier1_shotgun Any tier 1 Shotgun
tier2_shotgun Any tier 2 Shotgun
weapon_smg SMG
weapon_smg_silenced Silenced SMG
weapon_pumpshotgun Pump Shotgun
weapon_shotgun_chrome Chrome Shotgun
weapon_autoshotgun Auto Shotgun
weapon_shotgun_spas SPAS Shotgun
weapon_rifle M4 Rifle
weapon_rifle_desert Desert Rifle
weapon_rifle_ak47 AK47
weapon_hunting_rifle Hunting Rifle
weapon_sniper_military Sniper Military
weapon_smg_mp5 MP5
weapon_rifle_sg552 SG552
weapon_sniper_awp Sniper AWP
weapon_sniper_scout Sniper Scout
Spawn instantly without director <boolean>
Bypass the proximity checks that make nearby weapons be the same tier / not the same weapon
No CS Weapons <boolean>
When selecting 'any' weapon, set this to true if you do not want CS weapons.


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


Weapon Skin (weapon_skin) <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 box type.
  • 0 : Not Solid
  • 2 : Use Bounding Box
  • 6 : Use VPhysics


World Model (model) <string>
The model this entity should appear as. 128-character limit.
Skin (skin or ModelSkin <Alien Swarm>) <integer>
Some models have multiple skins. This value selects from the index, starting with 0.
Collisions (solid) <choices>
Method of collision for this entity.
Hitbox Set (hitboxset) <string> !FGD
Sets the $hboxset to use.
Body Group (body or SetBodyGroup) <integer> !FGD
Sets the the active $bodygroup.
Model Index (modelindex) <short> !FGD
Changes the entity's model to a precached model on the map.
Warning.png Warning: Using an invalid value will instantly crash the game, this includes 0 and 1.
Model Scale (modelscale) <float> (in all games since <Half-Life 2: Episode Two><Half-Life 2: Episode Two>) (not in [Portal] <Left 4 Dead> <Left 4 Dead 2> <Source><Source>) !FGD <Obsolete>
Deprecated. A multiplier for the size of the model. Negative values are accepted. Does not alter the physics collisions in most cases, however.
Warning.png Warning: Negative or extremely high values can cause crashes!


Sequence (sequence) <integer> !FGD
Default animation sequence for the model to be playing after spawning.
Playback Rate (playbackrate) <float> !FGD
A multiplier of the framerate at which animations are played, negative values are accepted. Default is 1.0
Cycle (cycle) <float> !FGD
The current frame of the currently playing animation, on a range from 0-1.
Texture Frame (texframeindex) <integer> !FGD
The frame number for any animated textures on this entity.

Effects - Render

Start Fade Distance (fademindist) <float>
Distance at which the entity starts fading. If 0 or less, the entity will disappear instantly when end fade is hit. The value will scale appropriately if the entity is in a 3D Skybox.
End Fade Distance (fademaxdist) <float>
Distance at which the entity ends fading. If 0 or less, the entity won't disappear at all. The value will scale appropriately if the entity is in a 3D Skybox.
Fade Scale (fadescale) <float>
If specified in the worldspawn, or if the engine is running below DirectX 8, entities will fade out even if the fade distances above aren't specified. This value gives more control over when this happens: numbers smaller than 1 cause the entity to fade out at further distances, and greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also $noforcedfade.
Render Mode (rendermode) <choices>
Set a non-standard rendering mode on this entity.

Render FX / Transparency (0 - 255) (renderamt) <integer>
Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color tint.
Render FX (renderfx) <choices>
Preset pattern of appearance effects.

Effects - Environment

Disable Shadows (disableshadows) <boolean>
Prevent the entity from creating cheap render-to-texture shadows. Does not affect shadow mapping.
Disable Receiving Shadows (disablereceiveshadows) <boolean>
Prevent the entity from receiving shadows on itself.
Shadow Cast Distance (shadowcastdist) <integer>
Sets how far the entity casts dynamic shadows. 0 means default distance from the shadow_control entity.
Note.png Note: Further research needed for this key, as inconsistencies like unavailability for prop_dynamic in <Source><Source> exists.
Lighting Origin (LightingOrigin) <targetname>
Select an entity (notinfo_lightingentity!) from which to sample lighting instead of the entity's origin.
Lighting Origin Offset (LightingOriginHack) <targetname> (not in <Left 4 Dead> <Left 4 Dead 2>) !FGD <Obsolete>
Deprecated. Theinfo_lighting_relativefrom which to sample lighting instead of the entity's origin.


SystemLevelChoice (in all games since <Left 4 Dead>) :

Minimum Effect Details Level (mincpulevel) <choices> (in all games since <Left 4 Dead>)
Effect Details level of a user's lower than this will not render this entity.
Maximum Effect Details Level (maxcpulevel) <choices> (in all games since <Left 4 Dead>)
Effect Details level of a user's higher than this will not render this entity.
  • 0: Default ("Low" formincpulevel, "High" formaxcpulevel)
  • 1: Low
  • 2: Medium
  • 3: High
Note.png Note: The commandcpu_levelrelates to Effect Details, thus the keys's names.
Minimum Shader Details Level (mingpulevel) <choices> (in all games since <Left 4 Dead>)
Shader Details levels (orgpu_levelcommand) lower than this will not render this object.
Maximum Shader Details Level (maxgpulevel) <choices> (in all games since <Left 4 Dead>)
Shader Details levels (orgpu_levelcommand) higher than this will not render this object.
  • 0: Default ("Low" formingpulevel, "Very High" formaxgpulevel)
  • 1: Low
  • 2: Medium
  • 3: High
  • 4: Very High
Note.png Note: The commandgpu_levelrelates to Shader Details, thus the keys's names.
Glow Backface Multiple (glowbackfacemult) <float> (in all games since <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.


Classname (classname) <string>
The classname defines the type of entity. Classnames can be changed using AddOutput, which will influence how the engine deals with the entity in certain circumstances.
Name (targetname) <string>
The name that other entities refer to this entity by.
Global Entity Name (globalname) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma. Every entity can be parented, even point entities. Entities which are parented will be forced to transition to the next map, such as from a trigger_transition. Some entities which aren't intended to be parented may not function correctly. phys_constraint can be used as a workaround to parenting.
Origin (X Y Z) (origin) <coordinates>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
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.png Note: This works on brush entities, although Hammer doesn't show the new angles.
Flags (spawnflags) <integer>
Toggles features of an entity, its specific number is determined by the combination of flags added.
Response Contexts (ResponseContext) <string>
Pre-defined response system contexts for this entity. Format is key:value,key:value,.... Contexts may be filtered.
Effects (effects) <integer> !FGD
Combination of effect flags to use.
Hammer ID (hammerid) <integer> !FGD
The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. Entities spawned at run-time are not assigned any Hammer ID.
Entity Scripts (vscripts) <scriptlist> (in all games since <Left 4 Dead 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.
Script think function (thinkfunction) <string> (in all games since <Left 4 Dead 2>)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. Try to 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!
Disable for Xbox 360 (disableX360) <boolean> (in all games since <Left 4 Dead 2>) !FGD
If this entity should automatically be given the 'Disable' input on the Xbox 360 version of Source.


  • 16 : Constrain to spawn position (don't drop to the ground)


  • 4 : Absorb any dropped weapon type (only in <Left 4 Dead 2>)
  • 131072 : Don't cluster with similar items (only in <Left 4 Dead>) To do: What is this for? Weapons already have their own density settings, and does this work?


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