• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

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:
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
 
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.
 
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.
 
Ur right, it won't work, unless you actually give the unit a flying height. In this case, 1.
 
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.
 
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
 
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?
 
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?
 
*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
 
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.
 
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?
 
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
 
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?
 
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
 
Back
Top