• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Is it possible to make a side-step ability?

Status
Not open for further replies.
Level 5
Joined
Jun 15, 2016
Messages
111
I wanted to make some sort of skill that allows you to evade an incoming attack by using it.
Please, don't suggest Phase Shift as it is almost impossible to evade melee attacks using that one. I wanted to make it so that this ability can only evade physical attacks, not magic attacks.
 
Level 4
Joined
Sep 13, 2014
Messages
106
Just make the attacking unit attack a dummy unit on attack after the ability is used if it is melee. They might be able to cancel the attack or something and then attack normally, but oh well.
 
Level 5
Joined
Jun 15, 2016
Messages
111
Just make the attacking unit attack a dummy unit on attack after the ability is used if it is melee. They might be able to cancel the attack or something and then attack normally, but oh well.
Hide the original unit, make a dummy unit with exactly the same image and then give it the ability 100% evasion, then remove the dummy and unhide the original unit???
 
Level 4
Joined
Jul 2, 2014
Messages
46
You gotta trigger everything (physical and magical attacks, and process on those; if your unit under a certain state; a boolean variable, unit indexer would be recommended for a MUI-thingy, array variable for MPI-thingy) and not do any damages.
 
Level 4
Joined
Sep 13, 2014
Messages
106
Well, the only problem with my solution is that it doesn't work if the attack is currently incoming. But you said that you did not want to use phase shift because you did not want to have to rely on reactions, as it is "almost impossible to evade melee attacks". And it makes sense that you have to forsee the incoming attack to dodge it. Although I don't know. It is difficult to redirect attacks that are already occuring, and it is difficult to prevent damage without making the unit invulnerable and disrupting attack flow.

You could also use a modified howl of terror ability with melee range that reduces damage by 1000%, or you could give the unit 100% evasion, or something.

Edit: I take that back, there are a lot of problems with my solution.
 

Attachments

  • DodgeTest.w3x
    17.9 KB · Views: 46
Last edited:
Use a dds and an ability that gives the user a buff (like beserk).
This example uses Bribe's Damage Engine

Then make a trigger that look somewhat like this.

  • Sidestep
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget has buff "Sidestep") Equal to True
      • IsDamageSpell Equal to False
    • Actions
      • Set DamageModifierEvent = 0.00
      • Unit - Remove "Sidestep" buff from DamageEventTarget
 
Level 12
Joined
May 22, 2015
Messages
1,051
Just use Physical DDS instead. Make the attacker causes no damage to the caster. Then use floating text to show the text "miss" above the unit so it will look like a real evasion. Though, it will avoid both melee and range attacks.
This is what I suggest, but it won't dodge orb effects or other on-hit effects (like bash, critical hit [the number would appear], etc). It would be hard to plug into a map that is not already using a DDS for everything, unless the map is fairly new (with little to port into the DDS).

It's definitely the most robust solution, though.

Adding evasion temporarily is the simplest solution like Flux mentioned.
 
Level 12
Joined
May 22, 2015
Messages
1,051
I assume that on-hit effects dont occur when evaded using evasion...
Other than that, coding the entire basic attacks instead of using the buggy WC3 ones requires 2 minutes time to make this ability.
This assumes there's no other abilities that you have to port over, doesn't it? This include basically any normal abilities created that require WC3 attacks (as opposed to fully coded ones).
 
Level 15
Joined
Sep 29, 2008
Messages
362
UHm, there are some tricks. Main trick is able to detect and prevent the exact moment when a hit is dealed.
a) - As reply reads above, adding Evasion 100% for a bit moment works fine. use unit issue target order event. (unit is attacked in gui) to detect it. It's not 100% efficient because delayed dmg can variate between units attack.
b) - Detecting and restoring exact amount of damage dealed as life. It works fine and is 100% efficient. Use "unit takes damage" as trigger and getEventDamage to set the amount to be restored. Remember to add the trigger to the exact unit once.
Example code

1st trigger
JASS:
    function RestoreDmgLifeCond takes nothing returns boolean
      return true //change for any condition required
   endfunction


   function RestoreDmgLife takes nothing returns nothing
      local unit u = GetTriggerUnit()
      local real dmg = GetEventDamage()
      local real life = GetUnitState(u,UNIT_STATE_LIFE)

        set life = life+dmg
     
        call SetUnitState(u,UNIT_STATE_LIFE,life)

        set u = null
   endfunction
  
  
  function InitPreventDamageTRG takes nothing returns nothing

    set gg_trg_PreventDamageTRG = CreateTrigger( )

     call TriggerAddCondition(gg_trg_PreventDamageTRG, Condition( function RestoreDmgLifeCond ))
     call TriggerAddAction(gg_trg_PreventDamageTRG, function RestoreDmgLife)
  endfunction

to activate the trigger you need another trigger for attacked unit detection and an unitgroup variable as tag to add attacked units preventing multiple actions for same event.
global unitgroup variable can be named AttackedUnits, make sure you have initializated the variable on your variable initializer function (in GUI you can initialize them just declaring it into variable tab)

  • set udg_AttackedUnits = CreateGroup( )
then make detecting trigger


  • DamageTriggerAdD
    • Events
      • Unit - A unit is Attacked
    • Conditions
      • Group - Is Unit in group (AttackedUnits) equals to false
      • Actions
        • Trigger - Add to PreventDamageTRG <gen> the event ((Triggering unit) Takes damage)
        • Group - Add (triggering unit) to group (AttackedUnits)
(I copied this gui trigger from thehelper as reference)

and test it.

I wrote the code without world edit spelling detection so there could be some syntax errors
 
Status
Not open for further replies.
Top