• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Z of a point/rec

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,229
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,229
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,229
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