Unpause unit malfunctions expert advice needed

Sooda

Diversity enchants
Reaction score
318
EDIT: Check latest post for newest info and skip first post triggers.

Making GUI MUI Leap ability, saw thread asking how to do it and gave it a shot. Ended up with working trigger, but caster in the end will not be unpaused again. I tried killing caster instead and it works fine. Is it really bug with 'pause/ unpause unit' action? I post all triggers, but look only 'Leap Cast' and 'Leap Jump' triggers. Problem is in the very end of 'Leap Jump' trigger. I have attached map for testing if needed:
Trigger:
  • Leap Jump
    • Events
      • Time - leap_timer expires
    • Conditions
    • Actions
      • Set leap_loopIndexEnd = leap_index
      • For each (Integer leap_loopIndex) from 1 to leap_loopIndexEnd, do (Actions)
        • Loop - Actions
          • Set leap_dis[leap_loopIndex] = (leap_dis[leap_loopIndex] + leap_ms[leap_loopIndex])
          • Set leap_safePoint = ((Position of leap_caster[leap_loopIndex]) offset by leap_ms[leap_loopIndex] towards (Facing of leap_caster[leap_loopIndex]) degrees)
          • Custom script: set udg_leap_height = GetLocationZ(udg_leap_safePoint)
          • -------- Parabola Start Credits for this math function to emjlr3 at thehelper.net --------
          • Set leap_parabola = ((leap_dis[leap_loopIndex] x 2.00) / (leap_maxDis[leap_loopIndex] - 1.00))
          • Set leap_parabola = (((-1.00 x leap_parabola) x leap_parabola) + 1.00)
          • Set leap_parabola = (leap_parabola x (leap_maxDis[leap_loopIndex] / leap_arc))
          • Set leap_chkHeight = True
          • -------- Parabola End --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • leap_height Less than leap_heightStart[leap_loopIndex]
              • leap_chkHeight Equal to True
            • Then - Actions
              • Set leap_height = (leap_heightStart[leap_loopIndex] - leap_height)
              • Set leap_height = (leap_height + leap_parabola)
              • Set leap_chkHeight = False
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • leap_height Greater than leap_heightStart[leap_loopIndex]
              • leap_chkHeight Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (leap_heightStart[leap_loopIndex] + leap_parabola) Less than or equal to leap_height
                • Then - Actions
                  • Set leap_height = 0.00
                • Else - Actions
                  • Set leap_height = (leap_parabola - (leap_height - leap_heightStart[leap_loopIndex]))
              • Set leap_chkHeight = False
            • Else - Actions
              • Set leap_height = leap_parabola
              • Set leap_chkHeight = False
          • Animation - Change leap_caster[leap_loopIndex] flying height to leap_height at 0.00
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Playable map area) contains leap_safePoint) Equal to True
            • Then - Actions
              • Unit - Move leap_caster[leap_loopIndex] instantly to leap_safePoint
              • Custom script: call RemoveLocation(udg_leap_safePoint)
            • Else - Actions
              • Custom script: call RemoveLocation(udg_leap_safePoint)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • leap_dis[leap_loopIndex] Greater than or equal to leap_maxDis[leap_loopIndex]
              • leap_index Not equal to 0
            • Then - Actions
              • Animation - Change leap_caster[leap_loopIndex] flying height to (Default flying height of leap_caster[leap_loopIndex]) at 0.00
              • Unit - Turn collision for leap_caster[leap_loopIndex] On
              • Unit - Make leap_caster[leap_loopIndex] Vulnerable
              • Unit Group - Add leap_caster[leap_loopIndex] to leap_pausedCasters
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 1000.00 of leap_targetPoint[leap_loopIndex]) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) belongs to an ally of (Owner of leap_caster[leap_loopIndex])) Equal to True
                      • ((Picked unit) is A structure) Equal to False
                      • ((Picked unit) is dead) Equal to False
                      • (Owner of (Picked unit)) Equal to leap_casterOwner[leap_loopIndex]
                      • (Unit-type of (Picked unit)) Not equal to leap_dummyUnitType
                    • Then - Actions
                      • Unit - Create 1 leap_dummyUnitType for (Owner of leap_caster[leap_loopIndex]) at leap_targetPoint[leap_loopIndex] facing Default building facing degrees
                      • Unit - Add leap_dummyAbil to (Last created unit)
                      • Unit - Set level of leap_dummyAbil for (Last created unit) to leap_level[leap_loopIndex]
                      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Picked unit)
                      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                    • Else - Actions
              • Set leap_orderLoopIndex = leap_casterOrderIndex[leap_loopIndex]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • leap_isUnitOrder[leap_orderLoopIndex] Equal to True
                • Then - Actions
                  • Custom script: call IssueTargetOrderById( udg_leap_caster[udg_leap_loopIndex], udg_leap_casterOrder[udg_leap_orderLoopIndex], udg_leap_unitOrderTarget[udg_leap_orderLoopIndex])
                  • Set leap_unitOrderTarget[leap_orderLoopIndex] = No unit
                  • Set leap_isPointOrder[leap_orderLoopIndex] = False
                  • Set leap_isUnitOrder[leap_orderLoopIndex] = False
                  • Set leap_isOrder[leap_orderLoopIndex] = False
                  • Set leap_casterOrder[leap_orderLoopIndex] = 0
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • leap_isPointOrder[leap_orderLoopIndex] Equal to True
                • Then - Actions
                  • Custom script: call IssuePointOrderByIdLoc( udg_leap_caster[udg_leap_loopIndex], udg_leap_casterOrder[udg_leap_orderLoopIndex], udg_leap_issuedOrderPoint[udg_leap_orderLoopIndex])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • leap_removePointOrder[leap_orderLoopIndex] Equal to True
                    • Then - Actions
                      • Custom script: call RemoveLocation(udg_leap_issuedOrderPoint[udg_leap_orderLoopIndex])
                      • Set leap_removePointOrder[leap_orderLoopIndex] = False
                    • Else - Actions
                  • Set leap_isPointOrder[leap_orderLoopIndex] = False
                  • Set leap_isUnitOrder[leap_orderLoopIndex] = False
                  • Set leap_isOrder[leap_orderLoopIndex] = False
                  • Set leap_casterOrder[leap_orderLoopIndex] = 0
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • leap_isOrder[leap_orderLoopIndex] Equal to True
                • Then - Actions
                  • Custom script: call IssueImmediateOrderById( udg_leap_caster[udg_leap_loopIndex], udg_leap_casterOrder[udg_leap_orderLoopIndex])
                  • Set leap_isPointOrder[leap_orderLoopIndex] = False
                  • Set leap_isUnitOrder[leap_orderLoopIndex] = False
                  • Set leap_isOrder[leap_orderLoopIndex] = False
                  • Set leap_casterOrder[leap_orderLoopIndex] = 0
                • Else - Actions
              • Set leap_storeOrder[leap_orderLoopIndex] = True
              • Set leap_caster[leap_loopIndex] = leap_caster[leap_index]
              • Set leap_caster[leap_index] = No unit
              • Set leap_casterOwner[leap_loopIndex] = leap_casterOwner[leap_index]
              • Set leap_maxDis[leap_loopIndex] = leap_maxDis[leap_index]
              • Set leap_dis[leap_loopIndex] = leap_dis[leap_index]
              • Set leap_level[leap_loopIndex] = leap_level[leap_index]
              • Set leap_ms[leap_loopIndex] = leap_ms[leap_index]
              • Set leap_heightStart[leap_loopIndex] = leap_heightStart[leap_index]
              • Custom script: call RemoveLocation(udg_leap_targetPoint[udg_leap_loopIndex])
              • Set leap_targetPoint[leap_loopIndex] = leap_targetPoint[leap_index]
              • Set leap_isUnitOrder[leap_loopIndex] = leap_isUnitOrder[leap_index]
              • Set leap_isPointOrder[leap_loopIndex] = leap_isPointOrder[leap_index]
              • Set leap_isOrder[leap_loopIndex] = leap_isOrder[leap_index]
              • Set leap_casterOrderIndex[leap_loopIndex] = leap_casterOrderIndex[leap_index]
              • Set leap_loopIndex = (leap_loopIndex - 1)
              • Set leap_index = (leap_index - 1)
            • Else - Actions
      • Unit Group - Pick every unit in leap_pausedCasters and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
          • Unit - Kill (Picked unit)
      • Unit Group - Remove all units from leap_pausedCasters
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • leap_index Equal to 0
        • Then - Actions
        • Else - Actions
          • Countdown Timer - Start leap_timer as a One-shot timer that will expire in 0.04 seconds

