| 09-10-2004, 08:09 PM | #1 |
Hey, I'm not quite sure, but are multiboards capable of being different for each player? That is, I'm trying to divise a multiboard with the stats for the abilities for each player but only visible to that player.. so player A, has spell 1 and spell 2, and player B has spell 4. Player A sees 2 mlutiboards, one for spell 1 and 2, and player B sees only one multiboard for spell 4. Iread somewhere about using some kind of event - local player or soemthihng, but I can't find that anywhere in the triggers. JASS solution would also be great. |
| 09-10-2004, 08:18 PM | #2 | |
Quote:
Ah wait, I found something: function DisplayMult takes player p returns nothing if(GetLocalPlayer() == p) then call MultiboardDisplay(udg_YourMultiboardArray[GetPlayerId(p)+1]) endif endfunction I'm still a bit unclear as to why MultiboardDisplay would supposedly show the multiboard to only that specified player p, and not to everyone? As well, how feasible is it to have multiboards show/hide based on what hero you have selected. Ie, if you have two heroes, and I select hero 1, then it'll display the spell leaderboards for that hero. But if I select hero 2, then it'll hide those, and dispaly the respective leaderboards for that hero? I'm wondering if that will work with 10 players, 2 heroes each, in a multiplayer game. thanks |
| 09-10-2004, 09:24 PM | #3 |
well you cant show 2 multiboards at once. but you can hide one then show the other. just use hide/show trigger. |
| 09-11-2004, 02:16 AM | #4 |
The trick is the if with GetLocalPlayer. That native is special in the way that on the computer of player 1 it returns player 1, on the one of player 2 it returns player 2. The code within that if is therefore only executed on one computer, instead of on all (as most code). Be careful though with that as it can easily desync the game if you do the wrong things in there (like creating a unit). |
| 09-11-2004, 02:48 AM | #5 |
Yea GetLocalPlayer() is has its buggs. Dont use it everywhere or else it will cause disconnections or server splits. Just make sure you confirm with JASS experts on every function that uses GetLocalPlayer(). ![]() |
| 09-11-2004, 11:57 AM | #6 |
That has nothing to do with bugs in GetLocalPlayer(). It is just a matter of understanding what GetLocalPlayer() actually does then you know when to use it and when not. The important thing is that the code in that if needs to be local. |
