• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Help with Healthbar...

Status
Not open for further replies.
Level 12
Joined
Mar 13, 2020
Messages
421
Hi Guys i need help with the Healthbar Code...

Screenshot (18).png

it works for Singleplayer but when i try to get it to work for more players...
it desync i tryed it with multiinstances of wc3 (local)
and i dont know... how to make this working...
if anyone of you could help me to understand/bring it to work...
 
Level 12
Joined
Mar 13, 2020
Messages
421
Create your frames after all players have finished loading -> 1 second elapsed.
Use GetLocalPlayer() as little as possible. It seems to work fine with BlzFrameSetVisible().
I readed our last Conversation again and then i noticed that you said hide frames for some players...
now i got it but there is one thing i dont get...

[trigger]Player 1
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Custom script: if GetLocalPlayer() == Player(0) then
Custom script: call BlzFrameSetVisible(BlzGetFrameByName("MyBarEx",3) , false)
Custom script: call BlzFrameSetVisible(BlzGetFrameByName("MyBarEx",4) , false)
Custom script: endif[/trigger]

i used this method and it works but.. how i force a player to press esc xD

EDIT: Found it...
 
Last edited:

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,954
For new frames, I create unique frames for each player, hide ALL of them by default, and then use GetLocalPlayer + BlzFrameSetVisible to show each player their own frames.

Example:

For index = 0, 24 do
healthbar[index] = BlzCreateFrame(...)
BlzFrameSetVisible(healthbar[index], false)
If GetLocalPlayer() == Player(index) then BlzFrameSetVisible(healthbar[index], true)
 
Level 12
Joined
Mar 13, 2020
Messages
421
For new frames, I create unique frames for each player, hide ALL of them by default, and then use GetLocalPlayer + BlzFrameSetVisible to show each player their own frames.

Example:

For index = 0, 24 do
healthbar[index] = BlzCreateFrame(...)
BlzFrameSetVisible(healthbar[index], false)
If GetLocalPlayer() == Player(index) then BlzFrameSetVisible(healthbar[index], true)

the same i did now i created them and then turned the visible off and with getlocalplayer turn all on again after the game starts did not tested with full lobby (8Players) but with 2 Multiinstance wc3 it worked so far
our last conversation got it for me so i started looking into things i readed one time and found things like getlocalplayer showing only things for one player and then i got it..
thx uncle you are a hero :p
 
Status
Not open for further replies.
Top