Would it be possible to make it so a unit takes less damage when attacked from the front and make it more vulnerable from attacks from behind? If so, how would I do this?
I just did a quick demonstration map on how to achieve this.
There is a behavior which procs on damage, running a switch which determines the angle of attack, applying a +1 or -1 armor buff as needed. Also included a trigger so you can see the effect in chat.
I just did a quick demonstration map on how to achieve this.
There is a behavior which procs on damage, running a switch which determines the angle of attack, applying a +1 or -1 armor buff as needed. Also included a trigger so you can see the effect in chat.
Your demo map doesn't work correctly. The marine always takes full damage when attacked from the southern half of the map, and always takes reduced damage when attacked from the northern half - regardless of which direction the marine is facing. The Location Arc validator does not take unit facing into account, unfortunately.
I've yet to come up with a data editor-only solution for flanking bonuses/penalties.
edit: Scratch that I finally got it working. It is, however, not robust (relies on certain assumptions I can make for my map but are not true in general) and it is ridiculously complicated. Seeing as a trigger solution can be implemented very easily I'd just go that route.
Would it be possible to make it so a unit takes less damage when attacked from the front and make it more vulnerable from attacks from behind? If so, how would I do this?
@devilesk: Go
I just did a quick demonstration map on how to achieve this.
There is a behavior which procs on damage, running a switch which determines the angle of attack, applying a +1 or -1 armor buff as needed. Also included a trigger so you can see the effect in chat.
@Elemeno: Go
Thanks alot, that's exactly what I wanted.
Your demo map doesn't work correctly. The marine always takes full damage when attacked from the southern half of the map, and always takes reduced damage when attacked from the northern half - regardless of which direction the marine is facing. The Location Arc validator does not take unit facing into account, unfortunately.
I've yet to come up with a data editor-only solution for flanking bonuses/penalties.
edit: Scratch that I finally got it working. It is, however, not robust (relies on certain assumptions I can make for my map but are not true in general) and it is ridiculously complicated. Seeing as a trigger solution can be implemented very easily I'd just go that route.