| 02-04-2004, 12:57 AM | #1 |
I searched for this, I found a thread very similar but it must've been taklking about an advanced editor... so here's my question: How can I show a multiboard to only one player? |
| 02-04-2004, 01:19 AM | #2 |
I'll make it easy for you: Make a new global variable called "LocalPlayer" Add this to a trigger that runs on map init: Custom Script: set udg_LocalPlayer = GetLocalPlayer() Then, when you make your multiboard, set it up like: If (LocalPlayer is equal to (the player you want)) Then Do... (Your multiboard creation triggers) Else Do Nothing Hope I made that easy. |
| 02-04-2004, 01:22 AM | #3 |
But still, won't that show the multiboard for everyone? If I create a multiboard, doesn't it show for everyone? and one more thing, What does the GetLocalPlayer() function do? I've got a vague Idea, but can you describe it? |
| 02-04-2004, 01:29 AM | #4 |
GetLocalPlayer() does exactly what it sounds like: Gets the local player. Say I'm playing a game and I'm player 1. LocalPlayer would equal Player 1 for me. For my buddy player 2, however, it would equal player 2. That's why it works. If you want to display it for player 1 only, then essential you are checking this: If GetLocalPlayer() (Player 1) is equal to Player 1 Then (Create your multiboard) Else Do Nothing End If On player 2's machine the if statement would run as: If GetLocalPlayer() (Player 2) is equal to Player 1 Then (Create your multiboard) Else Do Nothing End If Obviously player 2 is not player 1, and that's why it doesn't create the multiboard for player 2 (or any other player that isn't player 1.) Edit: To elaborate more, in case you didn't understand that: The reason you create a multiboard for everyone is because the trigger to create the multiboard runs on everybodies computer. This trigger ensures that it only runs on the player's computer that you want the multiboard to show up on. |
| 02-04-2004, 01:54 AM | #5 |
That's what I thought, I just didn't think of it in that way.. thanks. I thought it would still run on everyone's comp, like it would when you picked every player... that's a cool function to know... Ok, thanks a bunch. |
| 02-04-2004, 02:04 AM | #6 |
Actually, don't have your create multiboard triggers with GetLocalPlayer(). Only use show Multiboard actions there. |
| 02-04-2004, 02:32 AM | #7 |
I just tested a quick map and apparently when you create a multiboard it is shown automatically. Untitled Trigger 001 Events Time - Elapsed game time is 0.00 seconds Conditions Actions Multiboard - Create a multiboard with 1 columns and 1 rows, titled test board Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to test text |
| 02-04-2004, 08:58 AM | #8 |
Yes, that happens becouse the functions Blizzard added are changed to be friendlyer for beginners. So they add alot of functionality to each function (f.ex. instead of just creating a multiboard with the create function, it also displays it AND sets the row# and column#). I also think it's generally better to create the multiboard globally (not in a local if) and then only display it in a local statement... as local statements should be kept to a bare minimum, cause else you'll likely end up with de-sync (that is, if you don't know what you're doing). But as is obvious now, it's now harder to "just" display it inside a local statement in GUI now. So, you can then likely just do as ph33rb0 said and create the whole multiboard in a local if-statement, or just simply after creating the whole multiboard (for everybody) just hide it (show/hide) for the players who shouldn't see it (using local-statement) Cubasis |
