Go Back   Steam Users' Forums > Steam Game Discussions > T - Z > Team Fortress 2 > Classes and Balance Discussion > Spy

Reply
 
Thread Tools Display Modes
Old 07-16-2012, 01:41 PM   #1
2C3C
 
 
 
Join Date: May 2011
Reputation: 517
Posts: 2,240
Arrow Heads up, Gentlemen

I figure it's about time we get a HUD thread running. Think of this thread as a mirrored version of this.

Before we get into it, I feel a distinction needs to be made between scripts and HUDs, as a lot of people don't quite understand it.

  • Scripts affect key binds and are limited to console commands. They use .cfg files located in tf\cfg.
  • HUD affects everything on your screen that only you can see (health, ammo, cloak, damage indicators, etc). A rule of thumb is that if it doesn't show up in a replay, it's a HUD element. They use a set of commands independent of console commands. You edit HUD in .res files in your scripts and resource folders.

HUD and scripts are independent from each other. HUD is unaffected by console commands and scripts are unaffected by HUD commands; likewise, .cfg files and .res files don't mix at all. The only exception to this is the default cross hair which is edited via console commands (cl_crosshair_scale, cl_crosshfair_file, etc). I suspect this is for convenience more than anything.

This is something of a perpetual work in progress. Feel free to contribute and correct. Check back for updates. I know people have been waiting for a "Spy HUD" of sorts, this is somewhat of a beginning.

As a final note, all of the following are legal under any conditions where a custom HUD is allowed (everywhere). Don't stress about it.


*IMPORTANT* After updates, you may have to reinstall your HUD. If you do not back up your modified .res files, you will have to start from scratch which isn't fun for anybody. Please back up everything.


*STEAM PIPE UPDATE* Steam Pipe streamlined a lot of stuff with TF2, but it also switched up where the HUD files go. They moved from Steam\steamapps\<account name>\team fortress 2\tf to Steam\steamapps\common\Team Fortress 2\tf\custom\hud. Note that the last folder in this directory can be called anything, but for the sake of simplicity, we will call it hud. I will try to change all the directories to match this update, but let me know if I miss any.

Also, a note from J_A_G. Apparently, if you only want to edit one file, you will only have to put one modified file into your hud folder, instead of an entire HUD alongside it.

