• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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

Not open for further replies.
Level 14
Jun 13, 2007
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)
Not open for further replies.