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

Leap 2.0 - v0.09

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
The unit leaps facing to the point you're moving, not your face angle, so you can do some ninja jumps.

There are two kinds of bouncing jumps, one that goes up and help you at climbing, and the other which makes you re-jump to the place you right click, but from a higher place, making you go further.

I recommend start testing with a level 2 leap, it's kinda hard to handle.

Also, if you try to jump over a really high cliff, you will be sent back.

I would keep explaining how to control it, but i'd rather let you have some fun.


v0.01 Initial release
v0.07 Now you can't get stuck on cliffs
v0.09 Overall update, mana cost added



  • Leap Set up
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set LeapHash = (Last created hashtable)
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Ability --------
      • Set LeapAbility = Leap
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Total distance = LeapBaseDistance + ( LeapDistancePerLevel x Level of the ability ) --------
      • Set LeapBaseDistance = 550.00
      • Set LeapDistancePerLevel = 50.00
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- MaxHeight = JumpRate x ( TotalDistance / 4 ) --------
      • Set LeapJumpRate = 1.15
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This factor multiplies LeapJumpRate after bouncing which changes the max height --------
      • Set LeapJumpRateBounce = 4.00
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This "casts" a whole new jump from the cliff you collide with and sets its power to a percentage of the original. --------
      • Set LeapBounceRate = 0.50
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Before bouncing: Real Speed per second = LeapSpeed x 33.33 ------- After bouncing: Real Speed per second = ( LeapSpeed / ( JumpRateBounce / 2 ) ) x 33.33 --------
      • Set LeapSpeed = 37.50
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------


  • Leap 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to LeapAbility
    • Actions
      • Set LeapUnit = (Triggering unit)
      • Set LeapHandle = (Key (Triggering unit))
      • Set LeapPoint = (Position of LeapUnit)
      • Hashtable - Save Handle OfLeapPoint as (Key position) of LeapHandle in LeapHash
      • Unit - Order LeapUnit to Stop
      • Hashtable - Save Handle OfLeapPoint as (Key position) of LeapHandle in LeapHash
      • Custom script: set udg_LeapZOffset = GetLocationZ(udg_LeapPoint)
      • Hashtable - Save LeapZOffset as (Key zoffsetbase) of LeapHandle in LeapHash
      • Hashtable - Save (LeapBaseDistance + (LeapDistancePerLevel x (Real((Level of Leap for LeapUnit))))) as (Key leapdistance) of LeapHandle in LeapHash
      • Hashtable - Save (Load (Key leapdistance) of LeapHandle from LeapHash) as (Key leapbasedistance) of LeapHandle in LeapHash
      • Hashtable - Save 0.00 as (Key distance) of LeapHandle in LeapHash
      • Hashtable - Save LeapSpeed as (Key basespeed) of LeapHandle in LeapHash
      • Hashtable - Save LeapSpeed as (Key speed) of LeapHandle in LeapHash
      • Hashtable - Save LeapJumpRate as (Key basejumprate) of LeapHandle in LeapHash
      • Hashtable - Save LeapJumpRate as (Key jumprate) of LeapHandle in LeapHash
      • Hashtable - Save False as (Key jumpback) of LeapHandle in LeapHash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load (Key underorder) of LeapHandle from LeapHash) Equal to True
        • Then - Actions
          • Set LeapPoint = (Point((Load (Key orderpointX) of LeapHandle from LeapHash), (Load (Key orderpointY) of LeapHandle from LeapHash)))
          • Hashtable - Save (Angle from (Load (Key position) of LeapHandle in LeapHash) to LeapPoint) as (Key angle) of LeapHandle in LeapHash
        • Else - Actions
          • Hashtable - Save (Facing of LeapUnit) as (Key angle) of LeapHandle in LeapHash
      • Hashtable - Save False as (Key underorder) of LeapHandle in LeapHash
      • Hashtable - Save ((((-1.00 x LeapJumpRate) / (Load (Key leapdistance) of LeapHandle from LeapHash)) x (Power(((Load (Key leapdistance) of LeapHandle from LeapHash) / 2.00), 2.00))) + (LeapJumpRate x ((Load (Key leapdistance) of LeapHandle from LeapHash) / 2.00))) as (Key heightbounce) of LeapHandle in LeapHash
      • Hashtable - Save True as (Key bounce) of LeapHandle in LeapHash
      • Custom script: if UnitAddAbility(udg_LeapUnit,'Amrf') then
      • Custom script: call UnitRemoveAbility(udg_LeapUnit,'Amrf')
      • Custom script: endif
      • Unit Group - Add LeapUnit to LeapGP
      • Unit Group - Add LeapUnit to LeapOrderPoint
      • Trigger - Turn on Leap 2 <gen>
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This is visual thing that only works with PotM's model --------
      • Animation - Reset LeapUnit's animation
      • Animation - Change LeapUnit's animation speed to 75.00% of its original speed
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Custom script: call SetUnitAnimationByIndex(udg_LeapUnit,6)
      • Custom script: call RemoveLocation (udg_LeapPoint)


  • Leap 2
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in LeapGP and do (Actions)
        • Loop - Actions
          • Set LeapUnit = (Picked unit)
          • Unit - Turn collision for LeapUnit Off
          • Set LeapHandle = (Key (Picked unit))
          • Set LeapPoint1 = (Position of LeapUnit)
          • Set LeapPoint = (LeapPoint1 offset by (Load (Key speed) of LeapHandle from LeapHash) towards (Load (Key angle) of LeapHandle from LeapHash) degrees)
          • Hashtable - Save Handle OfLeapPoint as (Key nextposition) of LeapHandle in LeapHash
          • Hashtable - Save ((Load (Key distance) of LeapHandle from LeapHash) + (Load (Key speed) of LeapHandle from LeapHash)) as (Key distance) of LeapHandle in LeapHash
          • Hashtable - Save ((((-1.00 x (Load (Key jumprate) of LeapHandle from LeapHash)) / (Load (Key leapdistance) of LeapHandle from LeapHash)) x (Power((Load (Key distance) of LeapHandle from LeapHash), 2.00))) + ((Load (Key jumprate) of LeapHandle from LeapHash) x (Load (Key dista as (Key height) of LeapHandle in LeapHash
          • Hashtable - Save (((Load (Key distance) of LeapHandle from LeapHash) x 100.00) / (Load (Key leapdistance) of LeapHandle from LeapHash)) as (Key parabola) of LeapHandle in LeapHash
          • Custom script: set udg_LeapZOffset = GetLocationZ(udg_LeapPoint)
          • Hashtable - Save LeapZOffset as (Key zoffsetnp) of LeapHandle in LeapHash
          • Hashtable - Save ((Load (Key zoffsetnp) of LeapHandle from LeapHash) - (Load (Key zoffsetbase) of LeapHandle from LeapHash)) as (Key zoffset) of LeapHandle in LeapHash
          • Animation - Change LeapUnit flying height to ((Load (Key height) of LeapHandle from LeapHash) - (Load (Key zoffset) of LeapHandle from LeapHash)) at 0.00
          • Unit - Move LeapUnit instantly to (Load (Key nextposition) of LeapHandle in LeapHash), facing (Load (Key angle) of LeapHandle from LeapHash) degrees
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Terrain pathing at LeapPoint of type Walkability is off) Equal to True
                  • And - All (Conditions) are true
                    • Conditions
                      • (Load (Key bounce) of LeapHandle from LeapHash) Equal to True
                      • (Load (Key zoffsetnp) of LeapHandle from LeapHash) Greater than or equal to ((Load (Key heightbounce) of LeapHandle from LeapHash) + (Load (Key zoffsetbase) of LeapHandle from LeapHash))
              • ((Load (Key height) of LeapHandle from LeapHash) - (Load (Key zoffset) of LeapHandle from LeapHash)) Less than or equal to 0.00
            • Then - Actions
              • Animation - Reset LeapUnit's animation
              • Custom script: call SetUnitAnimationByIndex(udg_LeapUnit,6)
              • Set LeapPoint = (Position of LeapUnit)
              • Special Effect - Create a special effect at LeapPoint using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • Hashtable - Save Handle OfLeapPoint as (Key position) of LeapHandle in LeapHash
              • Hashtable - Save 0.00 as (Key distance) of LeapHandle in LeapHash
              • Custom script: set udg_LeapZOffset = GetLocationZ(udg_LeapPoint)
              • Hashtable - Save LeapZOffset as (Key zoffsetbase) of LeapHandle in LeapHash
              • Set LeapPoint2 = ((Position of LeapUnit) offset by ((Load (Key leapbasedistance) of LeapHandle from LeapHash) x (LeapBounceRate / 8.00)) towards (Load (Key angle) of LeapHandle from LeapHash) degrees)
              • Custom script: set udg_LeapZOffset2 = GetLocationZ(udg_LeapPoint2)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • (Load (Key saveorder) of LeapHandle from LeapHash) Equal to True
                • Then - Actions
                  • Set LeapPoint = (Point((Load (Key orderpointX) of LeapHandle from LeapHash), (Load (Key orderpointY) of LeapHandle from LeapHash)))
                  • Hashtable - Save (Angle from (Load (Key position) of LeapHandle in LeapHash) to LeapPoint) as (Key angle) of LeapHandle in LeapHash
                  • Hashtable - Save (Load (Key basespeed) of LeapHandle from LeapHash) as (Key speed) of LeapHandle in LeapHash
                  • Hashtable - Save (Load (Key basejumprate) of LeapHandle from LeapHash) as (Key jumprate) of LeapHandle in LeapHash
                  • Hashtable - Save (Load (Key leapbasedistance) of LeapHandle from LeapHash) as (Key leapdistance) of LeapHandle in LeapHash
                  • Hashtable - Save False as (Key saveorder) of LeapHandle in LeapHash
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • LeapZOffset2 Greater than or equal to (LeapZOffset + 50.00)
                    • Then - Actions
                      • Hashtable - Save True as (Key jumpback) of LeapHandle in LeapHash
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at LeapPoint2 of type Walkability is off) Equal to False
                      • LeapZOffset2 Greater than or equal to (LeapZOffset + 50.00)
                    • Then - Actions
                      • Hashtable - Save ((Load (Key basespeed) of LeapHandle from LeapHash) / (LeapJumpRateBounce / 2.00)) as (Key speed) of LeapHandle in LeapHash
                      • Hashtable - Save ((Load (Key basejumprate) of LeapHandle from LeapHash) x (LeapJumpRateBounce / 1.00)) as (Key jumprate) of LeapHandle in LeapHash
                      • Hashtable - Save ((Load (Key leapbasedistance) of LeapHandle from LeapHash) x (LeapBounceRate / 2.00)) as (Key leapdistance) of LeapHandle in LeapHash
                      • Hashtable - Save True as (Key jumpback) of LeapHandle in LeapHash
                    • Else - Actions
                      • Hashtable - Save ((Load (Key basespeed) of LeapHandle from LeapHash) / (LeapJumpRateBounce / 2.00)) as (Key speed) of LeapHandle in LeapHash
                      • Hashtable - Save ((Load (Key basejumprate) of LeapHandle from LeapHash) x (LeapJumpRateBounce / 2.00)) as (Key jumprate) of LeapHandle in LeapHash
                      • Hashtable - Save ((Load (Key leapbasedistance) of LeapHandle from LeapHash) x (LeapBounceRate / 1.33)) as (Key leapdistance) of LeapHandle in LeapHash
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Load (Key jumpback) of LeapHandle from LeapHash) Equal to True
                        • Then - Actions
                          • Hashtable - Save (Angle from LeapPoint2 to LeapPoint) as (Key angle) of LeapHandle in LeapHash
                          • Hashtable - Save False as (Key jumpback) of LeapHandle in LeapHash
                        • Else - Actions
                          • Hashtable - Save True as (Key jumpback) of LeapHandle in LeapHash
              • Custom script: call RemoveLocation (udg_LeapPoint2)
              • Hashtable - Save False as (Key saveorder) of LeapHandle in LeapHash
              • Hashtable - Save False as (Key bounce) of LeapHandle in LeapHash
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Load (Key height) of LeapHandle from LeapHash) - (Load (Key zoffset) of LeapHandle from LeapHash)) Less than or equal to 0.00
                • Then - Actions
                  • Unit - Turn collision for LeapUnit On
                  • Unit Group - Remove LeapUnit from LeapGP
                  • Animation - Reset LeapUnit's animation
                  • Animation - Change LeapUnit's animation speed to 100.00% of its original speed
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Key saveorder) of LeapHandle from LeapHash) Equal to True
                    • Then - Actions
                      • Set LeapPoint = (Point((Load (Key orderpointX) of LeapHandle from LeapHash), (Load (Key orderpointY) of LeapHandle from LeapHash)))
                      • Unit - Order LeapUnit to Right-Click LeapPoint
                      • Hashtable - Save False as (Key saveorder) of LeapHandle in LeapHash
                      • Hashtable - Clear all child hashtables of child LeapHandle in LeapHash
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in LeapGP) Less than 1
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
      • Custom script: call RemoveLocation (udg_LeapPoint)
      • Custom script: call RemoveLocation (udg_LeapPoint1)


  • Leap OrderPoint
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is in LeapOrderPoint) Equal to True
    • Actions
      • Set LeapUnit = (Triggering unit)
      • Set LeapHandle = (Key (Triggering unit))
      • Set LeapPoint = (Target point of issued order)
      • Hashtable - Save (X of LeapPoint) as (Key orderpointX) of LeapHandle in LeapHash
      • Hashtable - Save (Y of LeapPoint) as (Key orderpointY) of LeapHandle in LeapHash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LeapUnit is in LeapGP) Equal to True
        • Then - Actions
          • Hashtable - Save True as (Key saveorder) of LeapHandle in LeapHash
        • Else - Actions
      • Hashtable - Save True as (Key underorder) of LeapHandle in LeapHash
      • Custom script: call RemoveLocation (udg_LeapPoint)


