• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Doubt with trigger for dash

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,867
Here you go, I made an Instant and Point version.

The settings can be customized here:
  • -------- Define duration, speed, and interval (caster moves offset by speed per interval): --------
  • Set VariableSet Dash__Duration[Dash_Id] = 1.00
  • Set VariableSet Dash__Speed[Dash_Id] = 10.00
  • Set VariableSet Dash__Interval[Dash_Id] = 0.02
  • Set VariableSet Dash__Checks_Pathing[Dash_Id] = True
By default, dash lasts 1 second, moves the caster 10.00 units every 0.02 seconds (500 distance covered, 10 * 50), and checks for valid pathing before moving.

No idea if these are the mechanics you wanted since the gif doesn't really explain much but this should get you on the right track. Also, I cannot promise a 100% success rate with the pathing stuff, your caster may end up stuck somewhere if you're not careful.
 

Attachments

  • Dash Spells 1.w3m
    38.6 KB · Views: 7
Last edited:
Level 13
Joined
Feb 5, 2018
Messages
567
I made a very simple dash spell for you. It requires Unit Indexer which I attached to the testmap so you can copy the unit indexer and the spell from the same folder. This is very basic, doesn't take pathing into consideration. And doesn't break down trees or does not go over unpathable areas, cliffs for example. IF you want it to ignore unit and terrain collision I can add a small fly height to the unit.


This is completely modifiable. You can adjust time, distance(the skill in Object editor) add damage, animations, change special effect and so on.
My math sucks so I couldn't make it automatically last the same amount as the spell distance in the object editor, but as I said you can modify to your needs.

EDIT: Woops, uncle beat it to me.

  • Dash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • -------- Needs Unit Indexer to work you can copy the folder from this testmap --------
      • -------- Custom Value --------
      • Set VariableSet DashCV = (Custom value of (Triggering unit))
      • -------- Caster --------
      • Set VariableSet DashCaster[DashCV] = (Triggering unit)
      • -------- Starting Point --------
      • Set VariableSet DashStart[DashCV] = (Position of DashCaster[DashCV])
      • -------- End Point --------
      • Set VariableSet DashEnd[DashCV] = (Target point of ability being cast)
      • -------- Angle --------
      • Set VariableSet DashAngle[DashCV] = (Angle from DashStart[DashCV] to DashEnd[DashCV])
      • -------- Time --------
      • Set VariableSet DashTime[DashCV] = 1.00
      • -------- Add Caster to Group --------
      • Unit Group - Add DashCaster[DashCV] to DashGroup
      • -------- Check if Loop is running --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in DashGroup) Greater than 0
        • Then - Actions
          • Trigger - Turn on Dash Loop <gen>
        • Else - Actions

  • Dash Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DashGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet DashCV = (Custom value of (Picked unit))
          • Set VariableSet DashTime[DashCV] = (DashTime[DashCV] - 0.03)
          • Set VariableSet DashStart[DashCV] = (Position of (Picked unit))
          • -------- Check time /// if time is over remove caster and clean up locations --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DashTime[DashCV] Less than or equal to 0.00
            • Then - Actions
              • Unit Group - Remove DashCaster[DashCV] from DashGroup.
              • Custom script: call RemoveLocation (udg_DashStart[udg_DashCV])
              • Custom script: call RemoveLocation (udg_DashEnd[udg_DashCV])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in DashGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • -------- Check time /// if time is not over move unit and create special effect --------
              • Special Effect - Create a special effect attached to the origin of DashCaster[DashCV] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
              • Set VariableSet Dash_SFX[DashCV] = (Last created special effect)
              • Special Effect - Destroy Dash_SFX[DashCV]
              • Unit - Move (Picked unit) instantly to (DashStart[DashCV] offset by 18.00 towards DashAngle[DashCV] degrees.)
 

Attachments

  • Dash.w3m
    23.1 KB · Views: 6

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
Here you go, I made an Instant and Point version.

