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

[Solved] Finding an AOE attack center location

Status
Not open for further replies.
Level 2
Joined
Jan 3, 2021
Messages
6
I'm trying to create a passive ability that works similar to Burning Oil. When an artillery unit with it attacks I want it to create an area that slows units which pass through it. To achieve that I thought that I should create a dummy unit upon missile impact and give that dummy a modified tornado slow aura. Now the problem I'm facing is that I don't know where to create that dummy, or more specifically: How do I find the center point of the artillery AOE, so I can spawn the dummy there. Since I don't want missile homing enabled for this and I want it to create the area even without any units being hit (just like burning oil), I can't just use the position of an attacked unit (or at least I can't think of a way to use it).

I'm using Damage Engine for some other things in the map. Maybe that can be used for a solution.

This is my first post, so if I forgot anything please tell me.
 
Level 2
Joined
Jan 3, 2021
Messages
6
why not just give the artillery unit a modified 'frost arrows'?

Unfortunately that wouldn't work, as that would not create an area in which all units in it are slowed. Imagine the following situation: the artillery unit fires and upon impact the units in the impact area are slowed. Now a unit, which was not hit by the attack, enters the area. It would not be slowed. However, that is exactly what I want and what makes the whole thing so difficult. I want this to work just like Burning Oil, but instead of dealing damage it want it to slow units.

I appreciate the idea though :)

Edit: since my account is new my answers need moderation and take time until they are posted.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
It's tough because you can't detect when an attack is launched.

You can detect when an attack starts (Event: A unit is attacked) and when damage is dealt (Damage Engine), but that doesn't really help much.

One method that might work is to make the unit's attack get replaced with an order to cast a hidden targeted ability. This would allow you to create the Dummy in response to the Event: A unit starts the effect of an ability, which would either be at the target point of ability being cast (in response to Attack Ground) or at the position of target unit of ability being cast (in response to a standard Attack).

Something like that could work but I'm not 100% sure.
 
Level 2
Joined
Jan 3, 2021
Messages
6
It's tough because you can't detect when an attack is launched.

You can detect when an attack starts (Event: A unit is attacked) and when damage is dealt (Damage Engine), but that doesn't really help much.

One method that might work is to make the unit's attack get replaced with an order to cast a hidden targeted ability. This would allow you to create the Dummy in response to the Event: A unit starts the effect of an ability, which would either be at the target point of ability being cast (in response to Attack Ground) or at the position of target unit of ability being cast (in response to a standard Attack).

Something like that could work but I'm not 100% sure.
This is a very interresting approach. Never would have thought of that. I think this could work (if I can manage to code it). The one problem I see though is, that for the spell which replaces the attack, the damage would have to be calculated the exact same way, the actual attack damage would be calculated, or I would have to get that information from the unit dynamically (if that is even possible). And I don't know how to do either. I'm also not sure how to replace the attack order. Will have to do some searching and see if I can come up with anything. I love to idea though. Thanks for that!
 
Status
Not open for further replies.
Top