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

[JASS] Simple Multiboard question

Status
Not open for further replies.
Hi guys I am making a selection system for the races on my map. This system uses trackables and icons. The main idea is:
1 - when a player moves the mouse over a trackable a multiboard is created for that player that displays information about the race
2 - when the player clicks the trackable the race is selected and the games starts bla bla bla (you get the point)

Everything is going well so far, except for one little thing:
- How do I create a multiboard that is visible for only 1 player ? This is the only way I know for the system to be MUI.

I appreciate any possible help, and I give credits to people who help me solve this simple problem.

Thx in advance Flame_Phoenix.
__________________
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Sadly that optimizes to if true then....

JASS:
if GetLocalPlayer() == ThePlayerWhoShouldOnlySeeTheMultiboard then
    call MultiboardDisplay(mb, true)
endif

There is only one type of condition and as GetLocalPlayer() returns the player's who computer runs that native as it runs the native, it returns a different value for each PC who runs it. As only human players have PCs running it, it will not ever return the slot of a computer.
It is about the only native that returns a value that is not syncronized. Be careful when using it not to run any code that will result in the game going out of sync (desync).
 
There is only one type of condition and as GetLocalPlayer() returns the player's who computer runs that native as it runs the native, it returns a different value for each PC who runs it. As only human players have PCs running it, it will not ever return the slot of a computer.
It is about the only native that returns a value that is not syncronized. Be careful when using it not to run any code that will result in the game going out of sync (desync).
I see .. I assume that if desync happens, a crash will occur. Thx =)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
GetLocalPlayer() returns your PC. Basically, 2 players will ahev 2 different value for that native.

If you are red, then when your PC runs that line of code it will return Player(0). If the other player is blue, it will return for them when they run it Player(1). It will never return for you a player that you are not and that applies for them as well. Avoid even testing CPU slots with it as it will only ever return a player who is an actual human.

In your case, GetTriggerPlayer() must return the player who you are inorder for it to work.
 
Status
Not open for further replies.
Top