• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Detecting When a Unit is attacked from the sides or Rear

Status
Not open for further replies.
Level 22
Joined
Jun 23, 2007
Messages
3,242
I'm making a map where Dwarves go against The Green Tide (Orks, Gobbies, n Trows) in a winter landscape
naturally, both sides have tanks, since there seem to be a good deal of dwarven/goblin vehicles.
I plan on making the vehicles significantly stronger than infantry, and to balance this out, i figured attacking from the sides or the rear of the target tank should deal more damage.
I got this inspiration from Company of Heroes, where hitting the rear of a tank can destroy the engine, slowing it down, and deals critical damage.

So basically yah, i need a way to detect if a unit is attacked from the sides or rear and then add abunch of random actions, like engine destroyed or such.
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
Re-read it then :D

Ok, what you do, is checking the facing of a unit, that would be the direction it 'looks'.
If that facing is the same as the attacked unit, it must be attacked directly from the back, which is REALLY hard to do. Thus, you add a +5/-1 till it, so if you attack a unit from the back, or 5 from, then it returns 'Hit from back'- which would be where you put your actions.
 
Status
Not open for further replies.
Top