TFConds - Unused/Unclear Conditions, Finally Explained

TF2CutContent

Banned
Nov 26, 2010
59
82
This was cross-posted from the Alliedmodders forums where I first posted it. I still haven't added code snippet sources for some entries, but since I've posted it here as well, I should probably get on that and source everything that isn't sourced.

In the process of working on the TCRF.net Team Fortress 2 article to document cut content, I happened to go through all the TFConds and figured out what some of the more unknown conditions actually did. For the longest time, these more unknown conditions' descriptions was that they were unused or didn't appear to do anything, but I've managed to clear a few things up.


1. TF_COND_TMPDAMAGEBONUS
Supposed to be a temporary damage buff but it does nothing. In the 2017 source code leak, the only time the AddTmpDamageBonus function (which is specifically for this condition) is called in the entire engine is commented out, making this condition entirely deprecated. It was meant to be for a weapon attribute that got cut, addperc_ondmgdone_tmpbuff

The condition being deprecated makes it perfect for using as your own custom tracking condition in a SourceMod plugin, since adding it to a player does nothing. It's entirely harmless. There could be some really technical use for this in a plugin, for example if you wanted to track the time between two events maybe? What do I mean by "tracking condition", you might be wondering? I'll explain that in the next entry.
Source: game/shared/tf/tf_weaponbase.cpp#L4967-#L4976


2. TF_COND_BLASTJUMPING
This is what I am going to call a "tracking condition" from now on. What that means is, it is applied to the player at one point, and removed at another point, but is used by the engine elsewhere in other various logic checks. In the case of this blast jumping condition, it was noted before that it doesn't do anything. True in a sense, but you probably shouldn't mess with this condition all willy-nilly just in case.

When you perform a rocket jump or a sticky jump and those actions' respective Events are fired (rocket_jump, sticky_jump), the condition is applied to you. When you land and those actions' respective Events are fired (rocket_jump_landed, sticky_jump_landed), the condition is removed. The game uses the condition elsewhere, such as logic checks for certain attributes, to determine whether or not you are currently in mid-blastjump.
Source: game/server/tf/tf_player.cpp#L8394-#L8434


3 & 4. TF_COND_COMPETITIVE_WINNER & LOSER
Same situation as the blast jumping condition. They are both tracking conditions used by the game to assist in logic for the end-of-match Competitive screen, according to the code leak. No linkage to code snippets for this entry showing where they're used, I forgot to. I'll edit it in later.


5. TF_COND_GRAPPLED_BY_PLAYER
Another tracking condition, but this time for grappling hook targetting logic.
Source: game/server/tf/tf_player.cpp#L1009-#L1083


6. TF_COND_HEALTH_OVERHEALED
Very mysterious condition initially. This condition is added to a player who is hit and subsequently healed by a bolt from a Crusader's Crossbow from their team's Medic. The condition is used by the C_TFPlayer::UpdateOverhealEffect function. If the player has this condition, the function checks whether they are overhealed or not, and applies the proper effects if they are not/cancels them if they are. It's basically a tracking condition.
Source: game/client/tf/c_tf_player.cpp#L10356-#L10394


7. TF_COND_MEDIGUN_DEBUFF
Appears to be entirely unused. Doing a text crawl for the internal name in the source code returns no results except for tf_shareddefs.cpp and tf_shareddefs.h, where it is in the ETFCond enumerator with all the other condition flags. Could be repurposed into a second personal tracking condition for plugins since it's also useless like that TMPDAMAGEBONUS cond.
Source: game/shared/tf/tf_shareddefs.cpp#L360
Source: game/shared/tf/tf_shareddefs.h#L762


8. TF_COND_MINICRITBOOSTED_ON_KILL
Same situation as the previous entry. Only appears listed in the ETFCond enumerator and never appears in the code anywhere else. So let's make that three useless conditions that you can repurpose for whatever you want.
Source: game/shared/tf/tf_shareddefs.cpp#L373
Source: game/shared/tf/tf_shareddefs.h#L775


Full list of conds with functionality descriptions available at Team Fortress 2, Debug Commands - addcond @ TCRF.net

I should note that I also intend to rummage through the source code leak and trace down exact functionalities of every TFCond in the game so I can write up technical documentation of how every TFCond works. Right now, the list of conds on the TCRF article has mostly complete descriptions of how each condition functions although most are very vague.
 
Last edited: