- Joined
- Dec 3, 2005
- Messages
- 501
Is there a way to check if the unit is getting attacked from the side or back? I'm trying to develop a system and I need to be able to tell if a unit is getting attacked from pretty much anywhere besides face to face. A kind of flanking system.
This is kinda what I came up with:
So is there any other way of detecting it? Because this way isn't very effective.
This is kinda what I came up with:
-
Events
-
Unit - A unit Is attacked
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Facing of (Attacking unit)) Greater than or equal to ((Facing of (Attacked unit)) + 270.00)
-
(Facing of (Attacking unit)) Equal to (Facing of (Attacked unit))
-
Then - Actions
-
Unit - Kill (Attacked unit)
-
Unit - Create 1 Peasant for Player 2 (Blue) at (Center of (Playable map area)) facing Default building facing (270.0) degrees
-
Else - Actions
So is there any other way of detecting it? Because this way isn't very effective.