Welcome, Guest. Please login or register. Did you miss your activation email?

* TUTORIAL SECTION RULES

This section is for SMOD TUTORIALS & GUIDES ONLY.
You may create a new topic in the appropriate area to share your tutorial. If you post anything off-topic here you will be temp-banned. This is so we don't hassle the moderators too much, they are volunteers.

If you need help with a tutorial, post a reply in its thread . Do not start a new topic for help here!

Author Topic: [SMOD] Changing HUD Color/Font  (Read 7511 times)

0 Members and 1 Guest are viewing this topic.

Offline 0per4t0r

  • *
  • +1% chance to make useful post
  • 0per4t0r has no influence.
    • My Youtube
[SMOD] Changing HUD Color/Font
« on: July 21, 2011, 03:00:55 AM »
This is a tutorial on how to change the color and font of HUD elements in SMOD, it should also work with the default HL2 and some other mods to some extent, but it's not guaranteed to work perfectly.



Navigate to smod\resource\clientscheme.res and open that file with notepad.

Now, scroll down to under the base settings section, you'll see lines like "FgColor" with 4 numbers (ranging from 0-255), those are rgb codes.  1st is the amount of Red, 2nd is Green, 3rd is Blue, 4th is Alpha. Alpha is how transparent the color is, with higher values being more opaque and lower values being more transparent.

So, use a tool that allows you to pick a color, and get the RGB codes for it. (or, use this page: http://www.tayloredmktg.com/rgb)
Anything with the first 3 numbers "0 128 255" is the default smod "blue" color: , So replace the first 3 numbers of ALL lines with that value in the colors section to your custom color, keeping alpha values the same for now.

Step-by-Step Instructions
After changing all appearances of the default "smod" color to your custom color
the value for "FgColor" will be the color of text and numbers on the hud, and the color for the weapon selection boxes. screenshot

You can keep BgColor the same, as by default it's just a transparent black color, and doesn't look very good when you change it. Here's what it looks like if you change it to green: screenshot (Also, you can change the alpha (4th) value in the bgcolor line to 255 for a solid/opaque background, like in smod: outbreak.

You'll want to change BrightFg to a very bright/almost white version of your custom color, or change it to a completely different color for a neat effect on your health/battery/ammo meter when you take damage, reload, or change weapons. screenshot

The color for DamagedBg and DamagedFg are both a dark red by default (MAKE SURE both lines have the same rgb values if you change them, and keep the default alpha values) while BrightDamagedFg is a lighter red, (255 red instead of 180), so those should be fine unless you want your hud to look different when damaged. screenshot

You shouldn't need to change anything under weapon selection colors, and under that you can edit the zoom reticle color to fit your hud if you want.(the circles/aiming reticle around the crosshair visible when using suit zoom)

Under hl1-style colors, edit "yellowish" to your custom color, and edit "normal" to a slightly darker (less value) version of your custom color. "Caution" is fine where it is, unless you want the "FULL" ammo thing or the empty quickinfo brackets to be a different color.

Changing HUD Font
If you want to change which font the HUD uses, you'll need to copy the truetype (.ttf) font file that you want to use for your hud into the smod\resource folder. Then, scroll all the way to the bottom of your clientscheme.res, and add a new line for your font under "Custom font files" (make sure to use tab and not space to get the position right). Then, you can replace all occurances of "SMODGUI" with your font name (minus the .ttf), except "AmmoIcons,"which you want to keep SMODGUI. And, you probably won't want to change "ClientTitleFont," which is the font that the mod uses for the main menu text and title. Now that you've replaced all occurances except AmmoIcons, you have a problem. When you use the sprint bar, the icon shows up as a ~. To fix this, you'll need to add 2 new lines.
Under the end of Hudnumbers add this line (copy of original HudNumbers with SMODGUI font):
Code: [Select]
HudNumbers2
{
"1"
{
"name" "SMODGUI"
"tall" "24"
"weight" "0"
"antialias" "1"
"additive" "1"
"custom" "1"
}
}
And, under the end of HudNumbersOverGlow, add this (copy of original HUDNumbersOverGlow with SMODGUI font):
Code: [Select]
HudNumbersOverGlow2
{
"1"
{
"name" "SMODGUI"
"tall" "24"
"weight" "0"
"blur" "8"
"scanlines" "0"
"antialias" "1"
"additive" "1"
"custom" "1"
}
}
Then, save your edits to Clientscheme.res, and navigate to smod\scripts\HudLayout.res, and scroll down to the "HudSuitPower" line. Under HudSuitPower, change the value for "TextFont" from HudNumbers to HudNumbers2, and "TextFont2" from HudNumbersOverGlow to HudNumbersOverGlow2.
Save your changes to HudLayout , and your HUD should work properly with your new font.
Screenshot of the SMOD HUD using the "Quartz" font

Then, Launch the Game after saving your changes, and view your new HUD.
« Last Edit: July 21, 2011, 07:29:49 PM by 0per4t0r »

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: [SMOD] Changing HUD Color
« Reply #1 on: July 21, 2011, 07:01:46 AM »
Thank you for posting this. Is it possible to change the font?

Offline 0per4t0r

  • *
  • +1% chance to make useful post
  • 0per4t0r has no influence.
    • My Youtube
Re: [SMOD] Changing HUD Color
« Reply #2 on: July 21, 2011, 04:54:53 PM »
Thank you for posting this. Is it possible to change the font?
It would be possible, but the SMOD font has a few special icons that it uses for the HUD, so you'd have to change a few characters of your custom font in a font editor. For instance, the ~ character is used for the icon next to the sprint bar, and you would have to change "HudNumbers" to the SMOD font to make that icon work correctly, which would in turn change your health and suit power numbers back to SMOD's font.

There might be a way to get past this by changing some stuff in HudLayout, but I'd have to test it.

EDIT: Found a way around it, edited original post.
« Last Edit: July 21, 2011, 05:30:01 PM by 0per4t0r »

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal