Named Game of the Year by over 50 publications, Valve's début title blends action and adventure with award-winning technology to create a frighteningly realistic world where players must think to survive. Also includes an exciting multiplayer mode that allows you to play against friends and enemies around the world.
This tutorial will cover the Basics for changing the colour of the HUD in HL
Posted by Davik on Dec 4th, 2005
Basic Client Side Coding.
Okay - first thing is open your Compiler. Half-Life was ment to be built in Microsoft Studio 6 so either get that and open the source there, or download a compiler equalivent to Microsoft's. It can be done in 7 aswell.
[page=The First Step]
After you have your stuff opened. Open your Project files etc. goto your Client Project DLL and find the hud.h file and you should see something like so:
The reason I say like so is because this is my changed HUD that I'm using for my HELL-FIRE mod. The comments beside them were the original RGB Color values but as you can see here, the actual code itself is more of... HEX color that you would use for your site. Now, I must admit Half life's engine has some messed up color tables.
We will work with white here.
White's color in hex is #ffffff so to get the whole hud white, we edit all three sections with that colour code.
For more Hex Colors go here: Html-color-codes.com <<< good for HUDS :D Well I hope you got it, because honestly a person who isn't the greatest at C/C++ can figure out what im trying to say :P okay... Go to the last section....
[page=Second step and final step]
Okay, so you changed the primary HUD colour, but you somehow still got an orange bar inbetween your Health and Armour. To get of that just simply follow this...
Open up Health.cpp in the client project.
and goto line 227 or somewhere near there, now you should see something like this:
Okay, so this time, it uses RGB Colour Format! So what do you do? Convert your HEX colour to RGB by Photoshop or a converter on the net... GOOGLE IT! Anyways don't try the one I put there... Obviously replace the # symbols with numbers, here are some examples!
These codes simply follow the rule of...
RED, GREEN AND BLUE for each section, so the first # is a red, second is a green, and third is a blue. Save it, and save the other if you haven't and compile :D
NOW YOUR DONE! HAVE FUN CODING!