HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Flying Units Ignoring Cliffs and Raised Terrain?

11-03-2007, 06:38 PM#1
Kratos
Is there anyway to adjust a units pathing so it ignores cliffs and raised terrain height adjustments? I want to create a projectile that ignores both without having to work around it by creating a trigger that detects a cliff hight and then lowers a units flying hight -200 for each cliff level. Another problem with that is I see now way of doing the same with raised terrain, a map thats just a flat desert simply doesn't look good. Any help would be appreciated.
11-03-2007, 06:59 PM#2
Earth-Fury
JASS is the key to making projectiles move across terrain realistically.

A map has absolute Z coordinated for all points in the coordinate space. There are a few things that allow you to create good 3D movement:
  • call MoveLocation(MyGlobalLocIsNeverDestroyed, x, y) then GetLocationZ(MyGlobalLocIsNeverDestroyed) This gives you the Z height of the terrain at the target location. Handle creation is slower than moving a location, so you just reuse a single location.
  • GetLocationZ(UnitsPosition) + GetUnitFlyHeight(u) A unit's exact Z location.
  • UnitsAbsoluteZPosition - GetLocationZ(UnitsPosition) The height of something off the ground, as opposed to its exact Z position. This would be the desired flying height of a unit at UnitsPosition.
  • SetUnitX(u, 42) SetUnitY(u, 42) These 2 functions cause a unit to be moved to the target X and Y cords, ignoring pathing. (these functions can also move units outside of the game area, which causes WC3 to crash hard. just make sure units stay on the map itself)
  • The Crow Form ability. Add this ability to a ground unit, remove it from the unit, and change the units flying height as much as you please for all eternity! Why do you HAVE to use ground units? Flying units have height smoothing, which means as they pass over terrain, they move up and down to glide smoothly over it. Ground units effected by the crowform trick do NOT have their heights smoothed.

Hope this helps.
11-03-2007, 07:00 PM#3
cohadar
Nope.

You need to use GetLocationZ()

Someone should make a tutorial on that btw,
people keep asking this question...
Flying Units Ignoring Cliffs and Raised Terrain? - Wc3C.net