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

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.
 
Level 9
Joined
Jul 3, 2008
Messages
495
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.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
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.
Top