*CHARACTER RESTRICTION* SPUF posts have a 20,000 character limit that I am constantly avoiding. Due to this I will be attempting to convert as many of the mods as possible to links. If you can't find what you're looking for, make sure you looked at all the links.


  • Smaller damage indicators
    When using the Ambassador, it's not uncommon for the damage numbers from one shot to impede your vision on the next shot. This will get those numbers out of the way, make them smaller, and decrease their duration. Paste this inside tf\custom\hud\resource\ui\HudDamageAccount.res.
    Examples: 1 2 3


    Code:
    	"CDamageAccountPanel"
    	{
    		"fieldName"		"CDamageAccountPanel"
    		"xpos"			"0"                    //Left-right orientation, no need to mess with this
    		"ypos"			"c-260"                //Up-down orientation, change as needed
    		"delta_item_end_y"	"0"
    		"PositiveColor"		"0 255 0 255"          //Color of heal numbers
    		"NegativeColor"		"255 255 0 255"        //Color of damage numbers
    		"delta_lifetime"	"1.8"                  //Duration
    		"delta_item_font"	"HudFontSmall"         //Font
    		"delta_item_font_big"	"HudFontSmall"
    		"visible"		"1"
    		"visible_minmode"	"1"
    	}

  • Smaller disguise outline
    If you haven't noticed, the disguise outline takes up the majority of the screen. I recommend against getting rid of it entirely, since certain points in the animation refer to important game events: when the outline is the biggest, you are disguised; when the outline disappears, the smoke has disappeared. This moves the outline out of the way and makes it smaller. You might have manually adjust numbers to best fit in to your hud. This is pasted into tf\custom\hud\scripts\HudAnimations_tf.txt (you'll have to paste over existing code). Further instructions are commented off.
    Examples: 1 2


    Code:
    //HudSpyDisguiseChanged refers to the outline being at its largest point
    //HudSpyDisguiseHide refers to it at its smallest point
    //Alpha changes opacity of the outline
    //Position changes position. Feel free to remove the c, but your numbers will be wildly different.
    //Size changes size.
    //Remember to paste over the already existing commands (and back them up!)
    
    event HudSpyDisguiseChanged
    {
    	Animate PlayerStatusSpyOutlineImage		Alpha		"255"		Linear 0.0 0.2
    	
    	Animate PlayerStatusSpyOutlineImage		Position	"c-100 c50"	Linear 0.0 0.2
    	Animate PlayerStatusSpyOutlineImage		Size		"150 150"	Linear 0.0 0.2
    	
    	RunEvent HudSpyDisguiseHide	0.7
    }
    
    event HudSpyDisguiseHide
    {
    	Animate PlayerStatusSpyOutlineImage		Position	"c-50 c105"	Linear 0.0 0.2
    	Animate PlayerStatusSpyOutlineImage		Size		"55 55"		Linear 0.0 0.2
    	
    	Animate PlayerStatusSpyOutlineImage		Alpha		"0"		Linear 0.2 0.1
    }

  • Small disguise weapon font r_a_k
    Sometimes strange weapons have such long names that you can't tell which weapon your disguise is holding. You can make the font smaller or make it longer to fix this problem. You'll need to edit tf\ui\DisguiseStatusPanel.res. Don't copy and paste this, just make changes to the variables listed below. Thanks to r_a_k.

    Edit the following in tf\ui\DisguiseStatusPanel.res:
    Code:
    	"WeaponNameLabel"
    	{	
    		...
    		"font"				"TFFontSmall"  //this font seems to be of reasonable size, but feel free to try other fonts in ClientScheme.res
    		...
    		
    		...
    		"wide"				"150"           //this value may change based on your set-up
    		...
    	}

  • Large Ubercharge font r_a_k
    This will make the Ubercharge typeface when mousing over Medics more noticeable. You'll need to edit tf\ui\TargetID.res. Don't copy and paste this, just make changes to the variables listed below. Thanks to r_a_k.

    Edit the following in tf\ui\TargetID.res:
    Code:
    	"TargetDataLabel"
    	{	
    		"ControlName"		        "CExLabel"           //only change this if you're changing the fgcolor
    		...
    		
    		...
    		"font"				"TFFontMediumBold"
    		...
    		
    		...
    		"wide"				"280"
    		...
    		
    		...
    		"fgcolor"			"240 240 30 255"     //adjust this as desired
    	}

  • HUD cross hairs
    HUD cross hairs come with a few advantages. First of all, they're totally customizable (within the limitations of HUD commands). You can build them with specific opacities, colors, animations, whatever. Secondly, they don't expand when you shoot your Ambassador so you don't have to account for that. I highly recommend them. To keep everything simple, paste any of these into tf\custom\hud\scripts\hudlayout.res. If you want to make a cross hair, make it relative to this file, unless there is some specific reason for doing otherwise (health pulse, for example).

    If you install one of these, you have disable your default cross hair by typing "cl_crosshair_scale 0" into console and remove any instances of "cl_crosshair_scale" from your scripts.

    Large and visible + cross hair 2C3C
    The + is meant to help aiming while not impeding on other HUD elements. The center cross hair is bi-colored so it should be visible on any background without the need for animation.
    Examples: 1 2 3


    Bi-color + cross hair
    Ammo modification Just_A_Gamer

  • Animation
    These guys tend to be far more complicated since you have to both define it normally, then animate it (which could potentially conflict with other things). Use these at your own risk (and please back them up, for reals).

    Visual hit indicator: squares 2C3C
    Whenever you do damage to an enemy player, four red squares will surround your cross hair for .95 seconds to match the Amby cooldown (you can make this 1.25 for Revolver cooldown). You may have to tweak position, as this has been designed for my + cross hair above. You'll have to put code into tf\custom\hud\scripts\hudlayout.res and tf\custom\hud\scripts\HudAnimations_tf.txt.
    Examples: 1 2


    Timing modification r_a_k

    Put this into tf\custom\hud\scripts\hudlayout.res:
    Code:
    	HitMarker1
    	{
    		"ControlName"	        "ImagePanel"
    		"fieldName"		"HitMarker1"
    		"xpos"			"c-6"
    		"ypos"			"c-6"
    		"zpos"			"0"
    		"wide"			"3"
    		"tall"			"3"
    		"autoResize"	        "0"
    		"pinCorner"		"0"
    		"visible"		"1"
    		"enabled"		"1"
    		"fillcolor"		"255 50 50 255"
    		"alpha" "0"
    	}
    	HitMarker2
    	{
    		"ControlName"	        "ImagePanel"
    		"fieldName"		"HitMarker2"
    		"xpos"			"c4"
    		"ypos"			"c4"
    		"zpos"			"0"
    		"wide"			"3"
    		"tall"			"3"
    		"autoResize"	        "0"
    		"pinCorner"		"0"
    		"visible"		"1"
    		"enabled"		"1"
    		"fillcolor"		"255 50 50 255"
    		"alpha" "0"
    	}
    	HitMarker3
    	{
    		"ControlName"	        "ImagePanel"
    		"fieldName"		"HitMarker3"
    		"xpos"			"c-6"
    		"ypos"			"c4"
    		"zpos"			"0"
    		"wide"			"3"
    		"tall"			"3"
    		"autoResize"	        "0"
    		"pinCorner"		"0"
    		"visible"		"1"
    		"enabled"		"1"
    		"fillcolor"		"255 50 50 255"
    		"alpha" "0"
    	}
    	HitMarker4
    	{
    		"ControlName"	        "ImagePanel"
    		"fieldName"		"HitMarker4"
    		"xpos"			"c4"
    		"ypos"			"c-6"
    		"zpos"			"0"
    		"wide"			"3"
    		"tall"			"3"
    		"autoResize"	        "0"
    		"pinCorner"		"0"
    		"visible"		"1"
    		"enabled"		"1"
    		"fillcolor"		"255 50 50 255"
    		"alpha" "0"
    	}
    Put this into tf\custom\hud\scripts\HudAnimations_tf.txt:

    Code:
    event DamagedPlayer
    {
    	RunEvent xHairHit 0.0
    }
    
    event xHairHit
    {
    	Animate HitMarker1 Alpha "200" Linear 0.0 0.0
    	Animate HitMarker2 Alpha "200" Linear 0.0 0.0
    	Animate HitMarker3 Alpha "200" Linear 0.0 0.0
    	Animate HitMarker4 Alpha "200" Linear 0.0 0.0
    	Animate HitMarker1 Alpha "0" Linear 0.95 0.0
    	Animate HitMarker2 Alpha "0" Linear 0.95 0.0
    	Animate HitMarker3 Alpha "0" Linear 0.95 0.0
    	Animate HitMarker4 Alpha "0" Linear 0.95 0.0
    	
    	RunEvent xHairHit2 0.95
    }
    *Note* If you already have a DamagedPlayer{} with another event inside of it, you'll need to integrate the two. Just put "RunEvent xHairHit 0.0" into the existing one.


    Centered damage indicators
    Just_A_Gamer
    This creates another instance of DamageAccountValue, makes it smaller and positions in in the center of the screen, then animates the alpha to 0 after a moment. The effect is similar to the standard hit indicators, but it's a fixed position on your screen. You'll have to edit tf\custom\hud\resource\ui\HudDamageAccount.res and tf\custom\hud\scripts\HudAnimations_tf.txt. Thanks to Just_A_Gamer for the concept.
    Examples: 1 2 3

    Put this into tf\custom\hud\resource\ui\HudDamageAccount.res:
    Code:
    	"DamageAccountValue2"
    	{
    		"ControlName"	        "CExLabel"
    		"fieldName"		"DamageAccountValue2"
    		"xpos"			"c-50"		//adjust this as needed
    		"ypos"			"c40"		//adjust this as needed
    		"zpos"			"2"
    		"wide"			"100"
    		"tall"			"26"
    		"visible"		"1"
    		"visihble_minmode"	"0"
    		"enabled"		"1"
    		"labelText"		"%metal%"
    		"textAlignment"	        "center"
    		"fgcolor"		"255 255 50 255"	//change the color as needed
    		"font"			"HudFontSmallBold"
    		"alpha"			"0"
    	}
    
    	//Use this if you want a shadow
    	"DamageAccountValueBG2"
    	{
    		"ControlName"	        "CExLabel"
    		"fieldName"		"DamageAccountValueBG2"
    		"xpos"			"c-49"		//this value should be equal to the xpos above plus 1
    		"ypos"			"c41"		//this value should be equal to the ypos above plus 1
    		"zpos"			"1"
    		"wide"			"100"
    		"tall"			"26"
    		"visible"		"1"
    		"visible_minmode"	"0"
    		"enabled"		"1"
    		"labelText"		"%metal%"
    		"textAlignment"	        "center"
    		"fgcolor"		"0 0 0 255"
    		"font"			"HudFontSmallBold"
    		"alpha"			"0"
    	}
    Put this into tf\custom\hud\scripts\HudAnimations_tf.txt:
    Code:
    event DamagedPlayer
    {
    	RunEvent DamageAccountHide 0.0
    } 
    
    event DamageAccountHide
    {
    	Animate DamageAccountValue2 Alpha "255" Linear 0.001 0.0
    	Animate DamageAccountValueBG2 Alpha "255" Linear 0.001 0.0
    	Animate DamageAccountValue2 Alpha "0" Linear 0.95 0.0      //change .95 to desired fade time
    	Animate DamageAccountValueBG2 Alpha "0" Linear 0.95 0.0    //change .95 to desired fade time
    }

    *Note* If you already have a DamagedPlayer{} with another event inside of it, you'll need to integrate the two. Just put "RunEvent DamageAccountHide 0.0" into the existing one.
  • Premade HUDs

