tf_weaponbase_melee

From Valve Developer Community
Jump to: navigation, search
Class hierarchy
CTFWeaponBaseMelee
CTFWeaponBase
CBaseCombatWeapon
CBaseAnimating
CBaseEntity
tf_weaponbase_melee.cpp

tf_weaponbase_melee is a point entity available in Team Fortress 2 Team Fortress 2. It is used by all melee weapon entities in TF2 for fundamental melee weapon functions.

Note.pngNote:Emits weapon data file errors upon the creation of this entity through the ent_create command.

Dedicated Console Variables and Commands

tf_weapon_criticals_melee <integer>
Determines whether melee weapons are eligible for critical hits.
0 - Melee weapons do not randomly crit.
1 - Melee weapons can randomly crit only if tf_weapon_criticals is also enabled.
2 - Melee weapons can always randomly crit regardless of the `tf_weapon_criticals` setting.

Outputs

Weapon:

OnNPCPickup
Fires when an NPC picks up this weapon. (!activator is the NPC.)
OnPlayerUse
Fires when the player +uses this weapon. (!activator is the player.)
OnPlayerPickup
Fires when a player picks up this weapon. (!activator is the player.)
OnCacheInteraction
Fires when the player 'proves' they've found this weapon. Fires on: Player Touch, +USE pickup, Physcannon pickup, Physcannon punt.