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

[Trigger] Jumping

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
I tried making a unit "jump" with the bird ability a lot of times like everyone says, but it NEVER worked.
Can someone give me a trigger that works ?

And another question, if I use harrays, does index [0] is also working ? or it starts from [1] ?

Thanks in advance.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Unknown
    • Events
      • Event
    • Conditions
    • Actions
      • Unit - Add Crow Form to My_Unit
      • Unit - Remove Crow Form from My_Unit

And another question, when changing unit's flight height does it interfer with the units orders ? (for example if I order a unit to move and mean while change his height, will he stop moving ?)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Is there a better way to make an arc "jump" instead of this ?
  • Unknown
    • Events
      • Event
    • Conditions
      • Condition
    • Actions
      • Set TempLoc = (Position of My_Unit)
      • Set TempLoc2 = (TempLoc offset by 256.00 towards Some_Where)
      • Unit - Order My_Unit to Move To TempLoc2
      • Animation - Change My_Unit flying height to 500.00 at 500.00
      • Animation - Change My_Unit flying height to 0.00 at 500.00

(Don't bother me with leaks or anything, just made this as an example :wink:)
 
  • Unknown
    • Events
    • Conditions
    • Actions
      • Set TempLoc = (Position of My_Unit)
      • Set TempLoc2 = (TempLoc offset by 256.00 towards Some_Where)
      • Unit - Add Crow Form to My_Unit
      • Unit - Order My_Unit to Move To TempLoc2
      • Animation - Change My_Unit flying height to 500.00 at 5.00
      • Unit - Remove Crow Form from My_Unit
      • Wait - Wait 5.00 seconds
      • Unit - Add Crow Form to My_Unit
      • Animation - Change My_Unit flying height to 0.00 at 5.00
      • Unit - Remove Crow Form from My_Unit
The "at 500" thing means it changes its flying height over 500 seconds (which is far too long).

Also you need the wait.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
That would be a triangle, Pyritie, no an arc.

Here's a funky function for calculation of an arc (yes, this is Triggers (GUI), but some things aren't the best done in GUI, and you can always call this with a line of 'Custom Script')

JASS:
function JumpParabola takes real dist, real maxdist,real curve returns real
    local real t = (dist*2)/maxdist-1
    return (-t*t+1)*(maxdist/curve)
endfunction

Suggested use:

First, put this function in your map header, then, use this:

(using variables Real MaxDistance, Real DistanceTraveled, Real NextZHeight)

  • -------- I assume that by this point in your trigger MaxDistance and DistanceTraveled have been set --------
  • Custom script: set udg_NextZHeight = JumpParabola(udg_DistanceTraveled,udg_MaxDistance,1.8)
  • Unit - Set (Someone)'s Fly Height to NextZHeight at 0.00
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
What I meant is, if the end of jump is 600 from the jumping unit, the unit's speed is 300/sec, and the height is 300/sec (just an example), it will be a triangle, but if change even one of this things it will be more an arc then a triangle depends how much u change.

And if you keep not beliving just try it, because I did and facts are facts ^^
 
Level 10
Joined
Jul 14, 2004
Messages
463
Well, I'm not sure if you want to USE this or if you want to LEARN this.
If you want to USE it, maybe you should take a look at my Jump System.

Using this, you only have to give the unit that should jump, the target location, the desired max height of your jump and the duration of the jump and it will jump in a perfect parabola.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Its not really real since the unit seems to go down exacly at the speed he went up (correct me if im wrong).
The instant-jump is cool :xxd:
You can cast it while on air and its really funny :grin:

And Pyritie, don't know what with you but I managed to make a nice arc with changing height so say whatever you want...
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Ok this is my last comment in this thread since it goes to no where.

Unless the units speed is "Distance_Of_Jump/2" and the height goes also "Distance_Of_Jump/2" the jump will NOT be a triangle.
I tried it and it worked perfectly.

Don't know whats your JumpParabula but there is gravity you know and if, say, a unit jumps from a cliff his speed should increase as he falls.
 
Here. Hopefully now you will get it.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    24.7 KB · Views: 104
Level 10
Joined
Jul 14, 2004
Messages
463
Its not really real since the unit seems to go down exacly at the speed he went up (correct me if im wrong).

You noticed correctly, but your conclusion that this is not real is wrong. The gravitation always accelerates an object at the same amount, so if the object is rising, it will be braked as fast as it will be accelerated when it comes down again. Therefore, the speed when it's going up is exactly the same as when it comes down again (if start and target are at the same height, of course; air resistance not considered since it is negligible for jumping).
 
Status
Not open for further replies.
Top