Last edited by 2C3C: 07-17-2013 at 01:25 PM.
2C3C is offline  
Reply With Quote
Old 07-16-2012, 01:48 PM   #2
Hurp Durp
 
Join Date: Jul 2010
Reputation: 6
Posts: 19
The reason why many HUD crosshairs are in HudPlayerHealth.res is because you can animate them to change colors depending on your health. You cannot do this if it's anywhere else.
Hurp Durp is offline   Reply With Quote
Old 07-16-2012, 01:50 PM   #3
2C3C
 
 
 
Join Date: May 2011
Reputation: 517
Posts: 2,240
Quote:
Originally Posted by Hurp Durp View Post
The reason why many HUD crosshairs are in HudPlayerHealth.res is because you can animate them to change colors depending on your health. You cannot do this if it's anywhere else.
That's simply incorrect. The location of the cross hair is irrelevant: as long as it is defined, you can animate it to change based on health in HudAnimations_tf.txt. Creating a cross hair with HudPlayerHealth.res simply makes it harder to position correctly.

Long overdue update (7/17/13): Hurp Durp was entirely correct here. I apparently had forgotten to remove a bit of code, so it appeared as though I had found a workaround. If you want an element to be modified by health values, you're going to need to put it directly into HudPlayerHealth.res (at least since I last checked).

