Forum

more hud - dmg done

Created 18th December 2009 @ 16:53

Add A Reply Pages: « Previous 1 2 3

exm

nevermind, found my stupid mistake.


Last edited by exm,

Atty

ORKZORKZORKZORK

Nice, it works !

By the way is it possible to change the color of the numbers from red to say yellow in some easy way ?

You can by editing the HudDamageAccount.res file whereas “PositiveColor” and “NegativeColor” is your colour, “delta_lifetime” is the fade time, “delta_item_font” & “delta_item_font_big” is the font.Not sure if every custom hud has that file though I used NeoN’s hud which has.


Last edited by Atty,

Extremer

http://fakkelbrigade.eu/extremer/images/tr_walkway_rc0008.jpg

DMG DONE NEEDS TO GO!

Kasuno

Deimos

Red Green Blue and Alpha ? Whats this colour ? I want it Yellow, pls someone help me :D

Atty

ORKZORKZORKZORK

Red Green Blue and Alpha ? Whats this colour ? I want it Yellow, pls someone help me :D

"PositiveColor" "255 255 0 255" // RED GREEN BLUE ALPHA
"NegativeColor" "255 255 0 255"

Koeitje

AUTOBOTS

Viq, could you post what we talked about last night? For people without custom/m0re’s hud.

Xantraz

8===D

FYI, “delta_item_font” is the font for normal dmg, “delta_item_font_big” is the font for crit/minicrit or just bigger dmg.

Koeitje

AUTOBOTS

Does anyone know how I can make the damage show up in a tiny font underneath my crosshair?

James Lame

BLLB

http://www.qun.nl/HudDamageAccount.zip for big green damage and stays 2 times longer in screen.

Is it only me or has this stopped working after the latest patch?

JHWH

TP

Just tick the box in multiplayer > advanced options?

xtala

Red Green Blue and Alpha ? Whats this colour ? I want it Yellow, pls someone help me :D

Alpha is how opaque the text is iirc.

ell

(ETF2L Donator)

Does anyone know how I can make the damage show up in a tiny font underneath my crosshair?

http://img193.imageshack.us/img193/3259/damagenumbers.png

"Resource/UI/HudDamageAccount.res"
{
"CDamageAccountPanel"
{
"fieldName" "CDamageAccountPanel"
"text_x" "0"
"text_y" "0"
"delta_item_end_y" "0"
"PositiveColor" "255 255 0 255"
"NegativeColor" "255 255 0 255"
"delta_lifetime" "0"
"delta_item_font" "HudFontMediumSmall"
"delta_item_font_big" "HudFontMediumSmall"
}

"DamageAccountValue"
{
"ControlName" "CTFLabel"
"fieldName" "DamageAccountValue"
"xpos" "c-11"
"ypos" "c+11"
"zpos" "2"
"wide" "22"
"tall" "8"
"visible" "1"
"enabled" "1"
"labelText" "%metal%"
"textAlignment" "left"
"fgcolor" "255 255 0 255"
"font" "HudFontMediumSmallBold"
}

"DamageAccountValueBG"
{
"ControlName" "CTFLabel"
"fieldName" "DamageAccountValue"
"xpos" "c-10"
"ypos" "c+12"
"zpos" "1"
"wide" "22"
"tall" "8"
"visible" "1"
"enabled" "1"
"labelText" "%metal%"
"textAlignment" "left"
"fgcolor" "0 0 0 255"
"font" "HudFontMediumSmallBold"
}
}

I was gone for a few weeks around xmas so chances are that you figured this out already, but I’ll share it with you anyway just in case. I modified Extremer’s file to fit Koeitje’s request as that’s what I had in mind myself.

There seems to be some confusion among some about how this works. From what i can tell from playing around with it tonight:

CDamageAccountPanel, DamageAccountValue and DamageAccountValueBG refer to the the entities of damage numbers, our custom damage value and it’s background respectively. The CDamageAccountPanel must be present in hudlayout.res in addition to the file above for it to work and the command “hud_combattext” must be set to 1 in the config file to allow our custom damage number to access the data we seek to present. The popup damage numbers can instead be disabled entirely by setting “delta_item_end_y” to zero if desired. The entities are limited by commands “wide” and “tall” denoting the sideleghts in pixels. The contents of the entity will not scale to fit, you have to ensure that they are large enough to contain whatever you intend. Their positions are specified with the xpos and ypos commands, i.e. their horisontal and vertical coordiates in a raster with the width and length corresponding to the screen resolution. I have so far seen 3 argument patterns:

xpos x
x pixels from left side of screen

ypos x
x pixels from top of screen

xpos rx
x pixels from right side of screen

ypos rx
x pixels from bottom of screen

xpos c+x (c-x)
center of screen and x pixels to the right (left)

ypos c+x (c-x)
center of screen and x pixels to downwards (upwards)

An object with zpos with value x overlaps another object with value y if x greater than y. The entities can be aligned with textAlignment command give eigher left right or center as argument.

Example:
DamageAccountValue is a left aligned box of height 8 and width 22 with coordinates (c+11,c-11) containing text of the font HudFontMediumSmallBold.

The DamageAccountValueBG is just a DamageAccountValue in black placed beneath and slightly to the right to serve as a shadow. I use left alignment since the minus sign would otherwise jump around to much, and centering gave varying positions depending on the number of digits displayed.

What I haven’t yet understod is how this file is called and how DamageAccountValue knows what to display. Could anyone please explain this?
I’m also a bit confused about PositiveColor, can you do positive damage???

NOTE: This code is made for 640×480 resolution, if you have a different one you have to adjust the parameters yourself to reach the same result. If so, I suggest you take the following approach:

Start off with Extremer’s original code and play around with different fonts and sizes until you find the one of your liking. Get the maximum amount of text by doing over 100 points of damage so that you see how big your entity will be. Adjust the size of the entity to the size of the text and after that position it as you like it. It is helpful to use windowed mode while you do this as you will be going back and forth between the game and your text editor a lot. You should also know that you can reload your changes in game by typing hud_reloadscheme into the console and thereby avoid having to restart for changes to take effect.

GL


Last edited by ell,

ell

(ETF2L Donator)

I just got an idea. It would be convenient to have the custom damage number change color during the first second after a hit or so that you don’t assume that you hit your target with the damage displayed from before even though you didn’t. This should be possible by adding a third layers identical to DamageAccountValue on top if it can be given a lifespan like with delta_lifetime. Maybe even more layers could be used to create a smoother fade effect if they disappear one after another. For instance:

Red(z=4): disappears after 1/2 s
Yellow(z=3): disappears after 1 s
Green(z=2): never disappears
All layers activated on hit.

or

Yellow(z=5): disappears after 1/3 s
Greenish Yellow(z=4): disappears after 2/3 s
Yellowish Green(z=3): disappears after 1 s
Green(z=2): never disappears
All layers activated on hit.

I bet this is a better idea though:

Yellow(z=3): disappears after 1/2 s
Green(z=2): never disappears
All layers activated on hit.

This will have to wait until tomorrow, ehum, today…though.


Last edited by ell,

James Lame

BLLB

Thanks for sharing Link. I’ll tinker with what you posted, nice idea with the color fadeout.

Add A Reply Pages: « Previous 1 2 3