Keywords:
Leap, Mirana, Bounce, GUI, MUI, Hashtable
Contents

Leap 2.0 v0.09 (Map)

Reviews
You still have a lot of location leaks. Fix them. I also added more issues to my last comment. Leap 2.0 - v0.08 | Reviewed by Maker | 5th Aug 2013 NEEDS FIX Use a variable for the ability Use a proper way to give the unit the...

Moderator

M

Moderator

You still have a lot of location leaks. Fix them.
I also added more issues to my last comment.


Leap 2.0 - v0.08 | Reviewed by Maker | 5th Aug 2013
NEEDS FIX


126248-albums6177-picture66522.png


  • Use a variable for the ability
  • Use a proper way to give the unit the ability to fly
  • The ability can't have mana cost
  • Leap 2 should be initially off and it is not ever turned off
  • Number of units in group == 0 should be checkd only when removing
    a unit from the group
  • Set up is too generic trigger name
  • You don't flush child hashtable
  • You have location leaks
126248-albums6177-picture66523.png


  • OrderPoint runs for every unit
  • There is not point in
    • set point = some point
    • store point in hashtable
    • move unit instantly to load point
    Skip the hashtable there
126248-albums6177-picture66524.png
  • Spell Submission Rules
  • url=http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/how-give-unit-ability-fly-201936/[/url]
