Unit Facing

micolord

You can change this now in User CP.
Reaction score
0
Hey guys! I am trying to make a defense games, themed orc blademasters. Now one of my hero is a fire elemental orc.

First skill is:

Blazing Sword (Passive, 400 AoE infront of him gets damaged by 50 when he attacked)
> When he attack, all enemies that he is facing will take damage, but I don't know how to detect the enemies that is in front of him.

Please help me :( .
 

O.A

Quantum physics rules
Reaction score
29
You could do something like this;

Set TempGroup = (Units in (Region centered at ((Position of Your Hero) offset by 200.00 towards (Facing of Your Hero) degrees) with size (400.00, 400.00)) matching ((What you want) Equal to True))

Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Your actions (damage picked unit)

call DestroyGroup (udg_TempGroup)

That will pick all units in a 400 by 400 square in front of your hero, i've used it in the past to detect units in front of other units, and it works well.
 

O.A

Quantum physics rules
Reaction score
29
For some reason i can't edit my post now. I wanted to add that you might want to play around with the size of the region to see which works best for you.

PS. I'm sure you've thought of it already, but Cleaving Attack also uses a system to detect the targets in front of the Hero (a little on the sides too), but i can't recall if it only does damage in percentages. If you're not set on the 50 damage, using Cleaving Attack would be the easiest way to do this i think.
 

Solu9

You can change this now in User CP.
Reaction score
216
PS. I'm sure you've thought of it already, but Cleaving Attack also uses a system to detect the targets in front of the Hero (a little on the sides too), but i can't recall if it only does damage in percentages. If you're not set on the 50 damage, using Cleaving Attack would be the easiest way to do this i think.


The problem with Cleaving Attack is that it's a passive ability with a set amount of damage.
Also, the area of effect stat determines how big an area around the primary target which is affected.
 

O.A

Quantum physics rules
Reaction score
29
Passive is what OP wanted, and i'm pretty sure Cleaving Attack does exclude units that are behind the Hero, not 100% sure. Even if you have an AoE of 800 i.e it shouldn't deal damage to units that are behind the Hero, i think.
 

Solu9

You can change this now in User CP.
Reaction score
216
Blazing Sword (Passive, 400 AoE infront of him gets damaged by 50 when he attacked)
Missed that part. I'm a bit unsure if it should happen when the unit attacks or is attacked.

I just tested Cleaving Attack with a range of 1500. And indeed you are correct. It seems the AoE range only affects the half circle the unit is facing.

So if the OP wants a passive "when attacks" ability Cleaving Attack is indeed a variable solution.
 
General chit-chat
Help Users

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top