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

[Trigger] How do u make a jump spell?

Status
Not open for further replies.
Level 3
Joined
Oct 17, 2006
Messages
43
i understand adding crow form will enable a unit to be able tochange its flying height. Ive tried alot of things and i cant get a decent jump spell. Im trying to get a unit to jump to an area and i mid air do attack animation but slowly so it plays animation over the jump period. I cant figure out how to do this some1 please help? :witch_doc_sad:
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Hmm, if it's the animation that's getting to you, just play the animation from the start of the jump, while using the command

Animation - Set (unit) Animation Speed to (percent)

to have the animation play in a correct time frame (which, of course, you will have to determine, and set (percent) accordingly, remembering that 100% is normal.)
 
Level 13
Joined
Jun 22, 2004
Messages
783
There is no real need to add crow form, you just have to make the unit flyable in order to move it up and down, moving it up and down can be done with an action called

"Animation - Change Unit Flying height"
 
Level 11
Joined
Jul 12, 2005
Messages
764
Sry, but you're wrong. If you want to change the unit's fly height with that function (action), the unit must be a flying one. Ground unit's fly height cannot be changed, unless you give them the Crow Form ability. But due to a bug (or i don't know why), the effect of giving the unit the ability stil remains after you remove ability.
Add Crow Form to [unit]
Remove Crow Form from [unit]
If you include this in the trigger, a ground unit's fly height can be changed.
 
Level 8
Joined
Dec 26, 2006
Messages
327
Im Lost Guys..

i gave the unit Storm crow Form

I change its hieght and moved it instantly to the target location

i lowered its height so it looks like its landing

i've changed the speed of animation

Ive made special effects at the target location

All i get is a crappy version of blink... CAn u please help!
 
Last edited:
Level 11
Joined
Jul 12, 2005
Messages
764
Hey um, doesn't hover count for flying height?

BTW: Your spell packs glitch and I can't open them...
A hovering unit is just above the ground, but cannot fly through trees and such. It's not the same.
My spell packs at wc3search? The whole system is down now, read the news. None of the spells can be downloaded...


pandamana, here is how i trigger my "jump-like" spells (only the movement trigger):
Event - Every 0.1 seconds
Action -
If (Flying height of UnitVar) is less than 500
-Set UnitVar's fly height to (Flying height of UnitVar)+10
Else
-Set UnitVar's fly height to (Flying height of UnitVar)-10
--If (Flying height of UnitVar) is less than (Default Flying height of UnitVar)
---Set UnitVar's fly height to (Default Flying height of UnitVar)
Set UnitVar's position to blahblah...
...
Turn off this trigger
 
Level 3
Joined
May 28, 2005
Messages
47
OK I have a jump spell that works, only the is no movement in air etc...

I will edit in the code.


EDIT// Added attack animation.

Code:
Jump
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Jump 
            Then - Actions
                Set Jumper = (Casting unit)
                Set Position = (Position of Jumper)
                Unit - Pause Jumper
                Unit - Turn collision for Jumper Off
                Unit - Add Crow Form to Jumper
                Animation - Change Caster's animation speed to 30.00% of its original speed
                Trigger - Turn on Jumping <gen>
                Animation - Play Caster's attack animation
                Animation - Change Jumper flying height to 800.00 at 900.00
                Wait 0.60 seconds
                Animation - Change Jumper flying height to 0.00 at 800.00
                Wait 0.50 seconds
                Trigger - Turn off Jumping <gen>
                Unit - Remove Crow Form from Jumper
                Unit - Unpause Jumper
                Unit - Turn collision for Jumper On
                Set Jumper = No unit
                Custom script:   call RemoveLocation(udg_Position)
            Else - Actions



Code:
Jumping
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set Position = (Position of Jumper)
        Unit - Move Jumper instantly to ((Position) offset by 3.00 towards (Facing of Jumper) degrees), facing (Facing of Jumper) degrees
        Custom script:  call RemoveLocation(udg_Position)


To make the Jumper go farther just make the offset bigger, to make distance less make offset smaller. Simple enough :D
 
Last edited:
Level 13
Joined
Jun 22, 2004
Messages
783
It's good but a few key elements are missing, like said before, a jump is based upon gravity what you guys do is making a unit go up and down, which means the unit will not make a jump, but go up in a strait line and go down in a strait line as well.

Then there is another things, if you use custom scripts to reduce memory leaks, do it good, cause now your making about 220 memory leaks in that jump.

Then my final note would be not to use waits under 1.00 seconds, for they are very inacurate.
 
Level 11
Joined
Jul 12, 2005
Messages
764
Thats not a jump you got there paskovich, it going up and down, a jump is based upon gravity.
:D What do you mean by "a jump is based upon gravity". :D It makes no sense.
And shit! I'm trying to help! I've made several spells that include parabolic movements, i know all the craft of it, but they are all in JASS, and use timers and handle vars. I could post a code here, but I'm afraid it would be useless to you...


