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

[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