• 🏆 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!

Custom UI Icon Desync

Status
Not open for further replies.
Level 5
Joined
Jul 16, 2017
Messages
65
So i have this function and this trigger:
2020.07.21-19.36.png

2020.07.21-19.12.png


and the idea is when the spell is cast to give the hero 1500 hp and show the player an icon at the bottom left with the description showing when you hover over it. And it works.

2020.07.21-19.16.png

2020.07.21-19.16_01.png


But when i tested with players we all desynced. Does anyone know why that happens and how to prevent it?
 

Attachments

  • 2020.07.21-19.12_01.png
    2020.07.21-19.12_01.png
    121.8 KB · Views: 74
  • 2020.07.21-19.12.png
    2020.07.21-19.12.png
    385.2 KB · Views: 45
  • 2020.07.21-19.16.png
    2020.07.21-19.16.png
    2.4 MB · Views: 53
This happens because you create a Frame only for one player. The frame-UI api provided by Blizzard wants that all custom created Frames are created for all players. And that the first time they enter your map's code is done by all players. With creating a Frame the children do not enter your map's code yet. That happens when you refer them with the functions BlzGetFrameByName/BlzFrameGetParent/BlzFrameGetChild/BlzGetOriginFrame.

Run that function at 0s for all players and hide it. Then when that ability is used show it for the caster.
 
you move the creation into a trigger with the event at 0s.
Then you add this line at the end of the creation function.
call BlzFrameSetVisible(face, false)
Now I would suggest you change the frameName of the BACKDROP, because you can not create global framehandles in GUI and "Face" is not so selfexplaining. (not the variableName the text arg after "BACKDROP")
BlzCreateFrameByType("BACKDROP", "VitalityFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
Then instead of calling your create function you make the BACKDROP Frame visible in the GetLocalPlayer() == xxxx block, use:
call BlzFrameSetVisible(BlzGetFrameByName("VitalityFrame", 0), true)
 
Level 5
Joined
Jul 16, 2017
Messages
65
Thanks! One last thing, does moving the frame call BlzFrameSetAbsPoint(BlzGetFrameByName("VitalityFrame", 0), FRAMEPOINT_CENTER, 0.07, 0.189)
for a specific player cause a desync? Cause i want to have multiple of those frames for different abilities and not have the icons overlap.
 
Status
Not open for further replies.
Top