game_weapon_manager
From Valve Developer Community
This is a point entity available in all Source games.
Contents |
Entity Description
An entity used to limit the number of a particular weapon type in the world. Useful in places where NPCs are spawning rapidly, dying, and dropping weapons.
The properties of this entity apply to the whole map. Multiple instances of this entity within a map may cause errors.
This entity conducts a count of all the weapons in the world of my type and see if we have a surplus. If there is a surplus, try to find suitable candidates for removal. Right now we just remove the first weapons we find that are behind the player, or are out of the player's PVS.
In code it is represented by class CGameWeaponManager, defined in basecombatweapon_shared.cpp.
Keyvalues
Targetname:
- Name <string>
- The targetname other entities refer to this entity by.
- weaponname
- <string> Classname of the weapon type to limit.
- maxpieces
- <integer> The maximum amount of the specified weapon type allowed in the world.
- ammomod
- <float> Modifier for amount of ammo dropped by a weapon.
Inputs
Targetname:
-
Kill - Removes this entity from the world.
-
KillHierarchy - Removes this entity and all its children from the world.
-
AddOutput <string> - Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
- Format:
<key> <value> - Format:
<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite> -
FireUser1toFireUser4 - Fire the
OnUseroutputs; see User Inputs and Outputs.
- SetAmmoModifier
- <float> Adjust the ammo modifier.
Outputs
Targetname:
-
OnUser1toOnUser4 - Fired in response to the
FireUserinputs; see User Inputs and Outputs. -
OnKilled(New with Left 4 Dead) - Fired when the entity is killed and removed from the game.
