• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[General] Detect point of cannon tower attacks

Level 3
Joined
Apr 12, 2025
Messages
20
Hey guys,

Direct question:
Can I detect the location of a splash attack from a cannon tower?

More detail:
I'm working on an ability that procs thunder clap and if I fire the trigger based off units about to take damage, it will fire on everything within the splash damage instead of only once. I could use unit "is attacked" to find the point but I have a lot of testing to get the delay of the proc right then. Also then, I think it'll be susceptible to the stop spam bug. Hoping someone knows a trick that I dont.

Thank you for your time!!
 
I believe Bribe's Damage Engine can detect this reliably, so maybe look into that.

That being said, I attached a map with a quick and dirty way of detecting the splash attack's Damage source, Damage target, Damage target location, and all units that were damaged.

The core issue with my design is the use of Waits, which are imprecise and need to synced among all players. This can cause problems with the way it tracks the (Attacked unit) and (Damage target) over time, among other things.

Basically, it works well for the default Cannon Tower but once you start modifying the unit's Attack Speed, Attack Cooldown, Missile Speed, Damage Point, etc. you'll have to adjust the Waits to better sync things and prevent miscalculations. If your map is relatively static, like the Cannon Tower's stats remain constant, then this current setup should work consistently. But using Timers would be much better since they're precise, they're just a nightmare to use in GUI effectively. Some timer systems exist to ease this process but I didn't want to bloat the map even further, it already requires a Unit Indexer.
 

Attachments

Last edited:
I believe Bribe's Damage Engine can detect this reliably, so maybe look into that.

That being said, I attached a map with a quick and dirty way of detecting the splash attack's Damage source, Damage target, Damage target location, and all units that were damaged.

The core issue with my design is the use of Waits, which are imprecise and need to synced among all players. This can cause problems with the way it tracks the (Attacked unit) and (Damage target) over time, among other things.

Basically, it works well for the default Cannon Tower but once you start modifying the unit's Attack Speed, Attack Cooldown, Missile Speed, Damage Point, etc. you'll have to adjust the Waits to better sync things and prevent miscalculations. If your map is relatively static, like the Cannon Tower's stats remain constant, then this current setup should work consistently. But using Timers would be much better since they're precise, they're just a nightmare to use in GUI effectively. Some timer systems exist to ease this process but I didn't want to bloat the map even further, it already requires a Unit Indexer.


I'll DL and take a look at this, thank you. In the meantime, I've recorded the point of attack through 'is attacked', and adjusted the cast time of the thunder clap ability to get it close-ish to when the round impacts. I've tried messing with the stop command and it seems difficult to get it to bug out, but we will see. Just about every time I've tested the map, someone finds a way around something, lol.
 
I'll DL and take a look at this, thank you. In the meantime, I've recorded the point of attack through 'is attacked', and adjusted the cast time of the thunder clap ability to get it close-ish to when the round impacts. I've tried messing with the stop command and it seems difficult to get it to bug out, but we will see. Just about every time I've tested the map, someone finds a way around something, lol.
No problem, and yeah, the "is attacked" Event isn't really reliable for this type of effect. I used it for tracking the "primary target" in my map but it's setup in a way where it can't be abused to great extents. Worst case it will find the wrong "primary target", but it'll still be a unit that the Cannon is trying to attack. I also triggered the damage effects of Thunder Clap so you don't have to actually rely on an ability.

I suppose if your Cannon Tower has a hidden Thunder Clap ability, and you're fine with it being unable to retarget/do anything else until it casts the ability, then you can make your method work. You might even be able to dynamically modify the Casting Time of Thunder Clap based on the Distance the Cannon is from it's target, that way you can sync things better. IE: +0.01 Casting Time for each 1 Distance away from the target. Of course if the target is moving during this time it will cause some inconsistencies but that's probably okay. Although, maybe I'm completely misunderstanding your design.
 
Last edited:
Could Orb of Lightning ability with the ability set to Thunder Clap perhaps be an option?
That would cast Thunder Clap on the Tower and not the target, although it could technically still work. Maybe have it cast something that summons a unit on the target (if there's such a thing) -> detect said summoned unit in a trigger -> store it's position/remove it from the game -> trigger thunder clap at the position. I think the Meat Wagon's Disease Cloud ability has been used for this purpose before.
 
Oh true or even any other single target ability that works with orb of lightning, I know entangle works for example. Or, well even purge works so just anything where the effects can be set to 0 and the thunder clap triggered at the location of the target.
 
No problem, and yeah, the "is attacked" Event isn't really reliable for this type of effect. I used it for tracking the "primary target" in my map but it's setup in a way where it can't be abused to great extents. Worst case it will find the wrong "primary target", but it'll still be a unit that the Cannon is trying to attack. I also triggered the damage effects of Thunder Clap so you don't have to actually rely on an ability.

I suppose if your Cannon Tower has a hidden Thunder Clap ability, and you're fine with it being unable to retarget/do anything else until it casts the ability, then you can make your method work. You might even be able to dynamically modify the Casting Time of Thunder Clap based on the Distance the Cannon is from it's target, that way you can sync things better. IE: +0.01 Casting Time for each 1 Distance away from the target. Of course if the target is moving during this time it will cause some inconsistencies but that's probably okay. Although, maybe I'm completely misunderstanding your design.

Im using a dummy to cast it so the cast time doesn't interfere with it attacking the target. The tower itself doesn't use the real ability, it just has an icon to show it has it, then in the is attacked trigger it rolls a number 0-100 and if it's in the threshold for the tower level it spawns the dummy at the point to cast it.

I'm kind of surprised that of all the data options in the GUI there's nothing simple/obvious to catch the coordinates of attacks, or of the unit being attacked. Any artillery or non homing splash missile must use that specific data I would imagine.

I haven't had a chance to work on the map since I made this thread. Capturing the distance between the tower and point is interesting to ponder.
 
Back
Top