[tr]
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Leaks locations, they way you use the hashtable with the positions is not good
  • Don't submit v0.01 stuff
  • The unit can bounce back from hills created with apply height tool
  • You can get stuck on cliffs when jumping from hills created with apply heigh tool
  • Get rid of the BJ functions in the custom scripts
  • The looping trigger should not be on all the time
 
Level 5
Joined
Dec 16, 2011
Messages
55
  • Leaks locations, they way you use the hashtable with the positions is not good
  • Don't submit v0.01 stuff
    [*]The unit can bounce back from hills created with apply height tool
    [*]You can get stuck on cliffs when jumping from hills created with apply heigh tool
  • Get rid of the BJ functions in the custom scripts
  • The looping trigger should not be on all the time

I'll fix everything else but those two things are intended.
 
Level 5
Joined
Dec 16, 2011
Messages
55
anything that creates a location leaks. so position / center / offset

I used

Set LeapPoint = (Position of (Picked unit) offset by (Load (Key speed) of LeapHandle from Hash) towards (Load (Key angle) of LeapHandle from Hash) degrees)


But now i use

Set LeapPoint1 = (Position of (Picked unit))
Set LeapPoint = (LeapPoint1 offset by (Load (Key speed) of LeapHandle from Hash) towards (Load (Key angle) of LeapHandle from Hash) degrees)



I think the last one doesn't leak
 
Level 5
Joined
Dec 16, 2011
Messages
55
set it right after this.
  • Unit Group - Pick every unit in LeapGP and do (Actions)
  • Loop - Actions

I thought that it wouldn't work if a had more than 1 unit in the group. But it does. Thanks :thumbs_up:



EDIT:

  • Leaks locations, they way you use the hashtable with the positions is not good
  • Don't submit v0.01 stuff
  • The unit can bounce back from hills created with apply height tool
  • You can get stuck on cliffs when jumping from hills created with apply heigh tool
  • Get rid of the BJ functions in the custom scripts
  • The looping trigger should not be on all the time

Now it's done, i've fixed everything.
 
Last edited:
Level 19
Joined
Mar 18, 2012
Messages
1,716
You still have location leaks i.e in the cast trigger.
Cast trigger is always getting enabled, not matter if already on.

SetUnitAnimationByIndex may only work for one model type.
Why not run the animation via ability string + follow throught time in the object editor?

You turn off unit collision every 0.03 seconds. Why not just once on spell cast?

Effects should not be hardcoded.

You leak locations in the loop.

CountUnitInGroup enum is a heavy bj, which should not be used to check if a group is empty ...
Dynamic indexing be come handy here.
 
Top