IntroductionThis is my first tutorial on blizzardmodding, but I have been around the editor messing around for GUI for one year now (@hiveworkshop) and I thought I might share this tutorial with you guys.I made this tutorial since I think way to few people know that this exist in GUI, so I want to show you how to use "GetLocalPlayer" in GUI.

What is needed?Decent knowage of GUI triggering.Very basic jass knowage.A few moments of your time.

What is GetLocalPlayer?

GetLocalPlayer is a method to create certain things/stuff in JASS, but I will show you how to use this method in the GUI.This method will allow you to create this thing/stuff [special effects, multiboards, floating text, etc] for the player of your choise only.For example, you can show a multiboard to player 1 only, while the other player wont see any multiboard at all!

That sounds awesome how do I use this?As one example I will create a multiboard for player 1 only, you can use any event you want.

NOTICE! We use a player variable named "GetLocalPlayer" or "Player" based on wich way you want to use. but you can name it whatever you want.

This is the way I recomend for GUI users, you only set only single line JASS in the init trigger and then you can use that variable the whole game!

After that we instantly hide it so no player never saw that multiboard.

Trigger: Test 275165098

Multiboard - Hide (Last created multiboard)

Now the the hard part, now we use a custom script since the action does not exist within the GUI. It stores the player returned from the GetLocalPlayer() function inside your player variable.

Trigger: Test 2096221854

Custom script: set udg_Player = GetLocalPlayer()

And lastly we just select wich players we want it to be showed to, in this case it will ONLY be showed to player red (1) aint that awesome?NOTICE! The jass and the GUI version is just the same you can use any of them!NOTICE! In jass the player index is between in 0-11 insted of 1-12 in GUI!

Trigger: Test 424914386

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

Player Equal to Player 1 (Red)

Then - Actions

Multiboard - Show (Last created multiboard)

Else - Actions

Trigger: Test 1422706232

Custom script: if GetLocalPlayer() == Player(0) then

Multiboard - Show (Last created multiboard)

Custom script: endif

Great, but can I do the same to other things?Yes you really can, lets take special effects.Again I show you the same three ways nothing new with the method.

Trigger: Test 1868393970

init

Events

Map initialization

Conditions

Actions

Custom script: set udg_GetLocalPlayer = GetLocalPlayer()

Trigger: Test 339798910

special effect trollbrain way

Events

Player - Player 1 (Red) skips a cinematic sequence

Conditions

Actions

Set Effect = <Empty String>

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

GetLocalPlayer Equal to Player 1 (Red)

Then - Actions

Set Effect = Abilities\Spells\Other\TalkToMe\TalkToMe.mdl

Else - Actions

Special Effect - Create a special effect attached to the overhead of Peasant 0001 <gen> using Effect

Trigger: Test 371870497

Special effect for one player jass

Events

Player - Player 1 (Red) Presses the Right Arrow key

Player - Player 2 (Blue) Presses the Right Arrow key

Conditions

Actions

Set Effect = <Empty String>

Custom script: set udg_Player = GetLocalPlayer()

Custom script: if GetLocalPlayer() == Player(0) then

Set Effect = Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl

Custom script: endif

Special Effect - Create a special effect attached to the overhead of Peasant 0001 <gen> using Effect

Trigger: Test 1398089573

Special effect for one player

Events

Player - Player 1 (Red) skips a cinematic sequence

Conditions

Actions

Set Effect = <Empty String>

Custom script: set udg_Player = GetLocalPlayer()

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

Player Equal to Player 1 (Red)

Then - Actions

Set Effect = Abilities\Spells\Other\TalkToMe\TalkToMe.mdl

Else - Actions

Special Effect - Create a special effect attached to the overhead of Peasant 0001 <gen> using Effect

As you see I use the same system, but I will explain the new actions for you anyway.

Here I simply store a string variable into nothing, this means if the player aint the player I want it to be there wont be any effect. (you will see later).

Trigger: Test 1745746216

Set Effect = <Empty String>

Here We check if the player is player red (1) and then we set the string variable to the question mark effect path.

Trigger: Test 515511296

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

Player Equal to Player 1 (Red)

Then - Actions

Set Effect = Abilities\Spells\Other\TalkToMe\TalkToMe.mdl

Else - Actions

And after that we create the effect simple as that.

Trigger: Test 1710343315

Special Effect - Create a special effect attached to the overhead of Peasant 0001 <gen> using Effect

DesyncronizationDesyncronization only exist in multiplayer due you need both a host and a client to make this happen, it causes clients playing the map do disconnect from the game.Thats why you must keep this in mind, ifpossible do only use the GetLocalPlayer in conditions.So if it does desync don't use it, if it does not desync you can just enjoy the game.

NOTICE! Handles that have their own stack will never desync!

1. Fade filters for 1 player only

Question - this cause desyncronization?Answer - No

2. Quest for 1 player only?

Question - this cause desyncronization?Answer - Yes but if u use Enable/Disable quest then No

Question - this cause desyncronization?Answer - YesNote - It might not desync if (1) it is a non hero unit and (2) the two units have only differences in art fields/physical display (such as model or icon) - by PurgeandFire111

14. Weather effect off for 1 player?

Question - this cause desyncronization?Answer - No?

15. Desctructible visibility, for 1 player only?

Question - this cause desyncronization?Answer - ?

Creditsshadowvzs - The list of what does desync and notHashjie - Telling me info about GetLocalPlayer and the idea to this tutorialTroll-Brain - awesome tip to improve the tutorial

Not on purpose, it says "scripting tutorials" when I clicked it and I thought that maybe included GUI.Anyway there is no other place where it suits at all, and I asked Sonofjay if GUI tutorials was accepted here on blizzmodding

What's this site?

Here is the place where making your favorite games can be possible, with the support of a cordial and warm community. Here you will find resources that will help you develop your projects in an effective and agile way. In addition, you can show your projects, share your ideas or simply contribute with resources to establish bonds with a growing community, forming in the process the network of fanatic users to do Modding and mapping Warcraft 3.