HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Fixed fly height for dummy units?

02-27-2009, 05:41 PM#1
Na_Dann_Ma_GoGo
Hey there,
I would like my dummy projectile to fly straight on when they reach an abyss ,I made with the terrain lowering tool, instead of losing height rapidly. However I fail getting the right functions / calculations.
Thus I hope that you could to tell me how I get that working (in vJASS).

Thanks in advance.
02-27-2009, 06:30 PM#2
Opossum
First you'd have to add and remove the ability 'Arav' to/from the dummy unit so that the unit doesn't use this flying height smoothing which is neat for normal flying units but usually screws up projectiles:
Collapse JASS:
call UnitAddAbility(u, 'Arav')
call UnitRemoveAbility(u, 'Arav')
Doing this will result in GetUnitFlyHeight() returning the unit's Z above the terrain.
As a unit's flying height is just a z-offset to the terrain under the unit you'd have to add the terrain height difference to the unit's flying height. If you're moving the projectile by hand (i.e. a periodic timer) you can just set the unit's flying height to call SetUnitFlyHeight(u, GetUnitFlyHeight(u)+dz, 0) where dz is the z-difference of the current unit location and the location the unit is being moved to.

If you're not moving the projectile via timer though you might have to make a periodic timer and every now and then adjust the unit's flying height like described above.

You can also just use one of the projectile systems on this forum :).
02-27-2009, 06:38 PM#3
xombie
I'm not entirely sure (maybe 'Arav' works too) but back when I learned the bug it was specifically 'Amrf'. Opossum has the right idea, I'll let him help ya.
02-27-2009, 06:47 PM#4
Na_Dann_Ma_GoGo
Ah thanks guys, that sounds good ;P
Gonna test it soon.
02-27-2009, 08:38 PM#5
Opossum
Quote:
Originally Posted by xombie
I'm not entirely sure (maybe 'Arav' works too) but back when I learned the bug it was specifically 'Amrf'. Opossum has the right idea, I'll let him help ya.

'Amrf' will probably work too. It's just Medivh's version of the night elf Storm Crow Form.
02-28-2009, 03:43 PM#6
Na_Dann_Ma_GoGo
Works smooth now, +Rep both.