Last edited by 2C3C: 07-17-2013 at 12:57 PM.
2C3C is offline   Reply With Quote
Old 07-16-2012, 02:43 PM   #4
Hadahap
 
Join Date: Dec 2011
Reputation: 10
Posts: 127
Crosshair's nice, thanks.
Hadahap is offline   Reply With Quote
Old 07-16-2012, 03:15 PM   #5
BrightKnight141
 
 
 
Join Date: May 2012
Reputation: 16
Posts: 510
How do you open .res files?
BrightKnight141 is offline   Reply With Quote
Old 07-16-2012, 03:16 PM   #6
Hurp Durp
 
Join Date: Jul 2010
Reputation: 6
Posts: 19
Quote:
Originally Posted by 2C3C View Post
That's simply incorrect. The location of the cross hair is irrelevant: as long as it is defined, you can animate it to change based on health in HudAnimations_tf.txt. Creating a cross hair with HudPlayerHealth.res simply makes it harder to position correctly.
I've just tried this and it did not work. Putting the crosshair in the HudPlayerHealth.res file appears to be the only way to allow it to be changed based on health.
Hurp Durp is offline   Reply With Quote
Old 07-16-2012, 03:55 PM   #7
ParanoidDrone
 
 
 
Join Date: Nov 2008
Reputation: 322
Posts: 3,086
I can get in on this. Dropbox link.

