• 🏆 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!

Attack on sight

Status
Not open for further replies.
Level 13
Joined
Mar 23, 2008
Messages
1,214
If the guard is standing still all the game through you could first try to set the, uhm dont remember whats its called range XD (that range which decide when units attack) to 0. Then make a region in front og him, and make a trigger which will make him attack a unit if it enters that region. This might give trouble if theres more units entering tho, but its all i can come up with... :S
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
If the guard is standing still all the game through you could first try to set the, uhm dont remember whats its called range XD (that range which decide when units attack) to 0. Then make a region in front og him, and make a trigger which will make him attack a unit if it enters that region. This might give trouble if theres more units entering tho, but its all i can come up with... :S
Aquisition Range.
 
Set target acquisition range to 0 and do something like...

  • MyTrig
  • Events:
    • Unit - A unit comes within <range> or guard
  • Conditions:
    • And - Conditions:
      • Real comparison - angle between (Triggering Unit) and guard is greater than facing angle of guard - <angle>
      • Real comparison - angle between (Triggering Unit) and guard is less than facing angle of guard + <angle>
  • Actions:
    • Unit - Make guard attack (Triggering Unit)
Do some kind of condition about the unit being an enemy and stuff as well.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Set target acquisition range to 0 and do something like...

  • MyTrig
  • Events:
    • Unit - A unit comes within <range> or guard
  • Conditions:
    • And - Conditions:
      • Real comparison - angle between (Triggering Unit) and guard is greater than facing angle of guard - <angle>
      • Real comparison - angle between (Triggering Unit) and guard is less than facing angle of guard + <angle>
  • Actions:
    • Unit - Make guard attack (Triggering Unit)
Do some kind of condition about the unit being an enemy and stuff as well.
Indeed that is much better than a region this will make a circular sector for the LoS. I thought of that but I was lazy to post but anyway good thinking.
 
Status
Not open for further replies.
Top