HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Not working on Splash

07-11-2006, 08:52 PM#1
Hemlock
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:
Stunner Event
Collapse Events
Unit - A unit enters (Playable map area)
Conditions
Collapse Actions
Trigger - Add to Stunner <gen> the event (Unit - (Entering unit) Takes damage)

and
Trigger:
Stunner
Events
Collapse Conditions
(Unit-type of (Damage source)) Equal to stun tower
((Attacked unit) belongs to an enemy of (Owner of (Damage source))) Equal to True
Collapse Actions
Unit - Create 1 Stunner unit for Player 1 (Red) at (Position of (Attacked unit)) facing 270.00 degrees
Unit - Hide (Last created unit)
Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)

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
shadow1500
Cast storm bolt on each unit instead.
07-11-2006, 09:00 PM#3
Jacek
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
shadow1500
GetTriggerUnit() = the unit being damaged
GetEventDamageSource() = the damaging unit
GetEventDamage() = the damage
07-11-2006, 09:05 PM#5
Hemlock
Quote:
Originally Posted by Jacek
I see some kind of a problem, can you refer to Attacked unit in Unit Takes Damage event? Try using Triggering Unit instead...

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
Rising_Dusk
In a unit takes damage event setup, attacked unit is null.
07-12-2006, 09:31 AM#7
oNdizZ
Quote:
Originally Posted by Warnicro
thats possible, but then they will stunned before the actually get hit by the projectile.

About casting stormbolt, I will try that

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
Hemlock
Quote:
Originally Posted by oNdizZ
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.

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
oNdizZ
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
FatalError
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.