• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Show HP of hero

Status
Not open for further replies.
Level 9
Joined
Dec 17, 2007
Messages
431
Hello, since I have choosen to use the hero-buttons(top-left) as extra spells in my map. I need to show the life of the hero in some other way, and since the map has some healer classes, I would like to show it for all hereos, like if you hold 'Alt', but maybe with floating text.

How would I do this best in Gui, and make it look nice and not just with some chars like l or |..? Is there a way to show somekind of green bar over a hero, and then diside the width of it?

thank you for any help
 
Level 6
Joined
May 7, 2009
Messages
228
I don't think there's any particular way to display a bar of your choosing.

You'll just have to go with =========== or whatever.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
This seems rather pointless, but nevertheless i will tell you how to do it.
You go in game. select a hero or whatever, the important part is that there must be a hero(unit) on the screen. Then you press and hold the 'Alt' button. There you go - a bar displaying the health of your hero.

Now you will go saying: "But ...". Well now, this is exactly what you said you wanted.
I fail to see your problem in your post.
It is kinda hard to follow your thought between the first sentence and the second one:
"Hello, since I have choosen to use the hero-buttons(top-left) as extra spells in my map. I need to show the life of the hero in some other way"
So you add some extra "hero icons" on the left. What is the relations of this to displaying the hero health?
 
Level 9
Joined
Dec 17, 2007
Messages
431
This seems rather pointless, but nevertheless i will tell you how to do it.
You go in game. select a hero or whatever, the important part is that there must be a hero(unit) on the screen. Then you press and hold the 'Alt' button. There you go - a bar displaying the health of your hero.

Now you will go saying: "But ...". Well now, this is exactly what you said you wanted.
I fail to see your problem in your post.
It is kinda hard to follow your thought between the first sentence and the second one:
"Hello, since I have choosen to use the hero-buttons(top-left) as extra spells in my map. I need to show the life of the hero in some other way"
So you add some extra "hero icons" on the left. What is the relations of this to displaying the hero health?

Okay, let me explain it better, I was in a rush and though this was something that could be solved fast.

Here you go, forget the first post.. Good

First of all, I'm sorry if I'm somekind of a perfectionist, but this is important to me.

So here is my rather wierd and small problem: I have this arena map with both dps heroes and healing heroes, I found that the maximum of 4 spells/hero was rather low, so I made a system that enabled a player to buy extra abillities which can be used through the Hero button in the top-left corner by a simple trigger..

Event: 'Player Red Select a unit'
Condition: 'Selected Unit-Type Equal 'SpellUnit_Unholy Blood'
Action: 'Set Variable(CritChance) = 100.00' for Player(Triggering Player)


This is just an example to make you understand better, so when this unit-type named 'SpellUnit_UnholdBlood' is clicked the critchance(custom damage system) is set to 100(%). This unit('SpellUnit_UnholdBlood') is hidden when it's bough and is not in the viewable area, so it is not a real unit, it's just a work-around to use these quick-hero-buttons.

This system allowes me to make the players in the game to buy abillities from a unit-shop and use them on (F1, F2, F3, F4 and F5) so the maximum number of abillities is equal 9 insteed of the default 4..

So long so good. Now, since you normaly keep a close eye to how much life you hero has, it's nice that it is showen as default in the top-left corner, but since my system uses this corner for spells, I will have to use some other way to show the HP of the hero, and I though that a small HP-bar on the top of the hero would be nice.. I know this is posible with floating text, but also that it does not look very good this way. So I ask if anyone know a way to show a green bar/box over the hero, which width could be adjusted dynamicly. Just like floating text.


SO! it's really just a question about how I would show a floating box/bar/image over each hero in-game showing their HP in %. It does not matter if other players can see it too..

Sorry for my fail at ^gramar^ and explanision
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
What about the "alt" button... displaying a perfectly good health bar, right above the hero.

Check first sentence.

One hero unit per spell is too much if you ask me. I recomend using fewer hero units and each of them having some abilities.
So you push 'F1' and then you push either 'a', 'b', 'c', 'd', 'e' and so on.
You can just add the abilities to the units via triggers.
This way you can keep the normal hero icon and have fewer images cloging the screen. Besides using all the keys from F1 to F9 is not comfortable.

