| 02-09-2009, 11:34 AM | #1 |
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. |
| 02-09-2009, 12:10 PM | #2 |
JASS:if GetLocalPlayer() == p then call MultiboardDisplay(mb, true) endif |
| 02-09-2009, 12:26 PM | #3 |
hã !? What is "GetLocalPlayer()" for ? and how do I detect him ? Also, If I use GetLocalPlayer() will the other players of the game also see the multiboard that was created? Sorry about so many questions, I never used that native before in my life =P |
| 02-09-2009, 12:48 PM | #4 |
| 02-09-2009, 01:20 PM | #5 |
Ah, thx for the link! However, won't that cause a desync ? (I dunno, you are the expert here) =P. |
| 02-09-2009, 01:27 PM | #6 | ||
Quote:
Quote:
|
| 02-09-2009, 01:42 PM | #7 |
JASS:if GetLocalPlayer() == p then call MultiboardDisplay(mb, true) endif JASS:local player p or JASS:local player p1 = Player(0) local player p2 = Player(1) local player p3 = Player(2) local player p4 = Player(3) if GetLocalPlayer() == p1 then call MultiboardDisplay(mb, true) elseif GetLocalPlayer() == p2 then call MultiboardDisplay(mb, true) //so on until player 4 endif |
| 02-09-2009, 02:21 PM | #8 | |
Quote:
|
| 02-09-2009, 02:34 PM | #9 |
You check GetLocalPlayer() against whatever player is currently triggering whatever it is that makes that multiboard show up. So... Just a really quick example: JASS:If GetLocalPlayer == Owner of Casting Unit then Show Multiboard Endif |
| 02-09-2009, 02:37 PM | #10 | |
Quote:
JASS:local player p = GetLocalPlayer() if GetLocalPlayer() == p then call MultiboardDisplay(mb, true) endif Correct ? |
| 02-09-2009, 04:26 PM | #11 |
No, if you are using trackables, the tracking player will be the triggering player: JASS:local player p = GetTriggeringPlayer() if GetLocalPlayer() == p then call MultiboardDisplay(mb, true) endif To avoid desyncs, you need all players to have the multiboard created and the text set, but only display it for the player you want. If you create a multiboard for each race and then hide/show them locally for each player, depending on what they track on, you will not have any problems. |
| 02-09-2009, 04:52 PM | #12 | |||||
Quote:
That seems quite complicated (multiboard thing). Anyway dismembering your sentence: Quote:
Quote:
Quote:
JASS:local player p = GetTriggeringPlayer() if GetLocalPlayer() == p then call MultiboardDisplay(mb, true) endif Quote:
The final retsult will be something like this: JASS:local player p = GetTriggeringPlayer() if GetLocalPlayer() == p then //call HideAllOtherMultiboards() call MultiboardDisplay(trackRace1, true) endif I feel like a baby on this, I am definitely discovering new terrain, I am sorry if my questions seem newb (well, they are) but I appreciate the help of all people involved and please don't get mad at me for not understanding things at first. |
| 02-09-2009, 06:46 PM | #13 |
Do not change the text locally (it may or may not work, I've never tested it. Would be nice if someone could confirm). Make each multiboard and then hide the ones that need to be hidden for the players. Your last block of JASS code should do what you want it to do. |
| 02-09-2009, 07:39 PM | #14 |
like this flame JASS:function Actions takes nothing returns nothing if GetLocalPlayer() == GetTriggeringPlayer() then call MultiboardDisplay( Multiboard1, true ) endif endfunction //... init function set Multiboard1 = CreateMultiboard() // ... setup multiboard stuff And you don't have to hide other multiboards, because multiboards are not displayed by default |
| 02-09-2009, 08:00 PM | #15 |
Thx for helps guys. You missed a small thing Kodo, when will have to hide all previous opened multiboards of the player, but now thx to you guys I have the image of what I need to do inside my head. Thx all. I will keep this thread updated. As for now, +rep to all for being nice guys/girls (well, who knows?) =P |
