HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detect an attack

11-03-2007, 04:29 AM#1
Odin845
Hello I am trying to figure out how to detect an attack in GUI. I know there is the a unit is attacked event but that doesn't work because it is when the animation starts so you can move in the middle and not attack but still get the effect.

There is also a unit takes damage, but it doesn't work because the damage is not just an attack it is also spells and stuff.

So does anyone know how to detect an attack in GUI?
11-03-2007, 05:29 AM#2
Zandose
You need to use an attack detect system
http://www.wc3campaigns.net/showthread.php?t=78753
11-03-2007, 05:34 AM#3
Odin845
That isn't GUI, i am trying to do it in GUI
11-03-2007, 06:23 AM#4
Zandose
Sorry about that. I should have read that better.

My guess would be (based on the JASS system) and I have no idea if this is right...

Object Editor: Give a unit the an orb ability with no effects and only lasts like 0.01 seconds.

First trigger: At the start of the game create a 0.01 second repeating timer.
Second trigger: Every time the timer goes off check all units for the orbs buff. If they have the buff then they've been attacked a hit.

At this time I cannot think of a easy method for getting the attacker, damage done, or anything else. Also I think there are problems associated with using orbs. It's best to use the JASS system.
11-03-2007, 07:03 AM#5
Pyrogasm
Because you're using GUI, what you'll want to look at is emjlr3's On Attack Template.
11-13-2007, 07:47 AM#6
Odin845
So the only way is with one of those crazy systems?
11-13-2007, 10:32 AM#7
cohadar
I have one that is even crazier....
11-16-2007, 02:19 AM#8
Odin845
Dang, so it not possible, have to just use, a unit is attacked?
11-16-2007, 12:42 PM#9
Deaod
nope, as the trigger will still fire even if the unit aborts the attack.
11-16-2007, 01:01 PM#10
BestZero
so add 1 trigger that checks unit is taken damage from attacking unit or not.