• 🏆 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!

[General] How to make unit fly with trigger?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Is this possible?
Yes.

For real flying use a morph ability like used by the druid of the talon. This can change a unit from a land unit type into a flying unit type.

Triggers can just pull the unit across un-pathable terrain by turning off its collision and moving it every frame. Use the flying trick (add and remove crow form) to allow you to set apparent flying height with triggers.

something connected to change height?
Flying height has nothing to do with flying movement. You can make a land unit appear to be high in the air but it will still be stuck moving on land pathable areas.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
If the unit is an air unit, simply change flying height using the appropriate native.
If the unit is a ground unit then you need to add and remove the crow/raven form ability. You can then change the flying height.

The native to set flying height...
JASS:
native SetUnitFlyHeight takes unit whichUnit,real newHeight,real rate returns nothing
There is also a GUI action wrapper for it. I forget if it is under unit or art however.
 
Level 5
Joined
Jan 27, 2014
Messages
164
Animation - Change unit flying height.

As mentioned, ground unit can't just change height readily with the above trigger action. You'll need to add Storm Crow Form to the ground unit and remove it. Then you can change the fly height.

Example:
Code:
Unit - Add Storm Crow Form to YourUnit
Unit - Remove Storm Crow Form from YourUnit
Animation - Change YourUnit fly height to 600 at rate 0
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
so i dont need crow form
I am sorry there has been a slight misunderstanding.

Ground units cannot have flying heights by default (always flying height of 0). Trying to change their flying height using triggers does nothing for this reason.

However, if you add and remove crow/raven form (whatever) it sets some internal unit property that turns on flying height allowing you the alter the flying height of the unit. This is likely done as part of the ability to allow the smooth land->air transition. Due to a bug the flag is not removed with the ability. As such this is an exploit that allows you to give ground units flying height. As far as atomic state goes to the user, he will never have the ability as it is removed the instant it is added. A unit only needs to have the ability added and removed once during its life, not each time you want to change height.

People refer to this as the "Flying Trick".

I can't find the GUI change height. Can someone tell me where exactly is?
  • Animation - Change (Triggering unit) flying height to 0.00 at 0.00
 
Status
Not open for further replies.
Top