Tf weaponbase melee: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created entity page. [Information from the 2018 source code leak of TF2 with some testing. PLEASE FACT CHECK THIS PAGE!])
 
m (Classifying as model entity)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{tf2 point|tf_weaponbase_melee}} It is used by all melee weapon entities in TF2 for fundamental melee weapon functions.
{{CD|CTFWeaponBaseMelee|file1=tf_weaponbase_melee.cpp}}
{{this is a|model entity|game=Team Fortress 2|name=tf_weaponbase_melee}} It is used by all melee weapon entities in TF2 for fundamental melee weapon functions.


{{code class|CTFWeaponBaseMelee|tf_weaponbase_melee.cpp}}
{{note|Emits weapon data file errors upon the creation of this entity through the <code>ent_create</code> command.}}
{{note|Emits weapon data file errors upon the creation of this entity through <code>ent_create</code>.}}
==Dedicated Console Variables and Commands==
==Dedicated Console Variables and Commands==
;tf_weapon_criticals_melee <integer>
;tf_weapon_criticals_melee <integer>
Line 9: Line 9:
:: 1 - Melee weapons can randomly crit only if tf_weapon_criticals is also enabled.
:: 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.
:: 2 - Melee weapons can always randomly crit regardless of the `tf_weapon_criticals` setting.
==Keyvalues==
{{KV BaseEntity}}
==Inputs==
{{I WeaponSpawn}}


==Outputs==
==Outputs==
{{O BaseAnimating}}
{{O Weapon}}
{{O Weapon}}

Latest revision as of 04:35, 19 May 2025

C++ Class hierarchy
CTFWeaponBaseMelee
CTFWeaponBase
CBaseCombatWeapon
CBaseAnimating
CBaseEntity
C++ tf_weaponbase_melee.cpp

tf_weaponbase_melee is a model 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
!activator = NPC
!caller = this entity
Fires when an NPC picks up this weapon.
OnPlayerUse
!activator = player
!caller = this entity
Fires when the player +uses this weapon.
OnPlayerPickup
!activator = player
!caller = this entity
Fires when a player picks up this weapon.
OnCacheInteraction
Fires when the player 'proves' they've found this weapon. Fires on: Player Touch, +USE pickup, Physcannon pickup, Physcannon punt.