Trigger:
  • Leap Init
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Leap
      • (Level of leap_heroAbil for (Triggering unit)) Equal to 1
    • Actions
      • Set leap_orderIndex = (leap_orderIndex + 1)
      • Set leap_obsCaster[leap_orderIndex] = (Triggering unit)
      • Set leap_storeOrder[leap_orderIndex] = True
      • Set leap_isUnitOrder[leap_orderIndex] = False
      • Set leap_isPointOrder[leap_orderIndex] = False
      • Set leap_isOrder[leap_orderIndex] = False
      • Unit Group - Add (Triggering unit) to leap_trackOrderGroup

Trigger:
  • Leap Clean
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to False
    • Actions
      • For each (Integer A) from 1 to leap_orderIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to leap_obsCaster[(Integer A)]
            • Then - Actions
              • Set leap_obsCaster[(Integer A)] = leap_obsCaster[leap_orderIndex]
              • Set leap_isUnitOrder[(Integer A)] = leap_isUnitOrder[leap_orderIndex]
              • Set leap_isPointOrder[(Integer A)] = leap_isPointOrder[leap_orderIndex]
              • Set leap_isOrder[(Integer A)] = leap_isOrder[leap_orderIndex]
              • Set leap_casterOrder[(Integer A)] = leap_casterOrder[leap_orderIndex]
              • Set leap_unitOrderTarget[(Integer A)] = leap_unitOrderTarget[leap_orderIndex]
              • Set leap_unitOrderTarget[leap_orderIndex] = No unit
              • Set leap_orderIndex = (leap_orderIndex - 1)
            • Else - Actions

