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

[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