• 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.

[Spell] Some Complex Jump Trigger

Status
Not open for further replies.
Level 10
Joined
May 27, 2009
Messages
495
I'm currently making a spell but i can't figure out how to make a unit jump like the one on the following pic..

Untitled.png

well most jump systems out there usually do those fly stuffs with arc..

Can anyone give me some sample triggers or such? or just even some math...
I already tried using some little good ol' boolean but it's kinda messy though..
 
Loop trigger
Event
Every 0.03 seconds
Action
Unit Pick Every Unit In Unit Group (Fly)
Unit Move Picked units to Unit position of Picked Unit with 5 angle unit facing
If unit flying height greater then or equel to lets say 400 then do action set flying height of picked unit to 1.
If flying height of picked unit lesser or equal to 400 then do action set flying heigh of picked unit to arithmetic unit current fllying heigh + 1.

Ofc when unit cast spell the add caster to unit group
 
I'll get you started on the math required.

I think you're going to need to split the jump into 2 parts.

The first part is z = x^2 / (distance^2)/maxZ)

x initially is 0.
z initially is 0.
distance is the distance between the initial position and the halfway mark of the entire jump (meaning the end of the first part)

maxZ is the max height of the jump in the first part.

If a unit moves by a distance of 4, the current x that should be used is 4, not the difference in x's according to the map's Cartesian system.

When a unit finishes this jump, you would reset x to 0 and do the jump again.

Note: I just made up all the math above using what I know :|
 
Level 10
Joined
May 27, 2009
Messages
495
@HammerFist132
that's pretty simple and isn't that accurate nor smooth enough but thanks anyway

@mag
can't understand this part

If a unit moves by a distance of 4, the current x that should be used is 4, not the difference in x's according to the map's Cartesian system.

When a unit finishes this jump, you would reset x to 0 and do the jump again.

any code sample i guess?
 
Status
Not open for further replies.
Top