Tf weapon base: 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 use of ent_info. 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_weapon_base}} This entity is used by every weapon entity in TF2 as a base for its functions fundamental to TF2 weapon entities.
{{CD|CTFWeaponBase|file1=tf_weapon_base.cpp}}
 
{{this is a|model entity|game=Team Fortress 2|name=tf_weapon_base}} This entity is used by every weapon entity in TF2 as a base entity, and they derive all weapon behavior from <code>tf_weapon_base</code>.
{{code class|CTFWeaponBase|tf_weapon_base.cpp}}
__TOC__
 
==Keyvalues==
{{KV BaseEntity|base=1}}
 
==Inputs==
{{I WeaponSpawn}}


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

Latest revision as of 04:35, 19 May 2025

C++ Class hierarchy
CTFWeaponBase
CBaseCombatWeapon
CBaseAnimating
CBaseEntity
C++ tf_weaponbase.cpp

tf_weapon_base is a model entity available in Team Fortress 2 Team Fortress 2. This entity is used by every weapon entity in TF2 as a base entity, and they derive all weapon behavior from tf_weapon_base.

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.