Passive knockback.

KooH

New Member
Reaction score
1
I made a Knockback passive skill. What it does is whenever the hero that has this skill is attacked, there is certain chance to knockback the attacking enemy unit. The problem is that when my hero is attacking, this skill doesn't activate, but when i move around while getting attacked by the ememy units, it activates.. I want to make it happen ALWAYS. please check my trigger, and fix please. thanks.

Trigger:
  • Stone Skin
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Stone Golem
      • ((Attacking unit) belongs to an enemy of (Owner of (Attacked unit))) Equal to True
    • Actions
      • Set StoneSkincaster = (Attacked unit)
      • Set StoneSkinPoint = (Position of (Attacked unit))
      • Set StoneSkinTimer = 1.60
      • Unit Group - Pick every unit in (Units within 150.00 of StoneSkinPoint matching ((((Matching unit) belongs to an enemy of (Owner of (Attacked unit))) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
          • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Stone Golem - Stone Skin for (Attacked unit)) Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than or equal to 50
            • Then - Actions
              • Trigger - Turn on Stone Skin Periodic <gen>
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Stone Golem - Stone Skin for (Attacked unit)) Equal to 2
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Less than or equal to 100
                • Then - Actions
                  • Trigger - Turn on Stone Skin Periodic <gen>
                • Else - Actions
            • Else - Actions


Trigger:
  • Stone Skin Periodic
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set StoneSkinTimer = (StoneSkinTimer - 0.04)
      • Unit Group - Pick every unit in (Units within 150.00 of StoneSkinPoint matching ((((Matching unit) belongs to an enemy of (Owner of StoneSkincaster)) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
        • Loop - Actions
          • Set StoneSkinTargetPoint = (Position of (Picked unit))
          • Set StoneSkinKnockbackPoint = (StoneSkinPoint offset by ((Distance between StoneSkinPoint and StoneSkinTargetPoint) + 5.00) towards (Angle from StoneSkinPoint to StoneSkinTargetPoint) degrees)
          • Unit - Move (Picked unit) instantly to StoneSkinKnockbackPoint
          • Custom script: call RemoveLocation(udg_StoneSkinTargetPoint)


Trigger:
  • Stone Skin Stop
    • Events
      • Game - StoneSkinTimer becomes Less than or equal to 0.00
    • Conditions
    • Actions
      • Trigger - Turn off Stone Skin Periodic <gen>


EDIT: I made those interger chances really large for now, so i can see if it works or not.
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
I believe the problem isn't actually the fact that it doesn't work when they're sitting there attacking. It's just the way the 'Unit is attacked' event functions.

When a unit is attacked, it DOESN'T mean he is actually hit, or takes damage, or anything. It just means that he starts to be under attack, if that makes any sense.

So what I'm guessing is, when your character is in melee, the enemy units have been issued the order to attack, and are comfortably hacking away.

When you run away, the enemy units have to move around to follow you, and their attack order is issued several times, which is what is causing the trigger to fire.

You would probably be better off using a different event. Perhaps a 'Unit takes damage' event, with conditions that ensure that the damage is not from a damage-over-time spell, or atleast ensuring that the attacker is nearby?

Hope that helps. I don't know if that's actually the problem as I have not tested it, but it's just a potential theory.
 

Wratox1

Member
Reaction score
22
use this
Trigger:
  • Game - GDD_Event becomes Equal to 0.00

when youve got the GDD in your map

and if you meant the unit takes damage event in gui, there is none
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top