Percentages in the HUD

A place to discuss user-created Allegiance 3D models, textures, images, and other visual ingame content.
Post Reply
badpazzword
Posts: 3627
Joined: Thu Jan 12, 2006 8:00 am
Contact:

Post by badpazzword »

Example

To achieve this:

1) go to your dialog.mdl
2) find the following:

Code: Select all

fuelString = 
    BlendImage(
        StringImage(
                JustifyLeft,
                100,
                smVerdana,
                hudColor,
                ConcatinatedString("F: ", ConcatinatedString(NumberString(Multiply(GetFuel(Me, OnEveryFrame),100)), "%"))
        ),
        hudBlendMode
    );
3) Replace with

Code: Select all

fuelString = 
    BlendImage(
        StringImage(
                JustifyLeft,
                100,
                lgBoldVerdana,
                hudColor,
                ConcatinatedString("F: ", ConcatinatedString(NumberString(Multiply(GetFuel(Me, OnEveryFrame),100)), "%"))
        ),
        hudBlendMode
    );
4) Repeat as needed:

CODEammoString =
BlendImage(
StringImage(
JustifyRight,
100,
lgBoldVerdana,
hudColor,
ConcatinatedString("A: ", ConcatinatedString(NumberString(Multiply(GetAmmo(Me, OnEveryFrame),100)), "%"))
),
hudBlendMode
);

energyString =
BlendImage(
StringImage(
JustifyLeft,
100,
lgBoldVerdana,
hudColor,
ConcatinatedString("E: ", ConcatinatedString(NumberString(Multiply(GetPercentEnergy(Me, OnEveryFrame),100)), "%"))
),
hudBlendMode
);

armorString =
BlendImage(
StringImage(
JustifyLeft,
100,
lgBoldVerdana,
hudColor,
ConcatinatedString("H: ", ConcatinatedString(NumberString(Multiply(GetPercentHitPoints(Me, OnEveryFrame),100)), "%"))
),
hudBlendMode
);


shieldString =
BlendImage(
StringImage(
JustifyRight,
100,
lgBoldVerdana,
hudColor,
ConcatinatedString("S: ", ConcatinatedString(NumberString(Multiply(GetPercentShields(Me, OnEveryFrame),100)), "%"))
),
hudBlendMode
);

thrustString =
BlendImage(
StringImage(
JustifyRight,
100,
lgBoldVerdana,
hudColor,
ConcatinatedString("T: ", ConcatinatedString(NumberString(Multiply(playerThrottle,100)), "%"))
),
hudBlendMode
);


I also tried with thrust values, but using ConcatinatedString("A: ", ConcatinatedString(NumberString(Multiply(playerThrottle), "%")) crashes Alleg rather badly.

EDIT: The ammo bar in the screenie is wrong as of a Slipshod UI bug. The percentage values are accurate.

EDIT2: Corrected. Thanks, scorpion!
Last edited by badpazzword on Tue May 22, 2007 9:30 pm, edited 1 time in total.
Have gaming questions? Get expert answers! Image Image
scorpion69
Posts: 9
Joined: Thu Jun 15, 2006 7:00 am

Post by scorpion69 »

Awesome!

Thanks badp! /wub.gif" style="vertical-align:middle" emoid=":iluv:" border="0" alt="wub.gif" />


QUOTE I also tried with thrust values, but using ConcatinatedString("A: ", ConcatinatedString(NumberString(Multiply(playerThrottle), "%")) crashes Alleg rather badly.[/quote]
This works fine for me:
ConcatinatedString("T: ", ConcatinatedString(NumberString(Multiply(playerThrottle,100)), "%"))



badpazzword
Posts: 3627
Joined: Thu Jan 12, 2006 8:00 am
Contact:

Post by badpazzword »

Whoops.
Have gaming questions? Get expert answers! Image Image
mesial
Posts: 3009
Joined: Sun Dec 26, 2004 8:00 am
Location: Florida

Post by mesial »

After posting a picture of that HUD, you do realise that it's my duty to hound you for it so I can add it to my site, right?
Allegiance Terror Alert Level: HIGH
badpazzword
Posts: 3627
Joined: Thu Jan 12, 2006 8:00 am
Contact:

Post by badpazzword »

Yep. But there are a few glitches.

Sometimes the counters read "-2147483647" (for example, in a fig, you read "E: -2147483647"; in a pod it's "A: -2147483647" and "E: -2147483647"; etc.) That's because the Get functions were never meant for this use.

I've also been trying to show the ACTUAL numbers and not useless percentages but found no way around it. Any idea?
Last edited by badpazzword on Thu May 24, 2007 2:13 pm, edited 1 time in total.
Have gaming questions? Get expert answers! Image Image
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

Mesial wrote:QUOTE (Mesial @ May 24 2007, 02:40 PM) After posting a picture of that HUD, you do realise that it's my duty to hound you for it so I can add it to my site, right?
if you are talking about the gauges they are my slipstream gauges (v1.0 i think those are)

http://www.allegacademy.org/dnld/dnld.shtml
http://www.freeallegiance.org/forums/index...amp;#entry41671

the reason i don't have a blog entry on them is because i made a nice post on the old forums about them and i want it back instead of re-writing it again.

p.s. you don't have my normal thingauge on your site, only psychosis's coloured version
Last edited by madpeople on Thu May 24, 2007 2:39 pm, edited 1 time in total.
badpazzword
Posts: 3627
Joined: Thu Jan 12, 2006 8:00 am
Contact:

Post by badpazzword »

You made them? Good. Check the image again. Ammo gauge. The percentage is accurate, your bar isn't... (also the fuel isn't correctly shown, but not as much).
Have gaming questions? Get expert answers! Image Image
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

badpazzword wrote:QUOTE (badpazzword @ May 24 2007, 03:42 PM) You made them? Good. Check the image again. Ammo gauge. The percentage is accurate, your bar isn't... (also the fuel isn't correctly shown, but not as much).
yeah... i was looking at that and wondering about that :/

it seemed right when i tested it... well, i don't have time to fix it right now :(

yeah, i think i did have trouble fitting them into the same boxes as the originals because i was using 45degree diagonals and the originals were in rectangles and a 45 degree diagonal line doesn't cross both corners in a rectangle... i guess i could have added some vertical bits...
Bacon_00
Posts: 1277
Joined: Thu Feb 19, 2004 8:00 am
Location: Yo Mamma

Post by Bacon_00 »

Wow, I really like both that HUD and the idea of giving %'s next to the graphics.

If you get this working well, lemme know, Bacon like =D
Image
"Leave Bacon alone. When he's unsure of what sector he's in somehow it works out better." -Lee
Post Reply