-
-
Notifications
You must be signed in to change notification settings - Fork 6
Making a Custom Resolution
Peaches edited this page Feb 6, 2023
·
8 revisions
Alternatively, you can round up to the nearest supported resolution in your aspect ratio, health bars will just drain slightly too quick.
-
Navigate to
xhud_suffix\resolutions\make_your_own
. There, you will find the file you need to edit. -
Open
override.res
to edit. I recommend using Notepad++ or some other text editor more advanced than Notepad, but that will work.
-
Under the section "HudPlayerHealth", you will see a rather long math equation, copy the the equation right of the equals sign and paste it into Wolfram|Alpha.
Here is the equation:(182-(31/320)*(1920-WIDTH))*((16/9)/(WIDTH/HEIGHT))
-
Replace
WIDTH
andHEIGHT
with the width of your monitor resolution and the height of your monitor resolution (or the resolution you play TF2 at) then submit the equation to be solved. For example: if my monitor resolution was 2000x1125, I would edit my equation to look like:
(182-(31/320)*(1920-2000))*((16/9)/(2000/1175))
-
Copy the result and paste it into the file, between the quotations to the LEFT of the equation you copied. Continuing with the example of a resolution of 2000x1125, the result was
198
, so on the respective line in my hudplayerhealth.res file would look like:
"HealthBonusPosAdj" "198" //HealthBonusPosAdj[+/-2]=(182-(31/320)*(1920-WIDTH))*((16/9)/(WIDTH/HEIGHT))
-
Now save override.res, and launch TF2.
I recommend keeping override.res open, or keeping it easily accessible, as you'll continue editing it. - Create an offline server to test in by opening console and typing
map itemtest
. - Once in the map, join either team and select any class. I recommend soldier because he has a health value that is a nice number, but it doesn't matter.
- enter into console
sv_cheats 1
then subtract 1 from your current health (let's assume soldier) then enter into consolehurtme 199
, this will take you to 1hp. -
If your health bar is empty add 1 to the value for "HudPlayerHealth" until it no longer shows as empty, then go back 1 so the bar shows as empty at 1hp. If it shows a sliver, subtract 1 until the health bar is empty. Now if you resupply your health bar should be full.
You can usehud_reloadscheme
to avoid having to restart TF2 after every edit.
-
Under the section "HealthIcon", copy the equation right of the equals sign and paste it into Wolfram|Alpha, and fill in the value you got for "HudPlayerHealth" Continuing the example of 2000x1125 resolution, the equation would look like:
198*(151/81)
- Repeat steps 5 through 7 (6 should already be done).
- Now join red team and select any class, then once the "Waiting For Players" time ends, enter
sv_cheats 1; noclip
into console. Then fly in the direction of the bendy-hallway, through the wall, into the white-grid-patterned (dev texture) room. -
Once in the dev textured room, enter
tf_bot_add 24; mp_tournament 1
into console. Then join spectator. You should now see health bars for both teams on the left of the screen. -
You should see buffed players' health bars filled with white whenever they are fully buffed. If there is empty space, increase the value under "HealthIcon" until they are full. If they are overfilled decrease the value under "HealthIcon".
You can usehud_reloadscheme
to avoid having to restart TF2 after every edit, though buff-bars will disappear until they are reset (usually after ~30 seconds medics will cycle through their targets and reset buffs).
Do not close out of the map once figuring out this value, as you'll continue working in this file.
-
Under the section "SpectatorGUIHealth", copy the equation right of the equals sign and paste it into Wolfram|Alpha, and fill in the value you got for "HudPlayerHealth" Continuing the example of 2000x1125 resolution, the equation would look like:
198*(14/81)
- Repeat step 5 and save your file.
- Cycle through spectate targets to someone who is being buffed. It is fine if they are not being healed continuously, just as long as they reach full buff repeatedly.
-
You should see buffed player's health bars filled with blue whenever they are fully buffed. If there is empty space, increase the value under "SpectatorGUIHealth". If they are overfilled, reduce the value under "SpectatorGUIHealth".
As with previous files, you can usehud_reloadscheme
to avoid having to restart TF2 every edit.