• 🏆 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 Skill Tree Question

Status
Not open for further replies.
Level 7
Joined
Nov 6, 2019
Messages
186
Simple question, but I think I already know answer, but wanna check to be safe.

I plan to make a Custom UI Skill tree, small one, I am pretty sure I know how but one thing am not sure about.

If there is Multiple Players, would I have to make Multiple UI, basically, Duplicate one UI per player more than 1

So 4 players duplicate UI 3 times to have 4 total UIs
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
If you mean using UI frames, I would create unique frames for each player. Otherwise, you'll be stuck using GetLocalPlayer() to modify every single change that happens and you might run into a desync here and there. From what I understand, you're only limiting yourself by sharing frames.

However, a Multiboard or anything which displays the same information to everyone might be better unshared.
 
Last edited:

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Depends, I think.

If you use the UI natives they don't take a player as an argument which suggests it creates UI elements for all players by default. This would mean you only need to create the barebones "once".
However, in a talent tree you don't have the same talents.

I do not know if GetLocalPlayer works for the UI natives, if so you'd just render it once.
If it doesn't you have to do it the oldschool way, in which case you do need to render it multiple times.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
Depends, I think.

If you use the UI natives they don't take a player as an argument which suggests it creates UI elements for all players by default. This would mean you only need to create the barebones "once".
However, in a talent tree you don't have the same talents.

I do not know if GetLocalPlayer works for the UI natives, if so you'd just render it once.
If it doesn't you have to do it the oldschool way, in which case you do need to render it multiple times.
The frames are created for all players by default. GetLocalPlayer() is then used to toggle the visibility of the frames in order to show them to specific players. This doesn't desync. The part that worries me is using GetLocalPlayer() with the other natives, I'd like to think that they'd all work fine but I've never tried. I personally prefer creating unique frames for each player since I can avoid GetLocalPlayer() as much as possible but maybe that's an irrational fear.

The UI master himself may shed some light @Tasyen
 
Last edited:
Level 7
Joined
Nov 6, 2019
Messages
186
Well i plan to make UI with RUID but not Multiboard, and if i did make dig one per player, i would still have to use GetLocalPlayer() so the CustomUI only shows for that player

it be something like this in end. and it be set up with OSKEY so press P or something will open it if i set that up right
 

Attachments

  • image_2021-12-08_015856.png
    image_2021-12-08_015856.png
    443.3 KB · Views: 26
Last edited:
I'd like to think that they'd all work fine but I've never tried. I personally prefer creating unique frames for each player since I can avoid GetLocalPlayer() as much as possible but maybe that's an irrational fear.
They work fine in a GetLocalPlayer block.
But never use create/Destroy in GetLocalPlayer.
BlzGetOriginFrame, BlzFrameGetParent, BlzGetFrameByName & BlzFrameGetChild can let a frame enter your map's code, if that happens inside GetLocalPlayer block it desyncs. But it is fine when the frame already entered the map's code at an earlier time.
ChildFrames do not enter the map's code when Creating their Parent​
 
Last edited:
Status
Not open for further replies.
Top