• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Formula for frontal attack detection

Status
Not open for further replies.
Level 7
Joined
Jun 14, 2009
Messages
235
I have a damage dectection system, and it works and stuff

but Whats would i use to detect "damage from infront of the unt"?

I know how to basically do it, just not the "check" for it.
 
  • Actions
    • Set p[1] = (Position of (Triggering unit))
    • Set p[2] = (Position of (Damage source))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Cos(((Facing of (Triggering unit)) - (Angle from p[1] to p[2])))) Greater than (Cos(110.00))
      • Then - Actions
        • Game - Display to (All players) the text: front
      • Else - Actions
        • Game - Display to (All players) the text: back
    • Custom script: call RemoveLocation (udg_p[1])
    • Custom script: call RemoveLocation (udg_p[2])
 
Status
Not open for further replies.
Top