My HUD is more or less vanilla -- I haven't found a prefab HUD I like enough to switch to, and I don't have the patience to muck around with the .res files forever. So I kept it simple. Despite this, I've gotten a few requests in the past for a copy...not sure why.

-When viewing other players' HP, the exact value is visible beside the health cross.
-Kill feed maxes out at 8 notifications instead of 4, and are spaced slightly closer together.
-Damage text is yellow and healing text is green. Both use the TF2 Build font.

One thing I did notice is that sometimes after updating, hudlayout.res will vanish, requiring me to place another copy in the file system. This is the file responsible for the modified kill feed. I'm not sure why this happens.
ParanoidDrone is offline   Reply With Quote
Old 07-16-2012, 04:41 PM   #8
Ready_Set_Chaos
 
 
 
Join Date: Oct 2011
Reputation: 280
Posts: 1,561
The Heads Up Gentlemen HUD, aka;


HUG
Ready_Set_Chaos is offline   Reply With Quote
Old 07-16-2012, 04:47 PM   #9
Just_A_Gamer
 
 
 
Join Date: Jun 2011
Reputation: 80
Posts: 203
Good idea 2C, thanks for making this (You must spread rep around before giving to 2C3C again...damn it. ). I've been running with no spy-outline appearing while re-disguising, I'll have to give your smaller one a whirl.

Does anyone have a HUD (or the necessary code) that draws the damage done under the crosshair? Garm3nHud used to have this, but it was removed because it was causing a massive fps drop, and most huds tend to actually draw the value waayyyy down there in the lower left corner near the health.

Last edited by Just_A_Gamer: 07-16-2012 at 04:50 PM.
Just_A_Gamer is offline   Reply With Quote
Old 07-16-2012, 04:59 PM   #10
2C3C
 
 
 
Join Date: May 2011
Reputation: 517
Posts: 2,240
Quote:
Originally Posted by Hurp Durp View Post
I've just tried this and it did not work. Putting the crosshair in the HudPlayerHealth.res file appears to be the only way to allow it to be changed based on health.
Checked it out and you are correct. However, it's easily circumvented by creating a custom event and tying it into event HudHealthBonusPulseLoop, so my stance is unchanged.

Quote:
Originally Posted by ParanoidDrone View Post
I can get in on this. Dropbox link.

My HUD is more or less vanilla -- I haven't found a prefab HUD I like enough to switch to, and I don't have the patience to muck around with the .res files forever. So I kept it simple. Despite this, I've gotten a few requests in the past for a copy...not sure why.

-When viewing other players' HP, the exact value is visible beside the health cross.
-Kill feed maxes out at 8 notifications instead of 4, and are spaced slightly closer together.
-Damage text is yellow and healing text is green. Both use the TF2 Build font.

One thing I did notice is that sometimes after updating, hudlayout.res will vanish, requiring me to place another copy in the file system. This is the file responsible for the modified kill feed. I'm not sure why this happens.
I'll get it into OP, along with anybody else's custom HUDs.

Quote:
Originally Posted by Ready_Set_Chaos View Post
The Heads Up Gentlemen HUD, aka;


HUG
Legit
2C3C is offline   Reply With Quote
Old 07-16-2012, 05:13 PM   #11
Volla
 