The settings can be customized here:
  • -------- Define duration, speed, and interval (caster moves offset by speed per interval): --------
  • Set VariableSet Dash__Duration[Dash_Id] = 1.00
  • Set VariableSet Dash__Speed[Dash_Id] = 10.00
  • Set VariableSet Dash__Interval[Dash_Id] = 0.02
  • Set VariableSet Dash__Checks_Pathing[Dash_Id] = True
By default, dash lasts 1 second, moves the caster 10.00 units every 0.02 seconds (500 distance covered, 10 * 50), and checks for valid pathing before moving.

No idea if these are the mechanics you wanted since the gif doesn't really explain much but this should get you on the right track. Also, I cannot promise a 100% success rate with the pathing stuff, your caster may end up stuck somewhere if you're not careful.
I tested the trigger and it's great, I just have a question about the casting delay when the skill is triggered. How do I set this casting time so that the casting is instantaneous?
 

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
I made a very simple dash spell for you. It requires Unit Indexer which I attached to the testmap so you can copy the unit indexer and the spell from the same folder. This is very basic, doesn't take pathing into consideration. And doesn't break down trees or does not go over unpathable areas, cliffs for example. IF you want it to ignore unit and terrain collision I can add a small fly height to the unit.


This is completely modifiable. You can adjust time, distance(the skill in Object editor) add damage, animations, change special effect and so on.
My math sucks so I couldn't make it automatically last the same amount as the spell distance in the object editor, but as I said you can modify to your needs.

EDIT: Woops, uncle beat it to me.

  • Dash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • -------- Needs Unit Indexer to work you can copy the folder from this testmap --------
      • -------- Custom Value --------
      • Set VariableSet DashCV = (Custom value of (Triggering unit))
      • -------- Caster --------
      • Set VariableSet DashCaster[DashCV] = (Triggering unit)
      • -------- Starting Point --------
      • Set VariableSet DashStart[DashCV] = (Position of DashCaster[DashCV])
      • -------- End Point --------
      • Set VariableSet DashEnd[DashCV] = (Target point of ability being cast)
      • -------- Angle --------
      • Set VariableSet DashAngle[DashCV] = (Angle from DashStart[DashCV] to DashEnd[DashCV])
      • -------- Time --------
      • Set VariableSet DashTime[DashCV] = 1.00
      • -------- Add Caster to Group --------
      • Unit Group - Add DashCaster[DashCV] to DashGroup
      • -------- Check if Loop is running --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in DashGroup) Greater than 0
        • Then - Actions
          • Trigger - Turn on Dash Loop <gen>
        • Else - Actions

  • Dash Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DashGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet DashCV = (Custom value of (Picked unit))
          • Set VariableSet DashTime[DashCV] = (DashTime[DashCV] - 0.03)
          • Set VariableSet DashStart[DashCV] = (Position of (Picked unit))
          • -------- Check time /// if time is over remove caster and clean up locations --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DashTime[DashCV] Less than or equal to 0.00
            • Then - Actions
              • Unit Group - Remove DashCaster[DashCV] from DashGroup.
              • Custom script: call RemoveLocation (udg_DashStart[udg_DashCV])
              • Custom script: call RemoveLocation (udg_DashEnd[udg_DashCV])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in DashGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • -------- Check time /// if time is not over move unit and create special effect --------
              • Special Effect - Create a special effect attached to the origin of DashCaster[DashCV] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
              • Set VariableSet Dash_SFX[DashCV] = (Last created special effect)
              • Special Effect - Destroy Dash_SFX[DashCV]
              • Unit - Move (Picked unit) instantly to (DashStart[DashCV] offset by 18.00 towards DashAngle[DashCV] degrees.)
I tested your trigger and it's cool. Thanks for giving me that strength too, bro. :thumbs_up:
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,867
I tested the trigger and it's great, I just have a question about the casting delay when the skill is triggered. How do I set this casting time so that the casting is instantaneous?
So to break it down, Casting Time is a field found on each Ability in the Object Editor. It acts like a delay before the unit even attempts to "Begin casting" an ability. This is not what we're concerned with, I just think it's important to know the terminology so we can ask better questions and understand how the game works internally.