Trigger:
  • Leap Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to leap_heroAbil
    • Actions
      • Set leap_index = (leap_index + 1)
      • Set leap_caster[leap_index] = (Triggering unit)
      • Set leap_casterOwner[leap_index] = (Owner of leap_caster[leap_index])
      • Unit - Make leap_caster[leap_index] Invulnerable
      • Unit - Turn collision for leap_caster[leap_index] Off
      • Set leap_level[leap_index] = (Level of leap_heroAbil for leap_caster[leap_index])
      • Set leap_maxDis[leap_index] = (350.00 + ((Real(leap_level[leap_index])) x 50.00))
      • Set leap_dis[leap_index] = 0.00
      • Set leap_targetPoint[leap_index] = ((Position of leap_caster[leap_index]) offset by leap_dis[leap_index] towards (Facing of leap_caster[leap_index]) degrees)
      • Set leap_ms[leap_index] = (leap_dis[leap_index] / (Current movement speed of leap_caster[leap_index]))
      • Set leap_ms[leap_index] = 25.00
      • Unit - Add Crow Form to leap_caster[leap_index]
      • Unit - Remove Crow Form from leap_caster[leap_index]
      • Unit - Pause leap_caster[leap_index]
      • For each (Integer A) from 1 to leap_orderIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • leap_caster[leap_index] Equal to leap_obsCaster[(Integer A)]
            • Then - Actions
              • Set leap_casterOrderIndex[leap_index] = (Integer A)
              • Set leap_storeOrder[(Integer A)] = False
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • leap_index Equal to 1
        • Then - Actions
          • Countdown Timer - Start leap_timer as a One-shot timer that will expire in 0.04 seconds
        • Else - Actions

