- Joined
- Jun 16, 2009
- Messages
- 9
The only thing I could find on detecting height of units on land, was this.
What I need to know, is what do I do with this little script? What do I need to change and what do I add to it to make it work. And most importantly, Does it even do what I'm looking for?
I need to detect how High or how Low a unit is, if a unit is below my water table by a certain ammount, I want him to slow down (waist deep) but if he is above his head, I want him to take damage.
and
I also had an idea about detecting how steep a hill was, and if its a rediculous angle making the unit not able to climb it and force them to turn around.. so something like..
I would love for someone to atleast give me some advice on what to do, if theres some sort of template map or script somewhere else I should refer to.
if a kind soul tosses a script to me, please explain what values I need to change to make the script work correctly for detecting a unit, and perhaps even a way to implement it if needed.
JASS:
library GetUnitZ
globals
private location tempLocation = Location(0., 0.)
endglobals
function GetTerrainZ takes real x, real y returns real
call MoveLocation(tempLocation, x, y)
return GetLocationZ(tempLocation)
endfunction
What I need to know, is what do I do with this little script? What do I need to change and what do I add to it to make it work. And most importantly, Does it even do what I'm looking for?

I need to detect how High or how Low a unit is, if a unit is below my water table by a certain ammount, I want him to slow down (waist deep) but if he is above his head, I want him to take damage.
Code:
if zvalue of triggering unit >= X giveability slowmovement
Code:
if zvalue of triggering unit >= X giveability drowning
I also had an idea about detecting how steep a hill was, and if its a rediculous angle making the unit not able to climb it and force them to turn around.. so something like..
Code:
if zvalue of triggering unit >= X move triggeringunit towards facing degrees of unit -180 degrees
I would love for someone to atleast give me some advice on what to do, if theres some sort of template map or script somewhere else I should refer to.
if a kind soul tosses a script to me, please explain what values I need to change to make the script work correctly for detecting a unit, and perhaps even a way to implement it if needed.