• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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