Trigger:
  • Leap Order Unit
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) is in leap_trackOrderGroup) Equal to True
    • Actions
      • For each (Integer A) from 1 to leap_orderIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to leap_obsCaster[(Integer A)]
              • leap_storeOrder[(Integer A)] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • leap_removePointOrder[(Integer A)] Equal to True
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_leap_issuedOrderPoint[bj_forLoopAIndex])
                  • Set leap_removePointOrder[(Integer A)] = False
                • Else - Actions
              • Set leap_isUnitOrder[(Integer A)] = True
              • Set leap_isPointOrder[(Integer A)] = False
              • Set leap_isOrder[(Integer A)] = False
              • Set leap_unitOrderTarget[(Integer A)] = (Target unit of issued order)
              • Custom script: set udg_leap_casterOrder[bj_forLoopAIndex] = GetIssuedOrderId()
              • Game - Display to (All players) the text: unit stored
            • Else - Actions

Trigger:
  • Leap Order Point
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is in leap_trackOrderGroup) Equal to True
    • Actions
      • For each (Integer A) from 1 to leap_orderIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to leap_obsCaster[(Integer A)]
              • leap_storeOrder[(Integer A)] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • leap_removePointOrder[(Integer A)] Equal to True
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_leap_issuedOrderPoint[bj_forLoopAIndex])
                  • Set leap_removePointOrder[(Integer A)] = False
                • Else - Actions
              • Set leap_isUnitOrder[(Integer A)] = False
              • Set leap_isPointOrder[(Integer A)] = True
              • Set leap_isOrder[(Integer A)] = False
              • Set leap_removePointOrder[(Integer A)] = True
              • Set leap_issuedOrderPoint[(Integer A)] = (Target point of issued order)
              • Custom script: set udg_leap_casterOrder[bj_forLoopAIndex] = GetIssuedOrderId()
              • Game - Display to (All players) the text: point stored
            • Else - Actions

Trigger:
  • Leap Order
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • ((Triggering unit) is in leap_trackOrderGroup) Equal to True
    • Actions
      • For each (Integer A) from 1 to leap_orderIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to leap_obsCaster[(Integer A)]
              • leap_storeOrder[(Integer A)] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Issued order) Equal to (Order(windwalk))
                • Then - Actions
                  • Set leap_storeOrder[(Integer A)] = False
                  • Skip remaining actions
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • leap_removePointOrder[(Integer A)] Equal to True
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_leap_issuedOrderPoint[bj_forLoopAIndex])
                  • Set leap_removePointOrder[(Integer A)] = False
                • Else - Actions
              • Set leap_isUnitOrder[(Integer A)] = False
              • Set leap_isPointOrder[(Integer A)] = False
              • Set leap_isOrder[(Integer A)] = True
              • Custom script: set udg_leap_casterOrder[bj_forLoopAIndex] = GetIssuedOrderId()
              • Game - Display to (All players) the text: order stored
            • Else - Actions
 

Attachments

  • MUI GUI Leap Ability.w3x
    25 KB · Views: 66

eXirrah

New Member
Reaction score
51
I checked the map. I disabled the function kill unit and enabled unpause unit(did no other changes) and it works fine. After the jump I am able to control the sorceress just fine, idk why it doesn't work for you.
 

eXirrah

New Member
Reaction score
51
Here is a map with my version of the ability, but seems like I can't make it work with cliffs. How do you deal with cliffs?

