Detecting if unit is hit - a bit more complicated

Reaction score
65
See, I have this map. In it, there are plenty of units that have an unique way to attack. They have the normal attack (that deals no real damage, however) and when they use it, they create a dummy unit in front of them. The dummy units slide towards their facing, and when they come near an unit or obsacle, they deal damage and die.
Now the question is, do you have any ideas on how to detect can the attacker hit the attacked unit or is there any obsactles inbetween?
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
I am just guessing, but if you want a arrow effect, like in 'Archery Tactics', then using modified Carrion Swarm would be a wiser solution.

But, if not. I think there is no way. You can only check, if the point is pathable.
 
Reaction score
65
I am just guessing, but if you want a arrow effect, like in 'Archery Tactics', then using modified Carrion Swarm would be a wiser solution.
Using carrion swarm wouldn't work. When it has gone to it's maxinum damage amount, the effect won't stop. In other words, it would look like it goes trough obsactles, units ect.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Well, you could place regions under the obstacles and if the the dummy caster enters it, kill it. :p Just a whacky and messy solution.
 
Reaction score
65
Maybe a periodic event?
Perioidic event for what? Remember that I have plenty of units using this trigger.
>Well, you could place regions under the obstacles and if the the dummy caster enters it, kill it. Just a whacky and messy solution.
That wouldn't solve my problem, I want to detect is there a clear route between the attacker and the attacked.
 

Rinpun

Ex TH Member
Reaction score
105
I wouldn't suggest that, because that completely ignores barricades.

Another thing you could try is giving the projectile dummy collision (and no flying movement; add and remove the fly trick ability that Medivh has and set its flying height that way) and use a timer and KaTTana's handle vars to determine if its last movement was closer to the target. If it was by even a fraction of a pixel, it hit something.

Of course, that only deals with X-Y obstacles. If you want height to play a factor, things get messy very fast. It's easy to make a bullet drop in height, but it's nigh impossible to try to filter them being above or below a rock they pass by. And flying movement prevents collision, so the X-Y obstacles won't work.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top