• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Precisely setting a -flying- unit's flyheight

Status
Not open for further replies.
Level 6
Joined
Jun 18, 2004
Messages
119
Hello,

I am trying to set a flying unit's FlyHeight to a precise value. I need it to have flying pathing, because I want it to use the pathing blockers for flying units only.

The problem is: flying unit's height gets smoothed if there's uneven terrain nearby. I want the flying height to be exactly what I set it to, like it if for "ground" units with the 'Amrf' trick.

Is there some sort of hack, or does anyone know the formula which blizzard uses to calculate the Z increase (in a similar fashion to this: http://www.hiveworkshop.com/forums/jass-resources-412/system-getcamoffset-131434/)

Thanks,
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
I think it involved making the unit "floating" or something like that.

Setting the fly height considering the terrain Z is the way to go.
Cliffs and doodads (or was it destructibles?) provide some form of fly height deformation which makes units fly higher than simply considering the terrain Z.

Apparently "float" movement ignores this deformation (useful for absolute height missiles) but that probably is not flying so not viable for your purpose.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
I think it involved making the unit "floating" or something like that.


Cliffs and doodads (or was it destructibles?) provide some form of fly height deformation which makes units fly higher than simply considering the terrain Z.

Apparently "float" movement ignores this deformation (useful for absolute height missiles) but that probably is not flying so not viable for your purpose.

It can be Usable if we add'n'remove 'Arav'.
 
Level 6
Joined
Jun 18, 2004
Messages
119
Thanks guys,

I got it to work with float and naval pathing.

EDIT: well, not quite. Floating units are also blocked by ground pathing blockers...

Is there a way by which I can let floating units pass, while blocking normal ground units?
 
Last edited:
Level 17
Joined
Dec 11, 2014
Messages
2,004
Thanks guys,

I got it to work with float and naval pathing.

EDIT: well, not quite. Floating units are also blocked by ground pathing blockers...

Is there a way by which I can let floating units pass, while blocking normal ground units?

That requires a Custom pathing System.

You can use IsPointWalkable by PurgeandFire as well.
 
Level 6
Joined
Jun 18, 2004
Messages
119
Actually, I found a slightly non-elegant solution:
JASS:
//! externalblock extension=lua PathMapper $FILENAME$
    //! i function all(tileid, cliff, layer)
    //! i   return true
    //! i end
    //! i function setwaternofly()
    //! i   if not isflagset(nofly) then
    //! i       removeflags(nowater)
    //! i   end
    //! i end
    //! i registercallback(all,setwaternofly)
//! endexternalblock
this turns the entire map pathable for floating units, except where the map has flying blockers (only doodad based, not destructable). This problem is now "solved" :) Thanks for the help.
 
Status
Not open for further replies.
Top