I was thinking of some dummy unit, but then you have to create dummy units with the models of all units in the game that have the jump ability,

Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 0.Jump
    • Actions
      • Custom script: local real d
      • Custom script: local location c
      • Set TU = (Triggering unit)
      • Set TP[0] = (Position of TU)
      • Set TP[1] = (Target point of ability being cast)
      • Custom script: set c = udg_TP[1]
      • Unit - Add Crow Form to TU
      • Unit - Turn collision for TU On
      • Unit - Make TU Invulnerable
      • Unit - Pause TU
      • Set Distance = (Distance between TP[0] and TP[1])
      • Custom script: set d = udg_Distance
      • Set Speed = ((Distance between TP[0] and TP[1]) / 100.00)
      • For each (Integer A) from 1 to (Integer(Speed)), do (Actions)
        • Loop - Actions
          • Set TU = (Triggering unit)
          • Set TP[0] = (Position of TU)
          • Custom script: set udg_TP[1] = c
          • Set X = ((Real((Integer A))) x 100.00)
          • Custom script: set udg_Z = Pow(2*udg_X-d,2)
          • Custom script: set udg_Zm = Pow(d,2)
          • Game - Display to (All players) the text: (String((Angle from TP[0] to TP[1])))
          • Custom script: set udg_Heigth = RMinBJ(300.0,d*0.3)
          • Set TP[2] = (TP[0] offset by 100.00 towards (Angle from TP[0] to TP[1]) degrees)
          • Unit - Move TU instantly to TP[2]
          • Animation - Change TU flying height to (((Zm - Z) / Zm) x Heigth) at 0.00
          • Wait 0.00 seconds
      • Set TU = (Triggering unit)
      • Custom script: set udg_TP[1] = c
      • Unit - Move TU instantly to TP[1]
      • Animation - Change TU flying height to 0.00 at 0.00
      • Unit - Unpause TU
      • Unit - Turn collision for TU Off
      • Unit - Make TU Vulnerable
      • Unit - Remove Crow Form from TU


I noticed that this trigger leaks so please don't point it out to me.

EDIT: Oh ... I got it I switched the turn collision functions. My bad. Now it works fine.
 

Attachments

  • Jump.w3x
    18.5 KB · Views: 66

Sooda

Diversity enchants
Reaction score
318
I use emjl3 parabola math formula, forgot to mention in first post that casting leap with one unit works fine, but when you press 'Esc' key then both heroes jump and get paused forever.
 

eXirrah

New Member
Reaction score
51
Hmmm... my algorith is not MUI because of the For ...

I didn't know that For integer 1 to var checks everytime the value of var. I thought that it checks the value of var once at the beggining only.