What you're concerned with is the Art - Animation - Cast Point, which is customized on an individual Unit basis:
castpoint.png

As seen in the picture, the Archmage has a Cast Point of 0.3 seconds.

This means that it takes 0.3 seconds for the Archmage to execute any of his abilities. So if you pressed the Summon Water Elemental hotkey you would get a Water Elemental after 0.3 seconds as long as this sequence is not interrupted. This is why you're even able to interrupt your casts in the first place.

Alternatively, the Cast Backswing field is how long the Archmage will continue to "cast the spell" after it's effects have executed. In other words, after the Water Elemental is summoned the Archmage will stand there, essentially disabled, for another 2.4 seconds. Note that you can issue a new order to interrupt this entire backswing sequence. This backswing really only exists to make animations smoother, especially for CPUs, since the animations would otherwise cancel abruptly. This is where the concept of animation cancelling comes into play, if you've ever heard of it. If you haven't, you've undoubtedly been doing it all of this time.

The issue with this Cast Point mechanic is that it applies to ALL of the abilities your unit casts. Meaning if you reduce the Cast Point to 0.00 seconds it will make ALL of your abilities "instant". You have two solutions to this problem:

1) Use an ability like Berserk as the base for Dash. This ability is truly Instant, meaning it bypasses the entire Cast Point/Cast Backswing system. You should be able to use the Flare ability for the Point targeted version since it's Instant as well.

2) Use a system like this (shameless plug) to control the Cast Point for everything. But this may have some unwanted side effects, it's not very battle tested.
 
Last edited:

Luu

Luu

Level 6
Joined
Feb 11, 2021
Messages
45
So to break it down, Casting Time is a field found on each Ability in the Object Editor. It acts like a delay before the unit even attempts to "Begin casting" an ability. This is not what we're concerned with, I just think it's important to know the terminology so we can ask better questions and understand how the game works internally.

What you're concerned with is the Art - Animation - Cast Point, which is customized on an individual Unit basis:
View attachment 492572
As seen in the picture, the Archmage has a Cast Point of 0.3 seconds.

This means that it takes 0.3 seconds for the Archmage to execute any of his abilities. So if you pressed the Summon Water Elemental hotkey you would get a Water Elemental after 0.3 seconds as long as this sequence is not interrupted. This is why you're even able to interrupt your casts in the first place.

Alternatively, the Cast Backswing field is how long the Archmage will continue to "cast the spell" after it's effects have executed. In other words, after the Water Elemental is summoned the Archmage will stand there, essentially disabled, for another 2.4 seconds. Note that you can issue a new order to interrupt this entire backswing sequence. This backswing really only exists to make animations smoother, especially for CPUs, since the animations would otherwise cancel abruptly. This is where the concept of animation cancelling comes into play, if you've ever heard of it. If you haven't, you've undoubtedly been doing it all of this time.

The issue with this Cast Point mechanic is that it applies to ALL of the abilities your unit casts. Meaning if you reduce the Cast Point to 0.00 seconds it will make ALL of your abilities "instant". You have two solutions to this problem:

1) Use an ability like Berserk as the base for Dash. This ability is "Instant", meaning it bypasses the entire Cast Point/Cast Backswing system. You should be able to use the Flare ability for the Point targeted version since it's Instant as well.

2) Use a system like this (shameless plug) to control the Cast Point for everything. But this may have some unwanted side effects, it's not very battle tested.
I actually just set up the Cast Backswing and Cast Point to simulate something instantaneous and it worked. Anyway, I really appreciate your thoughts and suggestions. Thank you for always taking the time to help me. ❤️
 
Level 9
Joined
May 19, 2016
Messages
156
does the dash system respect pathing ? (dashing through objects or being blocked by it) (cliffs too)
 
Top