The limit to hero spells is 5, not 4. And it can have unlimited amount of unit abilities.
 
Level 9
Joined
Dec 17, 2007
Messages
431
What about the "alt" button... displaying a perfectly good health bar, right above the hero.

Check first sentence.

One hero unit per spell is too much if you ask me. I recomend using fewer hero units and each of them having some abilities.
So you push 'F1' and then you push either 'a', 'b', 'c', 'd', 'e' and so on.
You can just add the abilities to the units via triggers.
This way you can keep the normal hero icon and have fewer images cloging the screen. Besides using all the keys from F1 to F9 is not comfortable.

The limit to hero spells is 5, not 4. And it can have unlimited amount of unit abilities.

That was not my questions, these spells are supposed to be casted quick, not with the use of more than one key, it ruins game-play and looks unprofesional in my opinion..

Please someone, I don't wanna make the floating text before I know there is not a better way to do this :bored: Is it posible someway? What about making a 4-poly green model and attach it above the unit somehow? Only problem is, I don't know which program can save to wc3 format?
 
Level 13
Joined
Jun 23, 2009
Messages
299
What about making a 4-poly green model and attach it above the unit somehow? Only problem is, I don't know which program can save to wc3 format?

Feasible, but pointless, since to make it accurate enough you'd have to animate every single change of the bar... well, also the "|" method is inaccurate as hell, but meh...

Anyway, if you want to know it, probably you'd have to attach it like a unit flying over the hero and then command the various animations via triggers

Let me give you a pair of alternatives:

First one: Use "█" instead :xxd:

Second one: Ok, this is the serious one... if you learn vJass (or simply JASS) you could use this system to suit your needs.
 
Level 9
Joined
Dec 17, 2007
Messages
431
Thank you for some useful comments, I guess "█" is the best way to go, and if it does not work very good I guess I have to go for the animations, but really, it's a hell of an easy model.. I'm a good modeller, but never exported to Wc:III nor' do I have any idea of which quality fit WcIII best :p

Thank you all :) see ya
 
Level 9
Joined
Dec 17, 2007
Messages
431
Alt button is there for a reason.

Pressing F9 is not quick.

I see you have not understood the question yet :xxd:

Just leave this topic for now, I have my answer, I will post back later if I find somekind of work-around on this problem.

btw. there will only be from F1 to F5 since F6-F12 is used to open questlog etc. You can see the map later when I fixed this issue, hopefuly it will go without any problems :thumbs_up:
 
Level 10
Joined
Jan 28, 2009
Messages
442
I figure you just don't want people to have to press Alt to see a **s-**m*** life bar. You could make sheep fly over the hero's head. 10 sheep = 100%, 1 sheep = 50%, and 0 sheep = 135%
-3 sheep = 99,5%

Oh, wait. How to display negative sheep? Damn! That idea was a complete failure. Forget about the sheep, please. Bad idea. Can't make neg... or wait, you could make all the positive sheep light brown, and the negative sheep violet. Because I hate violet, and because light brown is the color of er... mustard.

I'm sorry. I'll never write something as weird as this on purpose at Hive again. I promise. I don't think it's possible either.
 
Level 11
Joined
Jul 9, 2009
Messages
927
hey do you know the devour skill?of lucifer in dota??
the yellow bar above his head when you do the skill?
well i dont know..butif your a good trigger user you
may display
like 1 bar=10% health?
 
hey do you know the devour skill?of lucifer in dota??
the yellow bar above his head when you do the skill?
well i dont know..butif your a good trigger user you
may display
like 1 bar=10% health?

Holy crap.

The devour ABILITY is in wc3 ladder. Lucifer in dota only about 10% of the people here will know. The majority of REAL jass scripters don't like dota.

But here goes.

JASS:
library healthBars
    function healthBar takes unit u, texttag t returns nothing
        local integer health=R2I(GetUnitState(u,UNIT_STATE_LIFE))
        local string text="|cff999900"
        set health=health/10
        loop
            exitwhen health<1
            set text=text+"|"
            set health=health-1
        endloop
        set text=text+"|r"
        call SetTextTagPos(t,GetUnitX(u),GetUnitY(u),100)
        call SetTextTagText(t,text,.05)
    endfunction
endlibrary
 
Status
Not open for further replies.
Top