Page 1 of 1

Posted: Tue May 22, 2007 5:23 pm
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!

Posted: Tue May 22, 2007 8:56 pm
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)), "%"))

Posted: Tue May 22, 2007 9:29 pm
by badpazzword
Whoops.

Posted: Thu May 24, 2007 1:40 pm
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?

Posted: Thu May 24, 2007 2:12 pm
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?

Posted: Thu May 24, 2007 2:38 pm
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

Posted: Thu May 24, 2007 2:42 pm
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).

Posted: Thu May 24, 2007 3:07 pm
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...

Posted: Thu May 31, 2007 8:46 am
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