• 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.

Knockback triggers.

Status
Not open for further replies.

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
I made a custom passive ability that gives a chance of knocking a melee attacker back when the hero is attacked. I'm sure this isn't the ideal way to do such a thing, and there probably are leaks. I'm also pretty sure it's MUI the way I made it, but, in case it's not...

Can I be pointed towards a way that'd be better for doing this, or how to fix whatever's broken? (GUI only please, and nothing too complicated!)

Help will be greatly appreciated.


  • Resonation Switch
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Resonation for (Triggering unit)) Greater than 0
      • ((Attacking unit) is A melee attacker) Equal to True
      • (Random integer number between 1 and 100) Less than or equal to ((5 x (Level of Resonation for (Triggering unit))) + 5)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUIResonate Greater than 100
        • Then - Actions
          • Set MUIResonate = 1
        • Else - Actions
          • Set MUIResonate = (MUIResonate + 1)
      • Unit Group - Add (Attacking unit) to ResonateGroup
      • Set ResonateCaster[MUIResonate] = (Attacked unit)
      • Set ResonateTarget[MUIResonate] = (Attacking unit)
      • Set ResonateCasterPos[MUIResonate] = (Position of (Triggering unit))
      • Set ResonateTargetPos[MUIResonate] = (Position of (Attacking unit))
      • Set ResonateAngle[MUIResonate] = (Angle from ResonateCasterPos[MUIResonate] to ResonateTargetPos[MUIResonate])
      • Set ResonateFinalPos[MUIResonate] = (ResonateTargetPos[MUIResonate] offset by 500.00 towards ResonateAngle[MUIResonate] degrees)
      • Unit - Create 1 DUMMYEFFECT (Resonation 01) for Player 1 (Red) at ResonateCasterPos[MUIResonate] facing Default building facing degrees
      • Animation - Change (Last created unit)'s animation speed to 300.00% of its original speed
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
First trigger sets most variables.

  • Resonation Ticker
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 100.00 of ResonateFinalPos[MUIResonate] matching (((Matching unit) is in ResonateGroup) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit Group - Remove (Picked unit) from ResonateGroup
          • Custom script: call RemoveLocation(udg_ResonateTargetPos[udg_MUIResonate])
          • Custom script: call RemoveLocation(udg_ResonateCasterPos[udg_MUIResonate])
          • Custom script: call RemoveLocation(udg_ResonateFinalPos[udg_MUIResonate])
      • Unit Group - Pick every unit in ResonateGroup and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (ResonateTargetPos[MUIResonate] offset by (40.00 + (40.00 x ResonateMultiplier[MUIResonate])) towards ResonateAngle[MUIResonate] degrees)
          • Set ResonateMultiplier[MUIResonate] = (ResonateMultiplier[MUIResonate] + 1.00)
Second trigger does the actual knocking back.

Ideas? It *seems* to work ingame, but i'm not sure if this'll lag along the way, or get messy somehow.

>>> And another thing - is there a way of preventing units from being knocked over terrain? Like, being moved up and over cliffs or something.

Thanks in advance.
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
http://www.hiveworkshop.com/forums/.../?prev=search=check%20walkability&d=list&r=20
Use this to check for pathing.

Oh, and you might want to use a DDS instead of using "Unit - A unit Is attacked" since it can be abused.
I didn't know this: "((Attacking unit) is A melee attacker) Equal to True" existed.

Just did a quick view and didn't check the trigger entirely but those are the ones that snatched my attention.
 
  • Like
Reactions: yip
Level 11
Joined
Nov 15, 2007
Messages
800
Oh, and you might want to use a DDS instead of using "Unit - A unit Is attacked" since it can be abused.

If he wants the ability to trigger before the attack lands, that's the easiest way to do it. It can't really be "abused" in this case because the ability is on the defender, not the attacker. Sure, the attacker can spam stop to make the ability trigger, but... why would he want to?
 
  • Like
Reactions: yip

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
you can check out my spell counter bash. It does exactly this.

I'll check it out later, but I kinda wanted to make my own. Thanks!

http://www.hiveworkshop.com/forums/.../?prev=search=check%20walkability&d=list&r=20
Use this to check for pathing.

Oh, and you might want to use a DDS instead of using "Unit - A unit Is attacked" since it can be abused.
I didn't know this: "((Attacking unit) is A melee attacker) Equal to True" existed.

Just did a quick view and didn't check the trigger entirely but those are the ones that snatched my attention.

I'll definitely check that 'Check Walkability' thing out, thanks a bunch. Then I'll proceed to play Czech checkers.

As for not using damage detection, my retort is exactly this:

If he wants the ability to trigger before the attack lands, that's the easiest way to do it. It can't really be "abused" in this case because the ability is on the defender, not the attacker. Sure, the attacker can spam stop to make the ability trigger, but... why would he want to?


Read my mind.

PS: Your avatar is groovy N!X, I like it.
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
If he wants the ability to trigger before the attack lands, that's the easiest way to do it. It can't really be "abused" in this case because the ability is on the defender, not the attacker. Sure, the attacker can spam stop to make the ability trigger, but... why would he want to?

Good point, didn't really think about that.
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
btw you should create an unit array for the dummy too.
If two players cast the spell with a very short time difference the first dummy which is called the last created unit will be replaced with the second player's dummy unit and there should be an unnecessary bug.

Wouldn't it have to be practically at the same milisecond tho? since there's "no" time delay between those actions.

Well, noted. I'll do that, just in case. Ty!
 
Status
Not open for further replies.
Top