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

[Solved] Attack Neutral Unit on Right Click

Status
Not open for further replies.
Level 4
Joined
Aug 16, 2013
Messages
75
Not sure why this simple trigger doesn't work. When the worker unit right clicks on the unit called stone, the worker unit should just be ordered to attack the stone unit but instead I get kicked out of the game.

  • Clicked On
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Ordered unit)) Equal to Worker
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of issued order)) Equal to Stone
        • Then - Actions
          • Unit - Order (Ordered unit) to Attack (Target unit of issued order)
        • Else - Actions
 
Level 4
Joined
Aug 16, 2013
Messages
75
I don't know how this works but it does. Thanks for the help anyway. :)

  • Clicked On
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Ordered unit)) Equal to Worker
          • (Unit-type of (Target unit of issued order)) Equal to Stone
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Ordered unit) to Attack (Target unit of issued order)
      • Trigger - Turn on (This trigger)
 
Although this one is already solved, you could do the same without disabling and enabling the trigger by checking if the order being issued is not equal to attack. If the condition stated beforehand is true, then you issue that order, which will fire the trigger again, only that the condition will become false, thus preventing a loop.
 
Status
Not open for further replies.
Top