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

Cancelling an attack order?

Status
Not open for further replies.
Level 12
Joined
Dec 2, 2016
Messages
733
I'm trying to make an anti TK system.

Is there a way to detect when a unit attacks a building. And detect if that attacker is on a team or player color etc?

The only event I found was unit issued order targeting an object. How do I detect if it's an attack order?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
  • Attack Order
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Target unit of issued order) is A structure) Equal to True
      • (Issued order) Equal to (Order(attack))
      • ((Owner of (Target unit of issued order)) is an ally of (Owner of (Triggering unit))) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to Stop
You can also order the unit to attack-move to the position of the targeted unit or follow the targeted unit for example.
 
Status
Not open for further replies.
Top