[Spell] Triangle Dash Skill Help

Status
Not open for further replies.
Level 8
Joined
Oct 6, 2022
Messages
185
Hello sorry for bothering again, i would like to ask for help on how to make a triangle dash skill with no target point in GUI.?
It was like this in this picture. Thanks in advance
 

Attachments

  • Triangle Dash.png
    Triangle Dash.png
    10.6 KB · Views: 6
Level 8
Joined
Oct 6, 2022
Messages
185
Why do you want to make a dash spell that returns to its original position?
Well I do not know if it was dash in the first place or maybe i could also call it "move" or moving triangle shape, but so maybe I just thought that i could call it triangle dash was like that, sorry for the late reply
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
So you want a waypoint/patrol system?


I always use hidden abilities based on Channel with 1.00 Cast Range. What you do is order your Unit to cast this ability at your first Point, then you can detect when it reaches said Point using the Starts Effect Of Ability event. Then you order it to cast the ability at the second Point, etc...

The Points can be stored in an Array or Hashtable. Then you simply save an Integer to your unit using a Unit Indexer/Hashtable which will represent the [index] of the Points.

Unit reaches Point (aka it casts the ability) -> Set Integer = Integer + 1 -> Order unit to cast spell at Point[Integer]

Then you can reset Integer when it reaches the final Point and restart the whole process again.
 
Level 8
Joined
Oct 6, 2022
Messages
185
It was like a dash skill like the other dash slash but the difference is it was in a triangle shape just like from the pick, but yeah maybe I'll try that method. Was there other way on how to do it? So that if i did not worked i could easily get solution. Thanks in advance
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Okay, so you actually want a Dash spell then. Confused me there.

It shouldn't be too hard to accomplish, just take an existing Dash spell and modify it to cast again once it reaches the first point, then cast again when it reaches the second point. For determining the Points, use the unit's facing Angle + the Point with polar offset function to figure it out.

Edit: Had the wrong degrees, fixed it:
Facing angle - 30 degrees with an offset of 200 = first point
Facing angle + 30 degrees with an offset of 200 = second point
third point = the starting position of the unit.

Store that information when the spell is first cast and then reference it later on in your other Dash triggers.

You can use Distance checks to see if the unit has reached it's destination or just make the unit always move at a constant rate so you know exactly when it'll reach a Point.
 
