• 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.

Z of a point/rec

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Yes you can use the native below. However do note the results are not deterministic so walkable destructibles and having both Mac and Windows users in the same session can cause an Out of Synchronization game split.

JASS:
native GetLocationZ takes location whichLocation returns real
It is called like below...
JASS:
set udg_real = GetLocationZ(udg_location)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Thank you very much, could you give me that in a GUI custom script?
No because there is no such thing as "GUI custom script". WC3 only works using JASS and GUI compiles to JASS on map save. Even JNGP compiles vJASS to JASS on map save. As such I am afraid all I can do is give you what I already have.

JASS:
set udg_real = GetLocationZ(udg_location)
make a global real called "real" and a global location (I believe GUI calls this "point"?) called "location" and the above line will compile.

How you enter the line is up to you, it could be in a GUI custom script action or within a custom script function, the choice is yours.

Feel free to change variable names to fit your scripting style. Recall that all GUI globals start with the prefix "udg_" followed by their name with any white space (' ') changed to an underscore ('_').
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
What is important is that you make a note somewhere that this could be a possible de-synchronizations cause in your map when played in multiplayer. If you run into problems with people falling out of synchronization later it is important you can track it down to try and mitigate it to some degree. Many multiplayer maps have successfully used GetLocationZ without issue while some have had issues.
 
Status
Not open for further replies.
Top