| 02-10-2004, 03:51 AM | #1 |
I've noticed in the Map Development forum that many questions arise asking "How do I make a multiboard show to only 1 player?" and I've seen the same answer 5000 times. The simplest way to do it, in my opinion, is this... Make a variable called LocalPlayer. Make a new trigger called "Local Player Setup" Code:
Events: Time elapsed is 0.01 seconds Conditions: Actions: set udg_LocalPlayer = GetLocalPlayer() The above is a custom script action. Now, make a new trigger called "Multiboard For PlayerX(s)" Code:
Events: Elapsed time is 0.02 seconds
Conditions:
Actions: If Then Else Multiple Conditions
Conditions: If LocalPlayer = Player1
Then Actions: Create a multiboard with x columns and y rows.
----CREATE ALL YOUR MULTIBOARD ACTIONS HERE---
Set Multiboard[1] = last created multiboard
Show Multiboard[1]
Else Actions:That should be it. And no, it won't show it for everyone. |
| 02-10-2004, 06:34 AM | #2 |
Code:
Events: Time elapsed is 0.01 seconds Conditions: Actions: set udg_LocalPlayer = GetLocalPlayer() That will immidiately cause a desync. What you really have to do is (in Jass): Code:
if(GetLocalPlayer()==Player(1)) then //show multiboard endif Also, you have to make a premade multiboard for every player because you cannot edit global variables in a GetLocalPlayer() bloc. You can however display these MBs for local players. |
| 02-10-2004, 02:56 PM | #3 |
What I can say is that the BJ Multiboard functions that came with patch 1.13 (the ones that are present in the normal editor) cause net traffic, so they will obvously desync, you need to use the native multiboard function that show. The easiest way would be: Code:
Custom Script: call MultiboardDisplay( udg_multiboard, udg_player == GetLocalPlayer()) replace udg_multiboard with the multiboard and udg_player with the player you'll want to show the multiboard Code:
Custom Script: call MultiboardDisplay( udg_multiboard, IsPlayerInForce(GetLocalPlayer()) , udg_playergroup) That last one will do the same but for a player group Use any of them after you create the multiboard |
| 02-10-2004, 06:37 PM | #4 |
Well, I understand that, and you guys forget to point out that it's also unstable and causes player split/server split. But, I just wanted to point out a way on making Multiboard Triggers to display to 1 player. |
| 02-11-2004, 11:37 PM | #5 | |
Quote:
No it won't. I have the exact same statement in my map and it works fine. |
| 02-11-2004, 11:49 PM | #6 |
Everytime I use that - I get 50% server split... I dunno why, must be my triggering I guess. I'ma try it over. |
| 02-12-2004, 02:59 AM | #7 |
Try doing it on Map Init instead. |
| 02-12-2004, 09:20 PM | #8 |
Well, I did it a bit differently, and used Map Init - it worked though... Dunno why my other one didn't work, oh well. |
