Game weapon manager: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (ep1 add)
mNo edit summary
Line 1: Line 1:
{{wrongtitle|title=game_weapon_manager}}
{{wrongtitle|title=game_weapon_manager}}
{{base_point}}


==Entity Description==
==Entity Description==
Line 10: Line 11:
{{warning|This entity is designed using [[UTIL_GetLocalPlayer]], which returns [[NULL]] in any type of multiplayer game.}}
{{warning|This entity is designed using [[UTIL_GetLocalPlayer]], which returns [[NULL]] in any type of multiplayer game.}}


==Availability==
{{in game|point}} {{game-base}}
{{in code|class=/class_c_game_weapon_manager.html CGameWeaponManager|file=basecombatweapon__shared_8cpp-source.html basecombatweapon_shared.cpp}}
{{in code|class=/class_c_game_weapon_manager.html CGameWeaponManager|file=basecombatweapon__shared_8cpp-source.html basecombatweapon_shared.cpp}}


Line 28: Line 27:
==Outputs==
==Outputs==
*{{o targetname}}
*{{o targetname}}
[[Category:Entities]]

Revision as of 12:32, 12 April 2008

Template:Wrongtitle Template:Base point

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.

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.

Note.pngNote:This code is designed to not remove weapons that are hand-placed by level designers. It should only clean up weapons dropped by dead NPCs, which is useful in situations where enemies are spawned in for a sustained period of time.
Warning.pngWarning:This entity is designed using UTIL_GetLocalPlayer, which returns NULL in any type of multiplayer game.

Template:In code

Keyvalues

<string> Classname of the weapon type to limit.
  • maxpieces
<integer> The maximum amount of the specified weapon type allowed in the world.
<float> Modifier for amount of ammo dropped by a weapon.

Inputs

<float> Adjust the ammo modifier.

Outputs