• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[vJASS] Team colored health bars

Status
Not open for further replies.
Level 9
Joined
Jun 22, 2012
Messages
472
Hey there!

I can't use regular team color in my project so I decided to use this system : HP MP Bars Team-Colored

TriggerHappy has shared a test map to show how to use those team colored bars : Полоски маны, жизни и каста - WarCraft 3 - XGM: Gamedev & Modmaking

I tried to import this system to my map but I have troubles to make it work. First I've imported the bars custom units and models, then the following triggers : 'ProgressBars v2 1', 'TimerUtils', 'BoundSentinel'. At this state, the map compile well. Finally, I've imported 'HP | MP bars' and I've adjusted the custom units IDs in the code of this trigger. When I compile the following error occurs :


Capture.PNG



I've looked into the triggers to see where UnitAlive could be defined twice without success. Any help would be much appreciated :)!

+rep and +credit for helpers!
 
Level 9
Joined
Jun 22, 2012
Messages
472
The line is coded only once in the 'HP | MP bars' trigger (maybe the second occurence is in another trigger). I put the line in commentary and the map now compiles. But the game lags as hell and the bars don't seem to work (they are either away, either empty).

The map provided by TriggerHappy is an example, and I don't know if it can be used "as it" since I'm not familiar with Jass...

EDIT : native UnitAlive is defined in another Jass spell I use : Dune Worm v1.05b
 
Last edited:
Level 9
Joined
Jun 22, 2012
Messages
472
Remove all instances of native UnitAlive except for one.

I've tried to remove one. The map compile. But the game lags a lot, and the HP and MP bars are not displaying correctly. Some units don't have bars (but that may be because they lack some attachment point), some units have empty bars (for both HP and MP).

Do I have to import the 'Looping' trigger? And the progress bar dummy ('pbar')?
 
Level 9
Joined
Jun 22, 2012
Messages
472
I'm a bit lost, tell me if I'm right :

It exists different compilers for Jass, and Jass helper is one of them. I should download the version of Vexorian and add it to my JNGP grimoire?

EDIT : I've found how to switch to Vexorian's JassHelper : same that with Cohadar's. Maybe I should downgrade my JNGP version? To which version? 2.0.9? 2.0.7?

EDIT2 : with Vexorian's JassHelper and JNGP 2.0.7 no more lag! But the bars are still empty (if the unit is on the map at map init) or away (if the unit is created after map init)... @TriggerHappy, do I have to import the 'Looping' trigger?
 
Last edited:
Level 10
Joined
Sep 16, 2016
Messages
269
I do hope you only inexperience with vjass. This one contains an add-in for GUI users, you can modify them easier.

Edit: You should replace old trigger named "HP | MP Bar" in your map with the one in mine. Copy the 2 new trigger (Register and BarInit) into your map. Config like below.

dd.jpg
 

Attachments

  • ProgressHealthMana (Revised).w3x
    34.4 KB · Views: 105
Last edited:
Level 9
Joined
Jun 22, 2012
Messages
472
Thanks for your help! So, I've tested this out, updating triggers and rawcodes, using the following conditions for :
  • 'Register' trigger :
  • (Unit-type of (Triggering unit)) Equal to Gondorian horseman
  • 'BarInit' trigger :
  • (Unit-type of TempUnit) Equal to Gondorian horseman
The bars are displaying in both case without lag. But there's a problem with the value displayed by the bars. On the following pic, the horseman on the left has been created after map init, it appears with a full bar, but when it is wounded the bar doesn't display the good amount of HP (see example with 50% HP). The two horsemen on the right are created at init with 100% HP, they aren't wounded on the picture, but the bars don't agree :p

WC3ScrnShot_021417_143647_01.png


I'll try to see if I find an explanation of that in 'HP | MP bars' and 'ProgressBars v2.1' :)


EDIT : when a unit with an attached bar dies, a string (the name of the team of the dying unit) displays twice

aaa.png
 
Last edited:
Status
Not open for further replies.
Top