Last edited:
Level 24
Joined
Feb 27, 2019
Messages
833
Well I do not know if it was dash in the first place or maybe i could also call it "move" or moving triangle shape, but so maybe I just thought that i could call it triangle dash was like that, sorry for the late reply
Thats fine, it wasnt late. I wanted to make sure that there werent additional requirements to the spell. I spent a lot of time to create a dash/charge spell system using techniques I have seen used before and with a lot of configurability from trying to configure other systems myself. Its a very common approach that uses dynamic indexing. Tell me if it works for you or if you have any questions.
  • Triangle Dash Start 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fan of Knives
    • Actions
      • Set VariableSet DashMax = (DashMax + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DashMax Equal to 1
        • Then - Actions
          • Trigger - Turn on Dash Periodic <gen>
        • Else - Actions
      • Set VariableSet DashUnit[DashMax] = (Triggering unit)
      • -------- Sets the amount of dashes --------
      • Set VariableSet DashAmount[DashMax] = 3
      • -------- Sets the distance of each dash --------
      • Set VariableSet DashDistance[DashMax] = 256.00
      • -------- Sets the distance traveled each period of 0.03 seconds. Needs to be dividable with DashDistance to a full integer --------
      • Set VariableSet DashSpeed[DashMax] = (DashDistance[DashMax] / 8.00)
      • -------- Saves the original angle of the casting unit --------
      • Set VariableSet DashAngleOriginal[DashMax] = (Facing of DashUnit[DashMax])
      • -------- Decides wether or not the original angle should be restored after the spell is finished --------
      • Set VariableSet DashAngleOriginalBool[DashMax] = True
      • -------- Sets the first angle --------
      • Set VariableSet DashAngle[DashMax] = (DashAngleOriginal[DashMax] + 30.00)
      • -------- Sets the changle in degrees for the next dashes if DashAmount is greater than 1. The angle is reduced by this amount --------
      • Set VariableSet DashAngleChange[DashMax] = 120.00
      • Unit - Make DashUnit[DashMax] face DashAngle[DashMax]
      • Animation - Play DashUnit[DashMax]'s attack animation
      • -------- Sets the animation the unit plays --------
      • Set VariableSet DashAnimationString[DashMax] = attack
      • -------- Sets the effect that continually occurs during the spell --------
      • Set VariableSet DashEffectString[DashMax] = Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
      • -------- Sets how often the effect occurs --------
      • Set VariableSet DashEffectInterval[DashMax] = 2
      • -------- Sets if the effect occurs on the units position or on the unit itself --------
      • Set VariableSet DashEffectPointBool[DashMax] = True
      • -------- Configurable option to allow a customizable event to occur during each period or at the end of each dash --------
      • Set VariableSet DashType[DashMax] = 1
      • -------- Creates an effect on the unit that is destroyed when the spell is finished --------
      • Special Effect - Create a special effect attached to the chest of DashUnit[DashMax] using <Empty String>
      • Set VariableSet DashUnitEffect[DashMax] = (Last created special effect)
      • Unit Group - Add DashUnit[DashMax] to DashGroup
      • Countdown Timer - Start DashTimer as a One-shot timer that will expire in 0.00 seconds
  • Triangle Dash Start 2
    • Events
      • Time - DashTimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DashGroup and do (Actions)
        • Loop - Actions
          • Custom script: call BlzPauseUnitEx(GetEnumUnit(), true)
          • Unit Group - Remove (Picked unit) from DashGroup.
  • Dash Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DashIndex) from 1 to DashMax, do (Actions)
        • Loop - Actions
          • Set VariableSet TempPoint[0] = (Position of DashUnit[DashIndex])
          • Set VariableSet TempPoint[1] = (TempPoint[0] offset by DashSpeed[DashIndex] towards DashAngle[DashIndex] degrees.)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and DashEffectInterval[DashIndex]) Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DashEffectPointBool[DashIndex] Equal to True
                • Then - Actions
                  • Special Effect - Create a special effect at TempPoint[1] using DashEffectString[DashIndex]
                • Else - Actions
                  • Special Effect - Create a special effect attached to the origin of DashUnit[DashIndex] using DashEffectString[DashIndex]
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • Set VariableSet DashX = (X of TempPoint[1])
          • Set VariableSet DashY = (Y of TempPoint[1])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DashType[DashIndex] Equal to 1
            • Then - Actions
            • Else - Actions
          • Custom script: call SetUnitX(udg_DashUnit[udg_DashIndex], udg_DashX)
          • Custom script: call SetUnitY(udg_DashUnit[udg_DashIndex], udg_DashY)
          • Custom script: call RemoveLocation(udg_TempPoint[0])
          • Custom script: call RemoveLocation(udg_TempPoint[1])
          • Set VariableSet DashDistanceProgress[DashIndex] = (DashDistanceProgress[DashIndex] + DashSpeed[DashIndex])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DashDistanceProgress[DashIndex] Greater than or equal to DashDistance[DashIndex]
            • Then - Actions
              • Set VariableSet DashDistanceProgress[DashIndex] = 0.00
              • Set VariableSet DashAngle[DashIndex] = (DashAngle[DashIndex] - DashAngleChange[DashIndex])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DashType[DashIndex] Equal to 1
                • Then - Actions
                • Else - Actions
              • Set VariableSet DashAmount[DashIndex] = (DashAmount[DashIndex] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DashAmount[DashIndex] Equal to 0
                • Then - Actions
                  • Custom script: call BlzPauseUnitEx(udg_DashUnit[udg_DashIndex], false)
                  • Animation - Queue DashUnit[DashIndex]'s stand animation
                  • Special Effect - Destroy DashUnitEffect[DashIndex]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DashAngleOriginalBool[DashIndex] Equal to True
                    • Then - Actions
                      • Unit - Make DashUnit[DashIndex] face DashAngleOriginal[DashIndex]
                    • Else - Actions
                  • Set VariableSet DashAmount[DashIndex] = DashAmount[DashMax]
                  • Set VariableSet DashAngle[DashIndex] = DashAngle[DashMax]
                  • Set VariableSet DashAngleChange[DashIndex] = DashAngleChange[DashMax]
                  • Set VariableSet DashAngleOriginal[DashIndex] = DashAngleOriginal[DashMax]
                  • Set VariableSet DashAngleOriginalBool[DashIndex] = DashAngleOriginalBool[DashMax]
                  • Set VariableSet DashDistance[DashIndex] = DashDistance[DashMax]
                  • Set VariableSet DashDistanceProgress[DashIndex] = DashDistanceProgress[DashMax]
                  • Set VariableSet DashSpeed[DashIndex] = DashSpeed[DashMax]
                  • Set VariableSet DashUnit[DashIndex] = DashUnit[DashMax]
                  • Set VariableSet DashUnitEffect[DashIndex] = DashUnitEffect[DashMax]
                  • Set VariableSet DashAnimationString[DashIndex] = DashAnimationString[DashMax]
                  • Set VariableSet DashEffectString[DashIndex] = DashEffectString[DashMax]
                  • Set VariableSet DashEffectInterval[DashIndex] = DashEffectInterval[DashMax]
                  • Set VariableSet DashEffectPointBool[DashIndex] = DashEffectPointBool[DashMax]
                  • Set VariableSet DashType[DashIndex] = DashType[DashMax]
                  • Set VariableSet DashMax = (DashMax - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DashMax Equal to 0
                    • Then - Actions
                      • Trigger - Turn off Dash Periodic <gen>
                    • Else - Actions
                • Else - Actions
                  • Unit - Make DashUnit[DashIndex] face DashAngle[DashIndex]
            • Else - Actions
EDIT: I forgot to add any check for pathing but it shouldnt matter for the Triangle Dash spell at least...
 

Attachments

  • Dash charge spell system.w3m
    22.4 KB · Views: 6
Last edited:
Level 8
Joined
Oct 6, 2022
Messages
185
Thats fine, it wasnt late. I wanted to make sure that there werent additional requirements to the spell. I spent a lot of time to create a dash/charge spell system using techniques I have seen used before and with a lot of configurability from trying to configure other systems myself. Its a very common approach that uses dynamic indexing. Tell me if it works for you or if you have any questions.
  • Triangle Dash Start 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fan of Knives
    • Actions
      • Set VariableSet DashMax = (DashMax + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DashMax Equal to 1
        • Then - Actions
          • Trigger - Turn on Dash Periodic <gen>
        • Else - Actions
      • Set VariableSet DashUnit[DashMax] = (Triggering unit)
      • -------- Sets the amount of dashes --------
      • Set VariableSet DashAmount[DashMax] = 3
      • -------- Sets the distance of each dash --------
      • Set VariableSet DashDistance[DashMax] = 256.00
      • -------- Sets the distance traveled each period of 0.03 seconds. Needs to be dividable with DashDistance to a full integer --------
      • Set VariableSet DashSpeed[DashMax] = (DashDistance[DashMax] / 8.00)
      • -------- Saves the original angle of the casting unit --------
      • Set VariableSet DashAngleOriginal[DashMax] = (Facing of DashUnit[DashMax])
      • -------- Decides wether or not the original angle should be restored after the spell is finished --------
      • Set VariableSet DashAngleOriginalBool[DashMax] = True
      • -------- Sets the first angle --------
      • Set VariableSet DashAngle[DashMax] = (DashAngleOriginal[DashMax] + 30.00)
      • -------- Sets the changle in degrees for the next dashes if DashAmount is greater than 1. The angle is reduced by this amount --------
      • Set VariableSet DashAngleChange[DashMax] = 120.00
      • Unit - Make DashUnit[DashMax] face DashAngle[DashMax]
      • Animation - Play DashUnit[DashMax]'s attack animation
      • -------- Sets the animation the unit plays --------
      • Set VariableSet DashAnimationString[DashMax] = attack
      • -------- Sets the effect that continually occurs during the spell --------
      • Set VariableSet DashEffectString[DashMax] = Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
      • -------- Sets how often the effect occurs --------
      • Set VariableSet DashEffectInterval[DashMax] = 2
      • -------- Sets if the effect occurs on the units position or on the unit itself --------
      • Set VariableSet DashEffectPointBool[DashMax] = True
      • -------- Configurable option to allow a customizable event to occur during each period or at the end of each dash --------
      • Set VariableSet DashType[DashMax] = 1
      • -------- Creates an effect on the unit that is destroyed when the spell is finished --------
      • Special Effect - Create a special effect attached to the chest of DashUnit[DashMax] using <Empty String>
      • Set VariableSet DashUnitEffect[DashMax] = (Last created special effect)
      • Unit Group - Add DashUnit[DashMax] to DashGroup
      • Countdown Timer - Start DashTimer as a One-shot timer that will expire in 0.00 seconds
  • Triangle Dash Start 2
    • Events
      • Time - DashTimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DashGroup and do (Actions)
        • Loop - Actions
          • Custom script: call BlzPauseUnitEx(GetEnumUnit(), true)
          • Unit Group - Remove (Picked unit) from DashGroup.
  • Dash Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DashIndex) from 1 to DashMax, do (Actions)
        • Loop - Actions
          • Set VariableSet TempPoint[0] = (Position of DashUnit[DashIndex])
          • Set VariableSet TempPoint[1] = (TempPoint[0] offset by DashSpeed[DashIndex] towards DashAngle[DashIndex] degrees.)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and DashEffectInterval[DashIndex]) Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DashEffectPointBool[DashIndex] Equal to True
                • Then - Actions
                  • Special Effect - Create a special effect at TempPoint[1] using DashEffectString[DashIndex]
                • Else - Actions
                  • Special Effect - Create a special effect attached to the origin of DashUnit[DashIndex] using DashEffectString[DashIndex]
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • Set VariableSet DashX = (X of TempPoint[1])
          • Set VariableSet DashY = (Y of TempPoint[1])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DashType[DashIndex] Equal to 1
            • Then - Actions
            • Else - Actions
          • Custom script: call SetUnitX(udg_DashUnit[udg_DashIndex], udg_DashX)
          • Custom script: call SetUnitY(udg_DashUnit[udg_DashIndex], udg_DashY)
          • Custom script: call RemoveLocation(udg_TempPoint[0])
          • Custom script: call RemoveLocation(udg_TempPoint[1])
          • Set VariableSet DashDistanceProgress[DashIndex] = (DashDistanceProgress[DashIndex] + DashSpeed[DashIndex])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DashDistanceProgress[DashIndex] Greater than or equal to DashDistance[DashIndex]
            • Then - Actions
              • Set VariableSet DashDistanceProgress[DashIndex] = 0.00
              • Set VariableSet DashAngle[DashIndex] = (DashAngle[DashIndex] - DashAngleChange[DashIndex])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DashType[DashIndex] Equal to 1
                • Then - Actions
                • Else - Actions
              • Set VariableSet DashAmount[DashIndex] = (DashAmount[DashIndex] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DashAmount[DashIndex] Equal to 0
                • Then - Actions
                  • Custom script: call BlzPauseUnitEx(udg_DashUnit[udg_DashIndex], false)
                  • Animation - Queue DashUnit[DashIndex]'s stand animation
                  • Special Effect - Destroy DashUnitEffect[DashIndex]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DashAngleOriginalBool[DashIndex] Equal to True
                    • Then - Actions
                      • Unit - Make DashUnit[DashIndex] face DashAngleOriginal[DashIndex]
                    • Else - Actions
                  • Set VariableSet DashAmount[DashIndex] = DashAmount[DashMax]
                  • Set VariableSet DashAngle[DashIndex] = DashAngle[DashMax]
                  • Set VariableSet DashAngleChange[DashIndex] = DashAngleChange[DashMax]
                  • Set VariableSet DashAngleOriginal[DashIndex] = DashAngleOriginal[DashMax]
                  • Set VariableSet DashAngleOriginalBool[DashIndex] = DashAngleOriginalBool[DashMax]
                  • Set VariableSet DashDistance[DashIndex] = DashDistance[DashMax]
                  • Set VariableSet DashDistanceProgress[DashIndex] = DashDistanceProgress[DashMax]
                  • Set VariableSet DashSpeed[DashIndex] = DashSpeed[DashMax]
                  • Set VariableSet DashUnit[DashIndex] = DashUnit[DashMax]
                  • Set VariableSet DashUnitEffect[DashIndex] = DashUnitEffect[DashMax]
                  • Set VariableSet DashAnimationString[DashIndex] = DashAnimationString[DashMax]
                  • Set VariableSet DashEffectString[DashIndex] = DashEffectString[DashMax]
                  • Set VariableSet DashEffectInterval[DashIndex] = DashEffectInterval[DashMax]
                  • Set VariableSet DashEffectPointBool[DashIndex] = DashEffectPointBool[DashMax]
                  • Set VariableSet DashType[DashIndex] = DashType[DashMax]
                  • Set VariableSet DashMax = (DashMax - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DashMax Equal to 0
                    • Then - Actions
                      • Trigger - Turn off Dash Periodic <gen>
                    • Else - Actions
                • Else - Actions
                  • Unit - Make DashUnit[DashIndex] face DashAngle[DashIndex]
            • Else - Actions
EDIT: I forgot to add any check for pathing but it shouldnt matter for the Triangle Dash spell at least...
Thanks, I'll use this as my other method if ever the case
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Here's my take! I wanted to try and keep it simple. The first version is purely movement based while the second version has a damage component.

  • Tri Dash Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tri Dash
    • Actions
      • Set VariableSet Tri_Unit = (Triggering unit)
      • Set VariableSet Tri_CV = (Custom value of Tri_Unit)
      • Set VariableSet Tri_Level = (Level of (Ability being cast) for Tri_Unit)
      • -------- --------
      • -------- [ ================== CUSTOMIZE ================== ] --------
      • -------- The Loop trigger runs every 0.02 seconds so keep that in mind when defining the Speed: --------
      • Set VariableSet Tri_Speed[Tri_CV] = 35.00
      • Set VariableSet Tri_Max_Distance[Tri_CV] = 490.00
      • -------- [ ===================== STOP ===================== ] --------
      • -------- --------
      • Set VariableSet Tri_Angle[0] = (Facing of Tri_Unit)
      • Set VariableSet Tri_Point1[Tri_CV] = (Position of Tri_Unit)
      • Set VariableSet Tri_Point2[Tri_CV] = (Tri_Point1[Tri_CV] offset by Tri_Max_Distance[Tri_CV] towards (Tri_Angle[0] - 30.00) degrees.)
      • Set VariableSet Tri_Point3[Tri_CV] = (Tri_Point1[Tri_CV] offset by Tri_Max_Distance[Tri_CV] towards (Tri_Angle[0] + 30.00) degrees.)
      • Set VariableSet Tri_Angle[Tri_CV] = (Tri_Angle[0] - 30.00)
      • -------- --------
      • Set VariableSet Tri_Current_Destination[Tri_CV] = 1
      • Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00
      • Set VariableSet Tri_Max_Distance[Tri_CV] = (Tri_Max_Distance[Tri_CV] - 0.01)
      • Set VariableSet Tri_Is_Playing_Animation[Tri_CV] = False
      • -------- --------
      • Special Effect - Create a special effect at Tri_Point1[Tri_CV] using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
      • Set VariableSet Tri_Sfx[Tri_CV] = (Last created special effect)
      • Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))
      • -------- --------
      • Unit - Turn collision for Tri_Unit Off.
      • Custom script: call BlzPauseUnitEx(udg_Tri_Unit, true)
      • Unit - Make Tri_Unit face Tri_Angle[Tri_CV]
      • -------- --------
      • Unit Group - Add Tri_Unit to Tri_Unit_Group
      • Trigger - Turn on Tri Dash Loop <gen>
  • Tri Dash Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Tri_Unit_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Tri_Unit = (Picked unit)
          • Set VariableSet Tri_CV = (Custom value of Tri_Unit)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tri_Unit is alive) Equal to True
            • Then - Actions
              • Set VariableSet Tri_Current_Distance[Tri_CV] = (Tri_Current_Distance[Tri_CV] + Tri_Speed[Tri_CV])
              • -------- --------
              • -------- Determine what to do next based on the Point that the unit is currently on: --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Tri_Current_Destination[Tri_CV] Equal to 1
                • Then - Actions
                  • -------- We need to delay the animation by at least 1 frame: --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Tri_Is_Playing_Animation[Tri_CV] Equal to False
                    • Then - Actions
                      • Set VariableSet Tri_Is_Playing_Animation[Tri_CV] = True
                      • Custom script: call SetUnitAnimationByIndex(udg_Tri_Unit, 6)
                    • Else - Actions
                  • -------- --------
                  • Set VariableSet Tri_Point1[0] = (Tri_Point1[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]
                    • Then - Actions
                      • Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00
                      • Set VariableSet Tri_Current_Destination[Tri_CV] = (Tri_Current_Destination[Tri_CV] + 1)
                      • Set VariableSet Tri_Angle[Tri_CV] = (Angle from Tri_Point2[Tri_CV] to Tri_Point3[Tri_CV])
                      • Unit - Make Tri_Unit face Tri_Angle[Tri_CV]
                      • Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Tri_Current_Destination[Tri_CV] Equal to 2
                    • Then - Actions
                      • Set VariableSet Tri_Point1[0] = (Tri_Point2[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]
                        • Then - Actions
                          • Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00
                          • Set VariableSet Tri_Current_Destination[Tri_CV] = (Tri_Current_Destination[Tri_CV] + 1)
                          • Set VariableSet Tri_Angle[Tri_CV] = (Angle from Tri_Point3[Tri_CV] to Tri_Point1[Tri_CV])
                          • Unit - Make Tri_Unit face Tri_Angle[Tri_CV]
                          • Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))
                        • Else - Actions
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Tri_Current_Destination[Tri_CV] Equal to 3
                        • Then - Actions
                          • Set VariableSet Tri_Point1[0] = (Tri_Point3[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]
                            • Then - Actions
                              • Animation - Reset Tri_Unit's animation
                              • Trigger - Run Tri Dash End <gen> (ignoring conditions)
                            • Else - Actions
                        • Else - Actions
              • -------- --------
              • Unit - Move Tri_Unit instantly to Tri_Point1[0]
              • Special Effect - Set Position of Tri_Sfx[Tri_CV] to Tri_Point1[0]
              • -------- --------
              • Custom script: call RemoveLocation(udg_Tri_Point1[0])
            • Else - Actions
              • -------- The unit is dead: --------
              • Trigger - Run Tri Dash End <gen> (ignoring conditions)
  • Tri Dash End
    • Events
    • Conditions
    • Actions
      • Special Effect - Destroy Tri_Sfx[Tri_CV]
      • Unit - Turn collision for Tri_Unit On.
      • Custom script: call BlzPauseUnitEx(udg_Tri_Unit, false)
      • Custom script: call RemoveLocation(udg_Tri_Point1[udg_Tri_CV])
      • Custom script: call RemoveLocation(udg_Tri_Point2[udg_Tri_CV])
      • Custom script: call RemoveLocation(udg_Tri_Point3[udg_Tri_CV])
      • Unit Group - Remove Tri_Unit from Tri_Unit_Group.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Tri_Unit_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off Tri Dash Loop <gen>
        • Else - Actions
  • Tri Dash Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tri Dash
    • Actions
      • Set VariableSet Tri_Unit = (Triggering unit)
      • Set VariableSet Tri_CV = (Custom value of Tri_Unit)
      • Set VariableSet Tri_Level = (Level of (Ability being cast) for Tri_Unit)
      • -------- --------
      • -------- [ ================== CUSTOMIZE ================== ] --------
      • -------- Movement: --------
      • Set VariableSet Tri_Speed[Tri_CV] = 35.00
      • Set VariableSet Tri_Max_Distance[Tri_CV] = 490.00
      • -------- [ ===================== STOP ===================== ] --------
      • -------- --------
      • Set VariableSet Tri_Angle[0] = (Facing of Tri_Unit)
      • Set VariableSet Tri_Point1[Tri_CV] = (Position of Tri_Unit)
      • Set VariableSet Tri_Point2[Tri_CV] = (Tri_Point1[Tri_CV] offset by Tri_Max_Distance[Tri_CV] towards (Tri_Angle[0] - 30.00) degrees.)
      • Set VariableSet Tri_Point3[Tri_CV] = (Tri_Point1[Tri_CV] offset by Tri_Max_Distance[Tri_CV] towards (Tri_Angle[0] + 30.00) degrees.)
      • Set VariableSet Tri_Angle[Tri_CV] = (Tri_Angle[0] - 30.00)
      • -------- --------
      • -------- [ ================== CUSTOMIZE ================== ] --------
      • -------- Damage: --------
      • Set VariableSet Tri_Damage_Point[Tri_CV] = (Tri_Point1[Tri_CV] offset by (Tri_Max_Distance[Tri_CV] / 2.00) towards Tri_Angle[0] degrees.)
      • Set VariableSet Tri_Damage_Radius[Tri_CV] = (Tri_Max_Distance[Tri_CV] / 2.00)
      • Set VariableSet Tri_Damage_Amount[Tri_CV] = (15.00 x (Real(Tri_Level)))
      • Set VariableSet Tri_Damage_Max_Delay[Tri_CV] = 7
      • Set VariableSet Tri_Damage_Current_Delay[Tri_CV] = Tri_Damage_Max_Delay[Tri_CV]
      • -------- [ ===================== STOP ===================== ] --------
      • -------- --------
      • Set VariableSet Tri_Current_Destination[Tri_CV] = 1
      • Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00
      • Set VariableSet Tri_Max_Distance[Tri_CV] = (Tri_Max_Distance[Tri_CV] - 0.01)
      • Set VariableSet Tri_Is_Playing_Animation[Tri_CV] = False
      • -------- --------
      • Special Effect - Create a special effect at Tri_Point1[Tri_CV] using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
      • Set VariableSet Tri_Sfx[Tri_CV] = (Last created special effect)
      • Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))
      • -------- --------
      • Unit - Turn collision for Tri_Unit Off.
      • Custom script: call BlzPauseUnitEx(udg_Tri_Unit, true)
      • Unit - Make Tri_Unit face Tri_Angle[Tri_CV]
      • -------- --------
      • Unit Group - Add Tri_Unit to Tri_Unit_Group
      • Trigger - Turn on Tri Dash Loop <gen>
  • Tri Dash Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Tri_Unit_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Tri_Unit = (Picked unit)
          • Set VariableSet Tri_CV = (Custom value of Tri_Unit)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tri_Unit is alive) Equal to True
            • Then - Actions
              • Set VariableSet Tri_Current_Distance[Tri_CV] = (Tri_Current_Distance[Tri_CV] + Tri_Speed[Tri_CV])
              • -------- --------
              • -------- Determine what to do next based on the Point that the unit is currently on: --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Tri_Current_Destination[Tri_CV] Equal to 1
                • Then - Actions
                  • -------- We need to delay the animation by at least 1 frame: --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Tri_Is_Playing_Animation[Tri_CV] Equal to False
                    • Then - Actions
                      • Set VariableSet Tri_Is_Playing_Animation[Tri_CV] = True
                      • Custom script: call SetUnitAnimationByIndex(udg_Tri_Unit, 6)
                    • Else - Actions
                  • -------- --------
                  • Set VariableSet Tri_Point1[0] = (Tri_Point1[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]
                    • Then - Actions
                      • Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00
                      • Set VariableSet Tri_Current_Destination[Tri_CV] = (Tri_Current_Destination[Tri_CV] + 1)
                      • Set VariableSet Tri_Angle[Tri_CV] = (Angle from Tri_Point2[Tri_CV] to Tri_Point3[Tri_CV])
                      • Unit - Make Tri_Unit face Tri_Angle[Tri_CV]
                      • Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Tri_Current_Destination[Tri_CV] Equal to 2
                    • Then - Actions
                      • Set VariableSet Tri_Point1[0] = (Tri_Point2[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]
                        • Then - Actions
                          • Set VariableSet Tri_Current_Distance[Tri_CV] = 0.00
                          • Set VariableSet Tri_Current_Destination[Tri_CV] = (Tri_Current_Destination[Tri_CV] + 1)
                          • Set VariableSet Tri_Angle[Tri_CV] = (Angle from Tri_Point3[Tri_CV] to Tri_Point1[Tri_CV])
                          • Unit - Make Tri_Unit face Tri_Angle[Tri_CV]
                          • Special Effect - Set Yaw of Tri_Sfx[Tri_CV] to: (Radians(Tri_Angle[Tri_CV]))
                        • Else - Actions
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Tri_Current_Destination[Tri_CV] Equal to 3
                        • Then - Actions
                          • Set VariableSet Tri_Point1[0] = (Tri_Point3[Tri_CV] offset by Tri_Current_Distance[Tri_CV] towards Tri_Angle[Tri_CV] degrees.)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Tri_Current_Distance[Tri_CV] Greater than or equal to Tri_Max_Distance[Tri_CV]
                            • Then - Actions
                              • Animation - Reset Tri_Unit's animation
                              • Trigger - Run Tri Dash End <gen> (ignoring conditions)
                            • Else - Actions
                        • Else - Actions
              • -------- --------
              • Unit - Move Tri_Unit instantly to Tri_Point1[0]
              • Special Effect - Set Position of Tri_Sfx[Tri_CV] to Tri_Point1[0]
              • -------- --------
              • -------- Damage: --------
              • Set VariableSet Tri_Damage_Current_Delay[Tri_CV] = (Tri_Damage_Current_Delay[Tri_CV] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Tri_Damage_Current_Delay[Tri_CV] Greater than or equal to Tri_Damage_Max_Delay[Tri_CV]
                • Then - Actions
                  • Set VariableSet Tri_Damage_Current_Delay[Tri_CV] = 0
                  • Set VariableSet Tri_Damage_Group = (Units within Tri_Damage_Radius[Tri_CV] of Tri_Damage_Point[Tri_CV].)
                  • Unit Group - Pick every unit in Tri_Damage_Group and do (Actions)
                    • Loop - Actions
                      • Set VariableSet Tri_Target = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Tri_Target belongs to an enemy of (Owner of Tri_Unit).) Equal to True
                          • (Tri_Target is alive) Equal to True
                          • (Tri_Target is A structure) Equal to False
                          • (Tri_Target is invulnerable) Equal to False
                        • Then - Actions
                          • Special Effect - Create a special effect attached to the chest of Tri_Target using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Unit - Cause Tri_Unit to damage Tri_Target, dealing Tri_Damage_Amount[Tri_CV] damage of attack type Spells and damage type Normal
                        • Else - Actions
                  • Custom script: call DestroyGroup(udg_Tri_Damage_Group)
                • Else - Actions
              • -------- --------
              • Custom script: call RemoveLocation(udg_Tri_Point1[0])
            • Else - Actions
              • -------- The unit is dead: --------
              • Trigger - Run Tri Dash End <gen> (ignoring conditions)
  • Tri Dash End
    • Events
    • Conditions
    • Actions
      • Special Effect - Destroy Tri_Sfx[Tri_CV]
      • Unit - Turn collision for Tri_Unit On.
      • Custom script: call BlzPauseUnitEx(udg_Tri_Unit, false)
      • Custom script: call RemoveLocation(udg_Tri_Point1[udg_Tri_CV])
      • Custom script: call RemoveLocation(udg_Tri_Point2[udg_Tri_CV])
      • Custom script: call RemoveLocation(udg_Tri_Point3[udg_Tri_CV])
      • Custom script: call RemoveLocation(udg_Tri_Damage_Point[udg_Tri_CV])
      • Unit Group - Remove Tri_Unit from Tri_Unit_Group.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Tri_Unit_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off Tri Dash Loop <gen>
        • Else - Actions

Variables:
Tri_Unit = Unit
Tri_Unit_Group = Unit Group
Tri_Speed = Real (array)
Tri_Current_Distance = Real (array)
Tri_Max_Distance = Real (array)
Tri_Angle = Real (array)
Tri_CV = Integer
Tri_Level = Integer
Tri_Current_Destination = Integer (array)
Tri_Point1 = Point (array)
Tri_Point2 = Point (array)
Tri_Point3 = Point (array)
Tri_Is_Playing_Animation = Boolean (array)
Tri_Sfx = Special Effect (array)

For version 2 only:
Tri_Damage_Point = Point (array)
Tri_Damage_Group = Unit Group
Tri_Damage_Radius = Real (array)
Tri_Damage_Amount = Real (array)
Tri_Damage_Current_Delay = Integer (array)
Tri_Damage_Max_Delay = Integer (array)
Tri_Target = Unit

Requires a Unit Indexer!
 

Attachments

  • Tri Dash 1.w3m
    26 KB · Views: 6
  • Tri Dash 2.w3m
    28.3 KB · Views: 8
Last edited:
Level 8
Joined
Oct 6, 2022
Messages
185
What's the purpose of these
"Custom script: call BlzPauseUnitEx(GetEnumUnit(), true)"
&
"Custom script: call BlzPauseUnitEx(udg_DashUnit[udg_DashIndex], false)"
@Duckfarter , since it is gaving me a Syntax Errors? Is there a way to stop the loop? thanks in advance
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Are you writing the words "Custom script" in the Custom Script action?
  • Custom script: Custom script: call BlzPauseUnitEx(GetEnumUnit(), true)
Because you're only supposed to write the function name:
  • Custom script: call BlzPauseUnitEx(GetEnumUnit(), true)
This function Stuns the unit.

Your variable names also need to be exactly the same as his.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Oh I completely forgot, that function doesn't exist on your version.

Undeclared function means that the function doesn't exist. You see it even suggests a function that DOES exist with a similar name -> PauseUnitBJ.

Instead, you can order a Dummy unit to cast a long duration Stun on the Hero and then Remove the Stun buff when the Dash is finished. Note that this method has some potential issues, for example if your Hero has a Spell Shield then it will block the Stun. Another decent solution is to constantly issue the Hero to Stop inside of the Loop trigger. This should prevent it from doing most things.
 
Level 24
Joined
Feb 27, 2019
Messages
833
Its possible the spell re-triggers itself if the dummy spell is not entirely cast which would cause the unit to begin casting it anew and so on. It was created with the fan of knives type order in mind so its possible it works differently with another type of order. That is also why I pause the unit when the timer expires.
 
Status
Not open for further replies.
Top