Graphically Displaying HP Percentages

Forum for alternative clients, mods & discussions on the same.

Moderator: Phades

taliss
Posts: 18
Joined: Tue Oct 30, 2012 10:03 pm

Graphically Displaying HP Percentages

Post by taliss »

In this SS The percentages of DMG are displayed, How would one go about achieving this? Any help would be appreciated.
Image
http://scr.hu/0pp2/4sj9e/
User avatar
borka
Posts: 9965
Joined: Thu Feb 03, 2011 7:47 pm
Location: World of Sprucecap

Re: Graphically Displaying HP Percentages

Post by borka »

At the moment i only can remember of old Mentor/Deboon client having this, maybe someone merged that into another client as the screenshot is this world...
Avatar by SacreDoom
Java 8 - manually downloads - good to check for actual versions url here:
viewtopic.php?f=42&t=40331
Remember what the dormouse said: Feed your head Feed your head
taliss
Posts: 18
Joined: Tue Oct 30, 2012 10:03 pm

Re: Graphically Displaying HP Percentages

Post by taliss »

UNION Client, It shows percentages. For future reference this simply uses a numerical number to reflect the decay stage rather than a shade of red. It would be amazing if it was an accurate percentage though. Or an HP reading that allowed you to count down the remaining HP.
User avatar
NOOBY93
Posts: 6528
Joined: Tue Aug 09, 2011 1:12 pm

Re: Graphically Displaying HP Percentages

Post by NOOBY93 »

Just edit the res files of the damaged segments and put numbers or some other indicators on
Jalpha wrote:I believe in my interpretation of things.
User avatar
borka
Posts: 9965
Joined: Thu Feb 03, 2011 7:47 pm
Location: World of Sprucecap

Re: Graphically Displaying HP Percentages

Post by borka »

For exact damage numbers the server prolly needs to send you the information (while i don't know whether the server has accurate numbers -> RNG)
NOOBY93 wrote:Just edit the res files of the damaged segments and put numbers or some other indicators on
yep put in

Code: Select all

NOOBY
instead of

Code: Select all

25%
:P
Avatar by SacreDoom
Java 8 - manually downloads - good to check for actual versions url here:
viewtopic.php?f=42&t=40331
Remember what the dormouse said: Feed your head Feed your head
User avatar
NOOBY93
Posts: 6528
Joined: Tue Aug 09, 2011 1:12 pm

Re: Graphically Displaying HP Percentages

Post by NOOBY93 »

borka wrote:For exact damage numbers the server prolly needs to send you the information (while i don't know whether the server has accurate numbers -> RNG)
NOOBY93 wrote:Just edit the res files of the damaged segments and put numbers or some other indicators on
yep put in

Code: Select all

NOOBY
instead of

Code: Select all

25%
:P
wtf is that supposed to mean
I'm trying to help OP
Jalpha wrote:I believe in my interpretation of things.
User avatar
borka
Posts: 9965
Joined: Thu Feb 03, 2011 7:47 pm
Location: World of Sprucecap

Re: Graphically Displaying HP Percentages

Post by borka »

Which .res files and what to edit in there ?!? Nothing else to do? !? :roll:
Avatar by SacreDoom
Java 8 - manually downloads - good to check for actual versions url here:
viewtopic.php?f=42&t=40331
Remember what the dormouse said: Feed your head Feed your head
User avatar
Xcom
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Re: Graphically Displaying HP Percentages

Post by Xcom »

No these changes are an overlay and haven't got anything to do with res images. The red tint is placed on objects as a number is received from the server. The number can be found in mapview.java on one of the lines I have forgotten about. If anyone wants it I'll try dig it up. The 25% values are basically a text display like name tags generated as the value changes from 0 as not damaged to 3 or something being 75% damaged.

I didn't fix this on my own client cause I didn't know how to find a good way to make that text display. It semi complicated to setup so unless your up for a challenge it wont be easy to add.

About getting the exact damage value its impossible but it's possible to get a more detailed damage value by bashing objects. The hourglass displays the damage the object have taken from 0 to 21.
User avatar
borka
Posts: 9965
Joined: Thu Feb 03, 2011 7:47 pm
Location: World of Sprucecap

Re: Graphically Displaying HP Percentages

Post by borka »

:lol: Xcom i've been ironical about NOOBY

Just as an example (Do not use )

Code: Select all

Config.java
 89   public static boolean showHP = false;
326   showHP = options.getProperty("showHP", "false").equals("true");
410   options.setProperty("showHP", showHP ? "true" : "false");

MapView.java

1292    if (Config.showHP) {
        GobHealth hlt;
     if ((hlt = (GobHealth)((Gob)part.owner).getattr(GobHealth.class)) != null) {
       String f = "\n"+Float.valueOf((float)(hlt.asfloat() * 100.0D)) + "%";
       g.text(f, part.sc().add(10, 20));
             }
1298   } 

MenuGrid.java

327  } else if (list[1].equals("showhp")) {
            Config.showHP = !Config.showHP;
           String str = "Display Buildings Health: " + (Config.showHP ? "ON" :      "OFF");
           this.ui.cons.out.println(str);
            this.ui.slen.error(str);
332           Config.saveOptions();
Avatar by SacreDoom
Java 8 - manually downloads - good to check for actual versions url here:
viewtopic.php?f=42&t=40331
Remember what the dormouse said: Feed your head Feed your head

Return to “The Wizards' Tower”