About " hud_color " Command Created 4 years ago2019-08-18 14:10:09 UTC by PsyWarVeteran PsyWarVeteran

Created 4 years ago2019-08-18 14:10:09 UTC by PsyWarVeteran PsyWarVeteran

Posted 4 years ago2019-08-18 14:10:09 UTC Post #343041
So, in theory, hud_color R G B should work when written to the autoexec.cfg, except it doesn't. Other codes such as impulse 101 do seem to work but hud_color only works when written to the in-game console.

Is there a workaround for this without coding, a way to trigger the code when the game starts?
Posted 4 years ago2019-08-18 14:15:50 UTC Post #343042
And binding a key to the "hud_color" order? like bind "c" hud_color whatever.... :|
Posted 4 years ago2019-08-18 14:40:51 UTC Post #343043
Even if it works that way it is not a good way to realize it. It should be activated as soon as the game starts, without the player's input.
Posted 4 years ago2019-08-18 15:10:27 UTC Post #343044
Well... I can't even get hud_color to work when I enter it in-game. I was always given the impression that hud colour is a coding change.
monster_urby monster_urbyGoldsourcerer
Posted 4 years ago2019-08-18 17:43:59 UTC Post #343045
It is a Spirit code, doesn't work with regular HL.
Posted 4 years ago2019-08-18 20:08:21 UTC Post #343046
I'm not too familiar with Half-Life programming, but I think you have to set something specific to make console commands get saved to the user config file? "hud_color" probably doesn't have this set and thus is reset every time the game is started. You should either hardcode or change the default value for hud_color in the code, or make sure it has the thing set so it gets archived.
Dr. Orange Dr. OrangeSource good.
Posted 4 years ago2019-08-19 00:43:05 UTC Post #343048
Precisely, that'd be FCVAR_ARCHIVE.
If the hud_color console variable doesn't have that flag enabled, it won't get saved. So, we'd have to look at the SOHL source code then. Think of hud.cpp or any place like that.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 4 years ago2019-08-20 22:16:37 UTC Post #343054
I tried coding, whatever I do, I can't get it to compile.
Posted 4 years ago2019-08-21 07:51:42 UTC Post #343055
In hud.h

#define RGB_WHITEISH 0x00FFFFFF//255,255,255

in ammo.cpp

UnpackRGB(r,g,b,RGB_WHITEISH);

over the line...

ScaleColors(r, g, b, a );

in battery.cpp over the line...

if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) ))
return 1;

I put the same and worked. :)
Posted 4 years ago2019-08-21 10:32:07 UTC Post #343056
"I tried coding, whatever I do, I can't get it to compile."
Which exact source code were you compiling, and what compiler did you use? Chances are, you used Visual Studio 2017's toolset on something that can't compile on anything after Visual Studio 6.0 from 1998. Or even something totally different, like Dev-C++ or Code::Blocks.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 4 years ago2019-08-24 00:29:49 UTC Post #343080
Visual Studio 2015 I think, deleted it three days ago.
You must be logged in to post a response.