I fixed it but now it looks more like JASS than GUI :(. Check it out if you want.

Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 0.Jump
    • Actions
      • Custom script: local real d
      • Custom script: local location c
      • Set TU = (Triggering unit)
      • Set TP[0] = (Position of TU)
      • Set TP[1] = (Target point of ability being cast)
      • Custom script: set c = udg_TP[1]
      • Unit - Add Crow Form to TU
      • Unit - Turn collision for TU Off
      • Unit - Make TU Invulnerable
      • Unit - Pause TU
      • Set Distance = (Distance between TP[0] and TP[1])
      • Custom script: set d = udg_Distance
      • Set Speed = ((Distance between TP[0] and TP[1]) / 100.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Custom script: loop
          • Set TU = (Triggering unit)
          • Set TP[0] = (Position of TU)
          • Custom script: exitwhen DistanceBetweenPoints(udg_TP[0],c) < 100 == true
          • Custom script: set udg_TP[1] = c
          • Custom script: set udg_X = d - DistanceBetweenPoints(udg_TP[0],c) + 100
          • Custom script: set udg_Z = Pow(2*udg_X-d,2)
          • Custom script: set udg_Zm = Pow(d,2)
          • Game - Display to (All players) the text: (String((Angle from TP[0] to TP[1])))
          • Custom script: set udg_Heigth = RMinBJ(300.0,d*0.3)
          • Set TP[2] = (TP[0] offset by 100.00 towards (Angle from TP[0] to TP[1]) degrees)
          • Unit - Move TU instantly to TP[2]
          • Animation - Change TU flying height to (((Zm - Z) / Zm) x Heigth) at 0.00
          • Wait 0.04 seconds
          • Custom script: endloop
        • Else - Actions
      • Set TU = (Triggering unit)
      • Custom script: set udg_TP[1] = c
      • Unit - Move TU instantly to TP[1]
      • Animation - Change TU flying height to 0.00 at 0.00
      • Unit - Unpause TU
      • Unit - Turn collision for TU On
      • Unit - Make TU Vulnerable
      • Unit - Remove Crow Form from TU


EDIT: my parabola equation is focused on the height only. I devide the current height on the max and multyply by the max height the unit can go. This ensures that the unit can't jump toooo high. I check if the unit is jumping to less than 1000 distance and calculate a new max height(so it doesn't look like it jump to the sky just to jump 2 feet forward).

The parabola formula is f(x) = ((x-h)^2/4p) - where (h,k) is the vertex of the parabola and (h,k+p) is the focus(wikipedia.org)

well I needed to change it a bit so it works for me and the end formula is f(x) = (2x - d)^2 (h=d/2,p=1/4,k=0) where d is the distance of the jump.

It is obvious that the max jusp distance is Zm=f(d/2)-f(0)=d^2 so the height that the unit must be is Zm-f(x), but it is toooo hight so I devide it by Zm and I get (Zm-Z)/Zm, which is the height that the unit is at compared to the max height so the result is in % of max height. I multiply that by the max height that this time is the one that I want(300 in this case) and this ensures me that the unit won't jump higher than 300. I notced that when I jump very close 300 seems to be very high. So I put a condition if the distance of the jump is less than 1000 then the max height is (d/1000)*300. which is the line Custom script: set udg_Heigth = RMinBJ(300.0,d*0.3) ((d/1000)*300 = d*0.3) which means that if d < 1000 then d*0.3 < 300 and 300*d/1000 is selected. Well I hope I explained my calcs if you plan on using them.
 

Attachments

  • Jump.w3x
    18.7 KB · Views: 61

Sooda

Diversity enchants
Reaction score
318
Thanks for your scientific input. I am weak at math and did not get much what you wrote. I want to get working my triggered ability even when yours works fine or better. World Editor gurus to help?
 

Sooda

Diversity enchants
Reaction score
318
bump

EDIT:

Update, I have pin pointed error, it comes from 'Jump Cast' trigger when unit is first paused. When all cast at once then units get permanently paused.

When I pause units before by myself and then press 'Esc' to fire Leap ability manually all works fine. My manually casting trigger is this:
Trigger:
  • Start Debug
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DEBUG_GROUP and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) face (Random real number between 0.00 and 360.00) over 0.00 seconds
      • Wait 2.00 seconds
      • Unit Group - Pick every unit in DEBUG_GROUP and do (Actions)
        • Loop - Actions
          • Set DEBUG_UNIT = (Picked unit)
          • Trigger - Run Leap Cast &lt;gen&gt; (ignoring conditions)

'Jump Cast starts like this:
Trigger:
  • Leap Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to leap_heroAbil
    • Actions
      • Set leap_index = (leap_index + 1)
      • Set leap_caster[leap_index] = DEBUG_UNIT
      • next line is disabled
      • Set leap_caster[leap_index] = (Triggering unit)
      • Set leap_casterOwner[leap_index] = (Owner of leap_caster[leap_index])
      • Unit - Remove Wind Walk buff from leap_caster[leap_index]
      • Unit - Make leap_caster[leap_index] Invulnerable
      • Unit - Turn collision for leap_caster[leap_index] Off
      • ...

and all works fine. New map is attached. I use for testing Berserk ability. I have set it up so only 'Esc' key makes them use ability else it requires enabling event and etc. Test map attached, can anybody help me solving this bug?
 

Attachments

  • MUI GUI Leap Ability v2.w3x
    25.6 KB · Views: 60

vypur85

Hibernate
Reaction score
803
So... What's the problem? It seems like you're making a leap ability? Why make it so complicated? Is it the parabolic problem or the pause problem?

The trigger is quite long and the problem is quite vague. Probably that's why not much response? Try explain a little.
 

Sooda

Diversity enchants
Reaction score
318
Problem is pausing unit in 'Leap Cast' trigger. When I pause unit in that trigger unit gets permanently paused. It is something to do with casting ability which does not interrupt orders and pausing instantly. I have modified trigger to manually pause units before activating triggered ability and everything works. But with 'starts effect of ability' pause malfunctions. Good that you answered.

Everything else works fine as I can tell and I do it because I can.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top