• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Making buildings and units only able to walk and attack towards 1 direction

Status
Not open for further replies.
Level 14
Joined
Jun 13, 2007
Messages
1,432
Title kinda says it all, how can I make buildings and units only attack towards one direction?
 
  • Trigger1
  • Events
    • Map Initialization (?)
  • Conditions
  • Actions
    • Set Real1 = (Facing of (Your unit))
  • Trigger2
  • Events
    • A unit is issued an order targeting an object
  • Conditions
    • ((Ordered unit) Equal to (your unit))
  • Actions
    • Set Point0 = (Position of (Ordered unit))
    • Set Point1 = (Position of (Target unit of issued order))
    • If/ Then/ Else
      • If (Conditions)
        • (Angle between Point0 and Point1) Not Equal to Real1
      • Then (Actions)
        • Unit - Order (Ordered unit) to Stop
      • Else (Actions)
    • Custom script: call RemoveLocation (udg_Poin0)
    • Custom script: call RemoveLocation (udg_Point1)
 
Status
Not open for further replies.
Top