Join Date: Jul 2010
Reputation: 371
Posts: 2,499
Dont you mean...HUDs up, gentlemen..eh? eh?...no?...Fine then...
Volla is offline   Reply With Quote
Old 07-16-2012, 05:17 PM   #12
2C3C
 
 
 
Join Date: May 2011
Reputation: 517
Posts: 2,240
Quote:
Originally Posted by BrightKnight141 View Post
How do you open .res files?
Notepad, Notepad++, or any other basic text editing program.
2C3C is offline   Reply With Quote
Old 07-16-2012, 05:23 PM   #13
2C3C
 
 
 
Join Date: May 2011
Reputation: 517
Posts: 2,240
Quote:
Originally Posted by Just_A_Gamer View Post
Good idea 2C, thanks for making this (You must spread rep around before giving to 2C3C again...damn it. ). I've been running with no spy-outline appearing while re-disguising, I'll have to give your smaller one a whirl.

Does anyone have a HUD (or the necessary code) that draws the damage done under the crosshair? Garm3nHud used to have this, but it was removed because it was causing a massive fps drop, and most huds tend to actually draw the value waayyyy down there in the lower left corner near the health.
If you go into tf\resource\ui\HudDamageAccount.res, you can tweak the xpos and ypos on DamageAccountValue and DamageAccountValueBG to be where you want it. I'd also recommend changing the alignment to centered, but that's personal preference.

Quote:
Originally Posted by Volla View Post
Dont you mean...HUDs up, gentlemen..eh? eh?...no?...Fine then...
golfclap
2C3C is offline   Reply With Quote
Old 07-16-2012, 05:30 PM   #14
RNGgod
 
Join Date: Jan 2010
Reputation: 230
Posts: 1,220
Quote:
Originally Posted by Volla View Post
Dont you mean...HUDs up, gentlemen..eh? eh?...no?...Fine then...
HUDUG

Love it.
RNGgod is offline   Reply With Quote
Old 07-16-2012, 06:22 PM   #15
Just_A_Gamer
 
 
 
Join Date: Jun 2011
Reputation: 80
Posts: 203
Quote:
Originally Posted by 2C3C View Post
If you go into tf\resource\ui\HudDamageAccount.res, you can tweak the xpos and ypos on DamageAccountValue and DamageAccountValueBG to be where you want it. I'd also recommend changing the alignment to centered, but that's personal preference.

Yeah, I got that part, I'm struggling on finding a way to make it disappear after a certain amount of time though. Changing the value for delta_lifetime doesn't have any effect, and I reallllly don't need to have it sitting there even when I'm in combat. :/

EDIT: I figured it out. Basically, I added an animation to it for event DamagedPlayer in HudAnimations_tf.txt

Basically, it looks like this:
Quote:
event DamagedPlayer
{
Animate DamageAccountValue FgColor "0 255 0 255" Linear 0.0 0.00001
Animate DamageAccountValue FgColor "0 0 0 0" Linear 0.70 0.00001
}
and DamageAccountValue looks like this

Quote:
"DamageAccountValue"
{
"ControlName" "CExLabel"
"fieldName" "DamageAccountValue"
"xpos" "c-32"
"ypos" "c30"
"zpos" "0"
"wide" "62"
"tall" "33"
"visible" "1"
"enabled" "1"
"labelText" "%metal%"
"delta_lifetime" "10.0"
"textAlignment" "center"
"fgcolor" "Garm3nHUDRealGreen"
"font" "HudFontGarm3nSmallOutline"
}
Obviously, you'd have to change the fgcolor/font (and probably the sizes too, at that point) if you wanted to use it with something that isn't Garm3nHud.

Looks like this for 7/10 of a second, then goes away.

Last edited by Just_A_Gamer: 08-05-2012 at 04:31 PM.
Just_A_Gamer is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Game Discussions > T - Z > Team Fortress 2 > Classes and Balance Discussion > Spy


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -7. The time now is 07:06 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2014, All Rights Reserved.