• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

GetLocalPlayer and Key (handle)

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
Firstly, if i assign a global using GetLocalPlayer, will it cause a desync and/or apply the variable change for more than the local player?

Also, i see people using in hashtables stuff like Save 1 of Of(Triggering Unit) or Key(Triggering Unit). When i try to do it, it asks for a handle variable. How do i get it to triggering unit

also, is ther a working respawn system anywhere
 
For the get local player action, it will assign a different value to the variable for each player. For example:
JASS:
local player p = GetLocalPlayer()

Will assign Player 1 (red) to p for Player 1 (red), Player 2 (blue) to p for Player 2 (blue), etc... It will not necessarily desync, you just have to use it with the same caution that you would give to using GetLocalPlayer() by itself.

For the second question, as far as I know JNGP editor doesn't have the options to choose for the handle input. You must either use the regular editor or just do:
  • Custom script: set udg_MyInt = GetHandleId(GetTriggerUnit())
And then use udg_MyInt instead of Key(). [they are the same thing]
 
Status
Not open for further replies.
Top