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

Adding Fly Height to Any Unit

Level 8
Joined
Jul 3, 2004
Messages
334
[highlight]DEPRECATED[/code]

» "How to Give a unit the ability to fly" by Magtheridon96 is the latest standard

THE FLYING TRICK

Difficulty
Easy - 3/10
Requirements
World Editor
Some knowledge of the Object and Trigger Editors
Procedure:

  1. Open the World Editor.
  2. Go to the object editor and create two spells: one based off of Metamorphosis and the other based off of Shockwave.
  3. Name the Metamorphosis spell "Fly Trick" and the Shockwave spell "Jump".
  4. Change the tooltips to whatever you want, then disable ALL DAMAGE PROPERTIES in the Shockwave spell, change everything that has to do with range AoE and other stuff to 0. In other words: the spell "Jump" is referred to as a dummy spell.
  5. Make the Alternate Unit Form for the Fly Trick spell a Gryphon Rider.
  6. Open the trigger editor.
  7. Delete the Map Initialization trigger and make a trigger named "Jump".
  8. Trigger Code:
    • Jump
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Jump
      • Actions
        • Unit - Add Fly Trick to (Casting unit)
        • Unit - Remove Fly Trick from (Casting unit)
        • Unit - Turn collision for (Casting unit) Off
        • Unit - Order (Casting unit) to Move To (Target point of ability being cast)
        • Animation - Change (Triggering unit) flying height to 500.00 at 500.00
        • Wait 0.90 seconds
        • Animation - Change (Triggering unit) flying height to 0.00 at 1500.00
        • Wait 0.90 seconds
        • Unit - Turn collision for (Casting unit) On
  9. Give the ability "Jump" to a unit.

NOTE: DO NOT GIVE "Fly Trick" TO ANY UNIT: METAMORPHOSIS CAN CAUSE ERRORS IN MAPS WHEN SET TO A DIFFERENT UNIT! YOU COULD GET A FATAL ERROR RESULTING IN LOSS OF DATA!


Conclusion:
  • Once you set the ability to the unit and remove it instantly, you can control it's flying height within that trigger.
 
Last edited by a moderator:
Level 2
Joined
Nov 3, 2004
Messages
9
i tested that trigger and thing.. the unit is walking to the point of the "ability thing" and then he jumps.. i thought he was gonig to fly to that point or something :D
 
Level 7
Joined
Oct 8, 2005
Messages
298
yo its easier to just do the following actions:

Actions:
*Add Crow Form to triggering unit
*Remove Crow Form from triggering unit

Use those actions instead of the meta ones. If u do that (without any waits commands between those two) u can alter a units flying height easier than useing meta.
 
Level 2
Joined
Nov 27, 2005
Messages
8
What I want to know is, why not just change the flying height using triggers, why add all that other junk? You could just make the unit's flying height=1. The player wouldn't notice it, and you could have the same effect.
 
Level 2
Joined
Nov 27, 2005
Messages
8
Ur right, it won't work, unless you actually give the unit a flying height. In this case, 1.
 
Level 4
Joined
Dec 10, 2005
Messages
73
Question. Must you add and remove that ability? Can't you just change the height straight off? Like when the dummy spell get clicked, the unit goes up then down but the players can move the unit where every they want it to be.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
well, if you did, the unit could fly over cliffs and stuff all the time, and i'm sure you don't want that!

Also, theres a bug with crow form. when you cast your jump spell( only with a hero ), if you manage to cast the crow form you are given, it will replace your hero with a level 1 hero. the old hero's stats will be added on to the new hero. Therefore-PAUSE THE UNIT
 
Level 1
Joined
May 6, 2006
Messages
2
Problem!

Ack, I'm having a problem with this trigger. I tried it out and whenever I use the spell to make the unit jump he moves instantly to the center of the map and then does the jump. Any insight on why this could be?
 
Level 1
Joined
Aug 1, 2006
Messages
2
Re: The Flying Trick

Step #8:
Code:
Jump
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        [b]Unit - Add Fly Trick to (Casting unit)
        Unit - Remove Fly Trick  from (Casting unit)[/b]
        Unit - Turn collision for (Casting unit) Off
        Unit - Order (Casting unit) to Move To (Target point of ability being cast)
        Animation - Change (Triggering unit) flying height to 500.00 at 500.00
        Wait 0.90 seconds
        Animation - Change (Triggering unit) flying height to 0.00 at 1500.00
        Wait 0.90 seconds
        Unit - Turn collision for (Casting unit) On


What I don't understand is why you simply add and then remove the spell, but you don't order the unit to use the spell. Does the spell automatically "use itself" somehow when you simply add and then remove it? Also, since you set the alternate form to a gryphon rider, won't your unit turn into a gryphon mid-flight?
 
Level 32
Joined
Oct 23, 2006
Messages
5,291
*revive*

i tested that trigger and thing.. the unit is walking to the point of the "ability thing" and then he jumps.. i thought he was gonig to fly to that point or something :D
I edited this tutorial some time ago and found that this problem is always the case, so I never approved the document.

Spell moderators: what's the correct solution to make the unit jump instantly instead of moving to a point?

At any rate, Waldbaer's flying system spanks the pants off this thing anyway. :p
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
The correct way is to create a infinate timer with a fire rate of about 0.05 seconds (less if you want it to look smoother than 20 FPS) and make it run a function that moves the unit to wards the target unit/point via using the SetUnitX/Y or other such functions. At the same time you change the units flying height at a insane rate to what the height should be at that segment of the jump. At half way to the point it starts to lose altitude and not gain it To get the height it is up to the fourmulas you make, it is easy to make a corner like jump but for a propper curved jump would require more advanced culculations. Sin can be usefull to make the curve since it returns a multiplyer that makes a curve based on input so all you need to do is input a number and multiply the maximum height by the output. Ofcourse the curve can be set by where you start / end and the off sets and stuff but I am not particually knowledged with non degree sin opperations as of the current.
 
Level 1
Joined
Jan 20, 2008
Messages
3
make attack when hitting ground

does anyoen know how to make it so when you come down from jump you can stomp the groud or attack or something?
 
Level 1
Joined
Jan 20, 2008
Messages
3
i dont know how to add dummy unit at end

im new to the we so i dont know how to make it make a dummy unit at the end and make the dummy use stomp
 
Level 1
Joined
Apr 1, 2008
Messages
7
humm... it dont work rightly.
If i want: jump on a cliff.... he runs arround ifs there a possible way to walk, it works only if theres no other way.

someone know how to fix that?
 
Level 2
Joined
May 24, 2008
Messages
10
Ack, I'm having a problem with this trigger. I tried it out and whenever I use the spell to make the unit jump he moves instantly to the center of the map and then does the jump. Any insight on why this could be?
the move trigger isnt set to "move to ability being cast" its set to "move to center of map"
if its not that than i dont know
 
Top