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

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