Tf dropped weapon: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Stylized the "convars" section to be same as env_fire; Omit "Category:Entities" as templates apply it already; "|base=1" param for "KV"/"I" templates (Yes Template:I_BaseAnimating doesn't support params yet, ill add it to my trello todo list))
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified)
 
(8 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{tf2 point|tf_dropped_weapon}} This entity is used for dropped weapons and will store its weapon information from the player held weapon.  
{{CD|CTFDroppedWeapon|file1=tf_dropped_weapon.cpp}}
{{this is a|model entity|name=tf_dropped_weapon|game=Team Fortress 2}} This entity is used for dropped weapons and will store its weapon information from the player held weapon.  


Players can perform a pickup option by performing <code>+use_action_slot_item</code> while looking at this entity, and take the dropped weapon to be used as a player weapon. If the dropped weapon is a medigun then its charge will either slowly drop to 0% or, if the player suicided, set to 0%.
Players can perform a pickup option by performing<code style="color:#E5E5E5;">+use_action_slot_item</code>while looking at this entity, and take the dropped weapon to be used as a player weapon. If the dropped weapon is a medigun then its charge will either slowly drop to 0% or, if the player suicided, set to 0%.
{{note|Upon picking up a dropped weapon, the original held weapon will not be returned.}}
{{note|Upon picking up a dropped weapon, the original held weapon will not be returned.}}
{{bug|Spawning this entity through <code>ent_create</code> will crash the game if the model KV is set, but not the actual item object.}}
{{bug|hidetested=1|Spawning this entity through {{code|ent_create}} will crash the game if the model KV is set, but not the actual item object.}}
{{code class|CTFDroppedWeapon|tf_dropped_weapon.cpp}}


==ConVars/Commands==
==ConVars/Commands==
Line 10: Line 10:
{{varcom|tf_dropped_weapon|30|Arbitrary number ([[float]])|Sets the lifetime of<code>tf_dropped_weapon</code>entities.}}
{{varcom|tf_dropped_weapon|30|Arbitrary number ([[float]])|Sets the lifetime of<code>tf_dropped_weapon</code>entities.}}
{{varcom|end}}
{{varcom|end}}
==Keyvalues==
{{KV BaseAnimating|base=1}}
{{KV BaseEntity|base=1}}


==Inputs==
==Inputs==
{{I TFTeam}}
{{I TFTeam}}
{{I BaseAnimating|base=1}}
{{I BaseEntity|base=1}}
==Outputs==
{{O BaseAnimating}}
{{O BaseEntity}}

Latest revision as of 07:18, 20 May 2025

C++ Class hierarchy
CTFDroppedWeapon
CBaseAnimating
CBaseEntity
C++ tf_dropped_weapon.cpp

tf_dropped_weapon is a model entity available in Team Fortress 2 Team Fortress 2. This entity is used for dropped weapons and will store its weapon information from the player held weapon.

Players can perform a pickup option by performing+use_action_slot_itemwhile looking at this entity, and take the dropped weapon to be used as a player weapon. If the dropped weapon is a medigun then its charge will either slowly drop to 0% or, if the player suicided, set to 0%.

Note.pngNote:Upon picking up a dropped weapon, the original held weapon will not be returned.
Icon-Bug.pngBug:Spawning this entity through ent_create will crash the game if the model KV is set, but not the actual item object.

ConVars/Commands

Cvar/Command Parameters or default value Descriptor Effect
tf_dropped_weapon 30 Arbitrary number (float) Sets the lifetime oftf_dropped_weaponentities.

Inputs

SetTeam <integerRedirectInput/integer>
Changes the entity's team.