| 07-11-2006, 08:52 PM | #1 |
I have made custom ability for a tower, which will stun every enemy unit in the splash that the tower has, that works. I do this with the following triggers Trigger: and Trigger: The problem is now off course that the stun appears on more than one place, cause the towers damages more than 1 unit, but its there something I can do to it stunning all units in the splash area? thanks in advance |
| 07-11-2006, 08:57 PM | #2 |
Cast storm bolt on each unit instead. |
| 07-11-2006, 09:00 PM | #3 |
I see some kind of a problem, can you refer to Attacked unit in Unit Takes Damage event? Try using Triggering Unit instead... |
| 07-11-2006, 09:01 PM | #4 |
GetTriggerUnit() = the unit being damaged GetEventDamageSource() = the damaging unit GetEventDamage() = the damage |
| 07-11-2006, 09:05 PM | #5 | |
Quote:
thats possible, but then they will stunned before the actually get hit by the projectile. About casting stormbolt, I will try that |
| 07-11-2006, 09:06 PM | #6 |
In a unit takes damage event setup, attacked unit is null. |
| 07-12-2006, 09:31 AM | #7 | |
Quote:
thats only when you are using the event: A Unit Is Attacked if you use UNIT Takes Damage, then it will be the same time as the projectile hits the unit. |
| 07-12-2006, 10:49 AM | #8 | |
Quote:
Thats what I used as you can see, but then I get the problem that the ability also works on the units that are hit by the splash damage. |
| 07-13-2006, 01:30 AM | #9 |
ok, some random brainstorming. How about.. create a group, add all units which has been damaged by your unit with a max interval of... something less than your units attack speed. like, if the group is null or empty or something, then start a timer with a.. 0.1 duration, and when it has expired stop taking in units that has been damaged by your unit into the group and then compare the Damaged Taken. This is all based on that your splash does less damage to the aoe than it does to the direct unit. it would also screw up if the other units damaged would have more armor etc etc. anyways, just brainstorming, there's probably an easier and more accurate way... |
| 07-13-2006, 02:03 AM | #10 |
What I would do (this is how my attack detection system works) is have a trigger with the A Unit Is Attacked event, then save the attacked unit and the attacking unit in a GameCache. Then, have another trigger ready to erase that GameCache entry in case the attacking unit (the tower) is given another order. Finally, have a Unit Is Damaged event on another trigger, then check to see if the GameCache entry exists, and if not, then the tower wasn't attacking that specific unit. If this seems really complicated then it's better not to try it, and think of a better way, because it takes a lot of work to make that kind of system (and usually it's done in JASS...and you're making this in the GUI). One thing I would try is to give the tower a frost attack that lasts 0.01 seconds, then on the Unit Is Damaged event, check if the damaged unit has that buff. If he does, stun him, if not the don't. |
