• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

How do I do this ability?

Status
Not open for further replies.
Level 6
Joined
Mar 28, 2018
Messages
128
This ability is from an item, from grim dawn and I want to put it in my map. the thing is that I do not know how to do it.

I want him to jump back 1000 and leave a fog in the place where he jumped, to stay there for 5 seconds and an ally if he is in that fog, to be able to receive a miss from the enemy for 5 seconds.

let the enemy be confused after I jumped. not to follow me and cancel his auto attack.
Range Backwards: 1000
Cooldown: 15
Mana cost: 0

I don't want it to have any level. it's an ability that I want all heroes to have at the beginning of the game.
 

Attachments

  • 1677799796010.png
    1677799796010.png
    86.7 KB · Views: 22

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,580
Edit 6 months later:
I accidentally used Dash_Index instead of Dash_Loop on this line:
  • -------- Move our caster to the next position: --------
  • Unit - Move Dash_Caster[Dash_Loop] instantly to Dash_Point[1]
Fix it!


I attached a map with a Dash spell that should do everything you want. It requires the latest patch to open.
  • Dash Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dash
    • Actions
      • -------- Create a new instance of Dash: --------
      • Set VariableSet Dash_Index = (Dash_Index + 1)
      • -------- --------
      • -------- Store data about Dash which we will reference in the For Loop: --------
      • Set VariableSet Dash_Caster[Dash_Index] = (Triggering unit)
      • Set VariableSet Dash_Angle[Dash_Index] = (Facing of Dash_Caster[Dash_Index] - 180.00)
      • Set VariableSet Dash_Distance[Dash_Index] = 0
      • -------- --------
      • -------- Dummy cloud ability: --------
      • Set VariableSet Dash_Point[0] = (Position of Dash_Caster[Dash_Index])
      • Unit - Create 1 Dummy for (Owner of Dash_Caster[Dash_Index]) at Dash_Point[0] facing Default building facing degrees
      • Set VariableSet Dash_Dummy = (Last created unit)
      • Unit - Add a 5.00 second Generic expiration timer to Dash_Dummy
      • Unit - Add Dash Cloud (Dummy - Cloud) to Dash_Dummy
      • Unit - Order Dash_Dummy to Human Dragonhawk Rider - Cloud Dash_Point[0]
      • Custom script: call RemoveLocation(udg_Dash_Point[0])
      • -------- --------
      • -------- Start the Dash timer if it's not on: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dash_Index Equal to 1
        • Then - Actions
          • Countdown Timer - Start Dash_Timer as a Repeating timer that will expire in 0.02 seconds
        • Else - Actions
  • Dash Loop
    • Events
      • Time - Dash_Timer expires
    • Conditions
    • Actions
      • For each (Integer Dash_Loop) from 1 to Dash_Index, do (Actions)
        • Loop - Actions
          • -------- Get the current and next position: --------
          • Set VariableSet Dash_Point[0] = (Position of Dash_Caster[Dash_Loop])
          • Set VariableSet Dash_Point[1] = (Dash_Point[0] offset by 25.00 towards Dash_Angle[Dash_Loop] degrees.)
          • -------- --------
          • -------- Move our caster to the next position: --------
          • Unit - Move Dash_Caster[Dash_Loop] instantly to Dash_Point[1]
          • -------- --------
          • -------- Add some optional special effects for fun. Mod (modulo) allows us to check if Distance is a multiple of 100 before creating the sfx: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dash_Distance[Dash_Loop] mod 100) Equal to 0
            • Then - Actions
              • Special Effect - Create a special effect at Dash_Point[0] using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • -------- --------
          • -------- Clean up your memory leaks ya bum! --------
          • Custom script: call RemoveLocation(udg_Dash_Point[0])
          • Custom script: call RemoveLocation(udg_Dash_Point[1])
          • -------- --------
          • -------- Calculate the total distance traveled in order to determine when the spell should end: --------
          • Set VariableSet Dash_Distance[Dash_Loop] = (Dash_Distance[Dash_Loop] + 25)
          • -------- --------
          • -------- Check if the spell should end: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Dash_Distance[Dash_Loop] Greater than or equal to 1000
            • Then - Actions
              • -------- We swap the last index with the current one and then set the loop back a cycle in order to keep things running smoothly for our other instances: --------
              • Set VariableSet Dash_Angle[Dash_Loop] = Dash_Angle[Dash_Index]
              • Set VariableSet Dash_Caster[Dash_Loop] = Dash_Caster[Dash_Index]
              • Set VariableSet Dash_Distance[Dash_Loop] = Dash_Distance[Dash_Index]
              • -------- --------
              • Set VariableSet Dash_Index = (Dash_Index - 1)
              • Set VariableSet Dash_Loop = (Dash_Loop - 1)
              • -------- --------
              • -------- Once Index hits 0 we know that there are no Dash instances left and can pause the timer in the meantime: --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dash_Index Equal to 0
                • Then - Actions
                  • Countdown Timer - Pause Dash_Timer
                • Else - Actions
            • Else - Actions
 

Attachments

  • Dash 1.w3m
    20.9 KB · Views: 5
Last edited:
Level 6
Joined
Mar 28, 2018
Messages
128
At grim dawn the ability makes you jump backwards. when you have a wall in the back you jump over it. I don't stop in it. Can it make it jump backwards? not to be pushed back.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,580
The Move Unit Instantly action takes into consideration collision and issues a Stop order to the unit. That's why it won't "jump" over things.

To get around that you will need to use the SetUnitX/SetUnitY Custom script instead.

These two functions ignore pathing and force a unit to be placed at the exact coordinates you give:
  • Custom script: call SetUnitX(udg_Dash_Caster[udg_Dash_Loop], GetLocationX(udg_Dash_Point[1])
  • Custom script: call SetUnitY(udg_Dash_Caster[udg_Dash_Loop], GetLocationY(udg_Dash_Point[1])
  • Unit - Order Dash_Caster to Stop
The problem here is that this will clip through literally everything including the map boundaries.

In order to get around this clipping issue you will need to add logic to the trigger that checks whether Dash_Point[1] is a valid place to move the caster or not. This can be done with an If Then Else statement and a Condition that tests the pathability and other settings about the environment located at Dash_Point[1]. If your Conditions are met then you can proceed to run the Custom script.

The Stop order is important to prevent the unit from acting during the Dash. Although, a better alternative would be to Stun the unit using this:
  • Custom script: call BlzPauseUnitEx(udg_Dash_Caster[udg_Dash_Index], true)
Call this at the end of the Dash Cast trigger.

Then you would need to undo this Stun effect when the spell ends.
The place to do this would be in the second If Then Else of the Dash Loop trigger near the end:
  • Then - Actions
    • Custom script: call BlzPauseUnitEx(udg_Dash_Caster[udg_Dash_Loop], false)
This should be the very first Action, before all of the variables get "de-indexed" or "swapped".

With these changes you should get closer to what you want.
 
Last edited:
Status
Not open for further replies.
Top