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

[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