x
ETF2L is looking for new Staff to recruit! Are you interested in supporting the league? Then click here for more details on what we can offer and how to apply! 

Forum

A hud related question?

Created 23rd March 2011 @ 22:25

Add A Reply Pages: 1

Stranger

2stronk

So i’m using this nice built in hud crosshair, made by garm3n.

I was thinking would it be possible to transfer hp cross in to a color changing crosshair, that changes color depending on your hp (sort of like one of the options in quakelive)?

If that is possible i might have a very awesome idea for a hud


Last edited by Stranger,

ell

(ETF2L Donator)

Yes, it’s possible, at least in 3 discrete steps.


Last edited by ell,

Stranger

2stronk

Quoted from ell

Yes, it’s possible.

hmmm. Also can you keep the actual hp numbers somewhere?

oh and one other question can you completely separate ammo in clip from ammo in reserve?


Last edited by Stranger,

ell

(ETF2L Donator)

Quoted from Stranger

[…]

hmmm. Also can you keep the actual hp numbers somewhere?

oh and one other question can you completely separate ammo in clip from ammo in reserve?

You can have a usual health cross/bar with health value digits in combination with a colour changing crosshair. As for the ammo, not sure what you mean by separate completely, you can move them around independently.


Last edited by ell,

Stranger

2stronk

Quoted from ell

[…]

You can have a usual health cross/bar with health value digits in combination with a colour changing crosshair. As for the ammo, not sure what you mean by separate completely, you can move them around independently.

how can you do those 2? (i have the basic knowledge of what is what and how to edit stuff in hud)

Stranger

2stronk

http://img33.imageshack.us/i/2011032400001.jpg/ <- a basic idea on how it should look like

Bonkers

maybe you should ask war? he had a crosshair that change colour when it went over the enemy or when you’d hit them, idk but i remember seeing it in his video

ell

(ETF2L Donator)

Quoted from Stranger

[…]

how can you do those 2? (i have the basic knowledge of what is what and how to edit stuff in hud)

http://pastebin.com/raw.php?i=pmmYSB7m

Crosshair: In tfresourceuiHudPlayerHealth.res, expand the size to contain the crosshair and put something like this in there:

“YAxis”
{
“ControlName” “ImagePanel”
“fieldName” “YAxis”
“xpos” “c-1”
“ypos” “c-5”
“zpos” “2”
“wide” “2”
“tall” “10”
“visible” “1”
“enabled” “1”
“fillcolor” “SqGreen”
}
“XAxis”
{
“ControlName” “ImagePanel”
“fieldName” “XAxis”
“xpos” “c-5”
“ypos” “c-1”
“zpos” “1”
“wide” “10”
“tall” “2”
“visible” “1”
“enabled” “1”
“fillcolor” “SqGreen”
}

Alternately you can use a CTFLabel like this:

“Crosshair”
{
“ControlName” “CTFLabel”
“fieldName” “Crosshair”
“xpos” “-15”
“ypos” “-15”
“zpos” “3”
“wide” “60”
“tall” “60”
“visible” “1”
“enabled” “1”
“labelText” “+”
“textAlignment” “West”
“font” “SqSquare”
“fgcolor” “SqGrey”
}

In tfscriptsHudAnimations_tf.txt, edit this section to make it animate. There are instructions at the top of the file.

//===========================================

//health bonus pulse
event hudhealthbonuspulse
{
animate healthsquare1 fgcolor SqGreen linear 0.0 0.0
animate healthsquare2 fgcolor SqGreen linear 0.0 0.0
animate healthvalue fgcolor SqWhite linear 0.0 0.0
runevent hudhealthbonuspulseloop 1
}

// call to loop hudhealthbonuspulse
event hudhealthbonuspulseloop
{
RunEvent hudhealthbonuspulse 0.0
}

event hudhealthbonuspulsestop
{
stopevent hudhealthbonuspulse 0.0
stopevent hudhealthbonuspulseloop 0.0
animate healthsquare1 fgcolor sqGrey linear 0.0 0.0
animate healthsquare2 fgcolor sqGrey linear 0.0 0.0
animate healthvalue fgcolor sqCyan linear 0.0 0.0
}

//===========================================

//health dying pulse
event hudhealthdyingpulse
{
animate healthsquare1 fgcolor SqPink linear 0.0 0.0
animate healthsquare2 fgcolor SqPink linear 0.0 0.0
animate healthvalue fgcolor SqWhite linear 0.0 0.0
runevent hudhealthdyingpulseloop 0.4
}

// call to loop hudhealthdyingpulse
event hudhealthdyingpulseloop
{
runevent hudhealthdyingpulse 0.0
}

event hudhealthdyingpulsestop
{
stopevent hudhealthdyingpulse 0.0
stopevent hudhealthdyingpulseloop 0.0
animate healthsquare1 fgcolor SqGrey linear 0.0 0.0
animate healthsquare2 fgcolor SqGrey linear 0.0 0.0
animate healthvalue fgcolor SqCyan linear 0.0 0.0
}

//===========================================


Last edited by ell,

Stranger

2stronk

Quoted from Bonkers

maybe you should ask war? he had a crosshair that change colour when it went over the enemy or when you’d hit them, idk but i remember seeing it in his video

I think his crosshair changed randomly every 2 seconds or so

CanFo

(Legend)
[HA]
#T4F

Quoted from Bonkers

maybe you should ask war? he had a crosshair that change colour when it went over the enemy or when you’d hit them, idk but i remember seeing it in his video

Iirc, WAR’s crosshair changed everytime he moved (= pressed WASD) and was no hud crosshair.

ell

(ETF2L Donator)

There is a possibility that the game wont allow you to animate anything but health value digits. That makes things a bit more tricky, but not impossible. In this case the only option I can see is making a custom font with all digits replaced with crosshairs and mask out all but the leftmost. I can’t quite recall why, but I used a custom font with just squares and no spaces for the health square in my hud. I suspect that I chose that because someone told me it wouldn’t be possible otherwise.

The ammo values can be moved around by editing AmmoInClip, AmmoNoClip and AmmoInReserve in tfresourceuiHudAmmoWeapons.res


Last edited by ell,

Add A Reply Pages: 1