1. Music Contest #10 - Results are finally published! Drop by to check some retro songs and congratulate the winners!
    Dismiss Notice
  2. Join Terraining Contest #19 and witness the aftermath!
    Dismiss Notice
  3. The 3rd Melee Mapping Contest is ON! Join in on a ride of a 4v4 melee experience!
    Dismiss Notice
  4. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice

Mana Bars (yet another thread)

Discussion in 'World Editor Help Zone' started by Apheraz Lucent, Feb 11, 2015.

  1. Apheraz Lucent

    Apheraz Lucent

    Joined:
    Jan 31, 2010
    Messages:
    3,312
    Resources:
    4
    Tutorials:
    4
    Resources:
    4
    Before anything else, yes, I did my best to find something similar to what I'm searching for, and found nothing.

    I believe I've looked to over 30 threads and systems and still. Found nothing.

    I am searching for a custom Health/Mana Bar system and models, that should look something like this:
    Reference
    [​IMG]
    The systems I've found on THW didn't offer me fully functionality, were either slow or bugged, or didn't visually look good enough.

    The best one I found so far is this one:
    http://www.hiveworkshop.com/forums/...-v2-0-1-a-245414/?prev=search=bar&d=list&r=20

    But I don't like how it looks overall, and the bars stay there after a unit dies (looking for a more "powerful" appearance, as it will only be used on hero units, while standard units will have regular HP bars, no mana bars at all for them).

    Anyways, I've seen in few maps that something VERY similar to reference image I gave is used, but I can't find any of those maps to take a look at model names if nothing else.

    I've also found this: http://www.thehelper.net/threads/loadingbars-tallybars-w-e-bars.142619/

    Which I really like it's appearance, but cannot use it in the system I've linked (animation issues probably).

    I'm asking for help to get the mana bar system, or to "fix" either the linked model or the system by TH to make it functional. I'm also open for other suggestions.

    Thanks in foward!
     
  2. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,653
    Resources:
    3
    Spells:
    3
    Resources:
    3
    I share the same feeling...
    I searched one too a few months ago but with no good results.
    I tried this one but it crashes as soon as I tested... no errors were given on save and I didn't change a thing... just fatal error on startup.
     
  3. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    807
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    I don't know of an easy way to make it straight-up for a map, but there is a mod for WC3 called Nirvana that uses a custom executable to inject it's own code into WC3 and one thing it injects is a 100% functional mana bar. To actually use the custom mana bar without the rest of the mod isn't difficult at all unless you have no idea what you're doing.

    Alternatively, some launchers, like ICCUP Launcher, use to have a "Mana Bar" option built-in.
     
  4. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,653
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Ow wait mana bars aren't added to the game by default... Lol I forgot that I use a hack myself XD
    But still the basic mana/hp bars are not that beautifull.
    I am sure that there must be made something for it.
     
  5. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    24,849
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    This is not possible in WC3? Sure you can customize the health/mana bars however I am not sure how you will define the segmentation mechanics. I certainly do not recall ever seeing a map that uses segmentation mechanics.

    To clarify, segmentation mechanics is when the health or mana bar is divided into visible segments, each representing a standard quantity. For example in Heroes of the Storm the health bar is segmented into 250 health units. If you have a move that does 500 damage you know it will remove 2 segments from the bar. This mechanic is required to de-normalize unit health such that you can recognize tougher or weaker targets.

    The segmentation mechanics are supported by SC2 engine and are shown off nicely in both the Heart of the Swarm campaign and Heroes of the Storm free to play AoS.
     
  6. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,833
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    I suggest that you should make your own Life/Mana Bar with that look, which will have 10000 animations for every percentage of life and mana (for ex. Life is 90, and Mana is 100 -> (90 - 1)*100 + 100 -> 9000 animation id)

    The first map to offer this feature/functionality is IID by Luorax, where they use a model that has animations same that I have mentioned above(but including the Level Value. so that would be 180000 animations if it the animations are precise)


    Here is the link to the map:
    http://www.hiveworkshop.com/forums/maps-564/iid-beta-v0-88b-227935/?prev=search=IID&d=list&r=20

    Perhaps you could bring that down to 20*20*hero level(which is for ex. hero level = 10 -> 4000 animations) but it would be 20% less precise(but improves performance and less time to make as well). The idea of 400+ animations is that it checks life and mana for every 5% value


    Using text tags would be cheap, but expensive in handles, and also it would take time to calculate the right height fit for the text tag. It will be also perfect if it takes account the selection size of a unit (health bars length are equal to selection diameter, or perhaps the collision diameter)
     
  7. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,653
    Resources:
    3
    Spells:
    3
    Resources:
    3
    No I dont think you need 10k+ animations.

    If I am right, the casting bar system uses one animation and sets the animation speed to ... to make the duration.
    I think that you can set the animation to very much for 0.03 seconds and then back to 0.
    If that is true, you can have your own health bar with one animation... 2 if you cannot set negative animation speed.

    I never tried to test it but I suppose it will work.
    if you set the speed a little lower and the duration a bit higher, you will get the fading effect. That when you take damage, the health bar wil slowly move towards the new value.

    What you need is to check every 0.03 seconds how much hp in percent has and compare that to the amount that is saved.
    If those are different, then increase/decrease animation speed and set the new percentage as the value.
    In that way, you can do it... I suppose.
    But as I said I never tried it.
     
  8. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,833
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    It will, if you want the bar to return 100% of the value due to the fact that you will create your own health bar and mana bar that are both combined, which would require n^2 results where n is the amount of animations needed per bar. (ex. if the bars are 5 times less precise , it would have 20 animations per bar, and per animations there are 20 animations to match it. so 20^2 = 400 animations)
     
  9. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,653
    Resources:
    3
    Spells:
    3
    Resources:
    3
    I think I understand wrong because I read it as "Yes that will work, but it will not work."
    If there is one animation for increasing size and one for decreasing size, then I can make the health bars with 2 animations... per bar. One bar would be one unit.
    This might be performance intensive but yea you can customize everything you want.
    (I am still thinking of how to make those blocks.
    In the preview you can see black lines that separate the health bar in different blocks.
    One block being 100 hp.)

    With this, you could also make a 3rd bar for stuff like shields... would be dynamic ofcourse :D
     
  10. Apheraz Lucent

    Apheraz Lucent

    Joined:
    Jan 31, 2010
    Messages:
    3,312
    Resources:
    4
    Tutorials:
    4
    Resources:
    4
    @Almia, that is something I'm looking for, tho I'm not in the need of the level part, but it is a neat addition.

    If anyone has information how can I get my hands on something similar for my project, I'd be very grateful :)
     
  11. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,833
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Maybe you should contact Judash(he is the one who made the bars) or you could just contact a modeller who would do same thing
     
  12. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,653
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Is there any way to remove the regular health bars?
    I mean without locust or <=0 selection size.

    EDIT: nvm I got it.

    This looks promosing does it?
    type "-inc" and "-dec" to increase and decrease.

    I know that 100% is in 1 second full.
    So 0.03 x 100% is +3% hp.
    So if a unit is hit for 10% of his hp since the last 0.03 interval, I will set animation speed to -100 / (0.03 X 10) = -333.333% for 0.03 seconds and it will be updated properly.
    However that will be made in the system.

    I know that this method is very buggy because there might be a difference after you play for a while but it is only a concept yet.

    (Known bug: units will not show their selection sircle.)
     

    Attached Files:

    Last edited: Feb 12, 2015
  13. LeP

    LeP

    Joined:
    Feb 13, 2008
    Messages:
    399
    Resources:
    0
    Resources:
    0
    You can just display two models above each other. No need to combine them into one model.
    For example afaics IID uses two models with each atleast 100 animations.
     
  14. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,833
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    That purpose is to have a nicer look
     
  15. stan0033

    stan0033

    Joined:
    Jun 27, 2010
    Messages:
    1,558
    Resources:
    13
    Models:
    3
    Packs:
    1
    Skins:
    2
    Maps:
    6
    Spells:
    1
    Resources:
    13
  16. LeP

    LeP

    Joined:
    Feb 13, 2008
    Messages:
    399
    Resources:
    0
    Resources:
    0
    Not that you don't specify what "looks nicer" means i'm very sure it wont look nicer. I mean you can more or less arrange models "pixelperfect" around any unit.
    And just for fun here are the lines from iid0.88b which prove the usage of two models (or rather two units with probably the same model).
    Code (vJASS):

    call SetUnitAnimationByIndex(Ok[IZv],(R2I(((100*(GetWidgetLife(rk[IZv])/ GetUnitState(rk[IZv],UNIT_STATE_MAX_LIFE)))*1.0)+.55555)))
    call SetUnitAnimationByIndex(Rk[IZv],(R2I(((100*(GetUnitState(rk[IZv],UNIT_STATE_MANA)/ GetUnitState(rk[IZv],UNIT_STATE_MAX_MANA)))*1.0)+.55555)))
     

    I didn't even bother checking the models as the above should be pretty obvious.

    There are also other alternatives to models, mainly texttags and lightnings.
    You'd have to script the billboard effect for lightnings yourself though. Or just lock the camera. I guess lightnings have the advantage that one could easily implement that segmentation also mentionend in this thread.

    External programs were already mentionend in this thread. There are a non-option imo. I'd like my map to be playable w/o external tools.
     
  17. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,653
    Resources:
    3
    Spells:
    3
    Resources:
    3
    @Apheraz Lucent
    Maybe you should make a request of this... as you want to have the model for those bars.

    The system is not hard to make :D
    Even with only 2 animations.