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:
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 - Conditions
- 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]))
- If - Conditions
- Set leap_chkHeight = False
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Set leap_height = leap_parabola
- Set leap_chkHeight = False
- If - Conditions
- 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 - Conditions
- 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
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - 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 - Conditions
- 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
- If - Conditions
- 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 - Conditions
- 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
- If - Conditions
- 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
- If - Conditions
- Loop - Actions
- Unit Group - Pick every unit in leap_pausedCasters and do (Actions)
- Loop - Actions
- Unit - Unpause (Picked unit)
- Unit - Kill (Picked unit)
- Loop - Actions
- 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
- If - Conditions
- Events
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
- Events
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
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer A) from 1 to leap_orderIndex, do (Actions)
- Events
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 - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - 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
- If - Conditions
- Events
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
- If - Conditions
- 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
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer A) from 1 to leap_orderIndex, do (Actions)
- Events
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
- If - Conditions
- 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
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer A) from 1 to leap_orderIndex, do (Actions)
- Events
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 - Conditions
- 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
- If - Conditions
- 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
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer A) from 1 to leap_orderIndex, do (Actions)
- Events