Check terrain slope.

Status
Not open for further replies.

EdgeOfChaos

E

EdgeOfChaos

Hi, I am wondering if there is any way to check terrain slope created by Raise and Lower.

Specifically, I want to check if the user is going uphill or downhill, and adjust an integer accordingly.

Is there any way to do this? Also I would need to get the size of the slope.

Thanks.
 
you can check the height of the unit. Higher than 0 is uphill and bellow 0 is downhill. At least I think it works that way.

A unit bellow zero can still walk uphill. I think you need to do two terrain height check.

First check the height of the unit, and then in front of the unit.
If the height in front is greater than the units, then it walk uphill.
 
Actually I think you need 3 checks because unit can be at the edge of hill.Position of unit, in front of unit and behind of unit.For example assume U is your unit, and - is terrain.
JASS:
                       ---
                    U----
-----------------------

But the difference will be so minimal between 2 and 3 checks so i dont think it matters.
 
Status
Not open for further replies.
Back
Top