• 🏆 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!

[JASS] GetLocationZ Problem

Status
Not open for further replies.
Hello there again >.>

It seems that, when GetLocationZ is used on water, it returns the height of the water surface. That's kind of weird to me o.o'

Is there a way to get the exact Z coordinate of the bottom of the water?

Or if you have any suggestion of how to make a dummy unit travel above the water without changing its height... Now I'm trying to add the negative height (water is always Z < 0) to the current fly height of the dummy, which would compensate the height decrease, but with the GetLocationZ problem it's been difficult...
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
Use these two functions:
JASS:
function IsShallowWater takes real x, real y returns boolean
    return not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_AMPHIBIOUSPATHING)
endfunction

function IsDeepWater takes real x, real y returns boolean
    return IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_AMPHIBIOUSPATHING)
endfunction
If the function IsShallowWater returns true, you just add 128. to the height of the dummy. If IsDeepWater returns true, you just add 256. to the height of the dummy.
I think this will work.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
This has something to do with either a dummy unit's movement as walking or as floating. Try interchanging the two and getting the height. I know this fixed some problems that I had. If you want more info, ask Poot or something because he's the one who told me about this in the first place.

Or maybe I'm wrong.
 
Status
Not open for further replies.
Top