About the Jump code by blackchoas:
1. Why don't you use the Conditions part of the trigger?
2. Why do you store a location into a variable if you do not even use it? Or you just want it to look like a leakless trigger? Because the periodic trigger creates 2 location leaks every 0.01 seconds.
3. Believe me when I say you don't need to pause the unit while it's in the air. If you move a unit with 'Move unit to position', the unit stays still for a moment! But if you move it every 0.01 secs, it will be unable to move.
4. Also believe that you can remove the Crow Form instatly right after you added it to the unit, the effect will still remain, but the spells (clickable) icon will disappear.
 
Level 3
Joined
May 28, 2005
Messages
47
I wasn't going to give the guy a page long trigger with 15 variables to confuse him and at least 6 custom scripts which he will not know what to mess with. I just gave him a basic jump. I'm pretty sure he will survive with a not-leakless trigger. Please, the people on bnet playing his game, won't care and leave the game if the trigger is not leakless. The guy needs something he can understand not a trigger that he will just use with no understanding, and possibly if any bugs not be able to fix later on.
 
Level 3
Joined
Oct 17, 2006
Messages
43
Alright well the reason i asked is becuz i made a jump spell a long time ago and i was going to polish it up. Well i released a dark hero spell pack check it out its from 1 year ago, my frist spells.
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
These two triggers are GUI recreation of a jump effect which worked when I tested it on my map.

Global Variables:
LandingSpot - Point
Airheight - Real
Angle - Real
Distance - Real
JumpLength - Real
Jumper - unit

All values are 0 / -none -


Trigger 1: Jump

Clone a spell which has the ability to target the ground and NOT units

  • [box="Jump"]Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Jump
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Jumper Not equal to No unit
    • Then - Actions
      • Wait until (Jumper Equal to No unit), checking every 0.10 seconds
    • Else - Actions
  • Set Jumper = (Triggering unit)
  • Set LandingSpot = (Target point of ability being cast)
  • Set Angle = (Angle from (Position of Jumper) to LandingSpot)
  • Selection - Remove Jumper from selection
  • Unit - Pause Jumper
  • Unit - Add Crow Form to Jumper
  • Unit - Turn collision for Jumper Off
  • Set Distance = (Distance between (Position of Jumper) and LandingSpot)
  • Set JumpLength = (Distance x 0.48)
  • Set Airheight = 2.00
  • Unit - Remove Crow Form from Jumper
  • Unit - Make Jumper Invulnerable
  • Trigger - Turn on Airborne <gen>
  • [/box]
Trigger 2: Airborne
(initially off)

  • [box="Airborne"]Events
  • Time - Every 0.01 seconds of game time
  • Conditions
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • JumpLength Greater than 0.00
    • Then - Actions
      • Set JumpLength = (JumpLength - 12.00)
      • Set Distance = (Distance - 12.00)
      • Set Airheight = (Airheight + (0.10 x JumpLength))
      • Unit - Move Jumper instantly to ((Position of Jumper) offset by 12.00 towards Angle degrees)
      • Animation - Change Jumper flying height to Airheight at 3000.00
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • And - All (Conditions) are true
        • Conditions
          • JumpLength Less than or equal to 0.00
          • Distance Greater than 0.00
    • Then - Actions
      • Set JumpLength = (JumpLength - 12.00)
      • Set Distance = (Distance - 12.00)
      • Set Airheight = (Airheight + (0.10 x JumpLength))
      • Unit - Move Jumper instantly to ((Position of Jumper) offset by 12.00 towards Angle degrees)
      • Animation - Change Jumper flying height to Airheight at 3000.00
    • Else - Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Airheight Less than or equal to 1.00
      • Then - Actions
        • Unit - Make Jumper Vulnerable
        • Animation - Change Jumper flying height to 0.00 at 1500.00
        • Unit - Move Jumper instantly to LandingSpot
        • Set Airheight = 0.00
        • Set JumpLength = 0.00
        • Set Halfdistance = 0.00
        • Set Distance = 0.00
        • Set Angle = 0.00
        • Selection - Add Jumper to selection
        • Unit - Turn collision for Jumper On
        • Unit - Unpause Jumper
        • Trigger - Turn off (This trigger)
        • Unit - Create 1 Dummy (Invisible) for (Owner of Jumper) at (Position of Jumper) facing Default building facing degrees
        • Unit - Add War Stomp (Dummy) to (Last created unit)
        • Custom script: call IssueImmediateOrder( GetLastCreatedUnit(), "stomp" )
        • Special Effect - Create a special effect at LandingSpot using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
        • Wait 0.50 seconds
        • Set Jumper = No unit
        • Special Effect - Destroy (Last created special effect)
        • Unit - Remove (Last created unit) from the game
      • Else - Actions[/box]
I added landing damage when the jumper lands, created a dummy at the landing location which uses a cloned war stomp ablility and removed the hero ablility tag. (I cloned a wisp as a dummy, and set the food cost = 0, Art - Model file = None. )
 
Status
Not open for further replies.
Top