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

Basic AI

Status
Not open for further replies.
Level 6
Joined
Mar 6, 2010
Messages
116
I have this trigger to make creeps attack a random enemy unit in the map.However,it doesnt work.Can someone help please?
  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Unit - Order (Picked unit) to Attack (Random unit from (Units in (Playable map area) matching ((((Target unit of issued order) is alive) Equal to True) and ((Owner of (Target unit of issued order)) Not equal to Player 12 (Brown)))))
            • Else - Actions
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Target unit of issued order is an event response, means it refers to the event that fired the trigger. The function construct defining the unit that shall be attacked is executed separately. It does not look into the future to see that you want to use it in an order action. Target unit of issued order does not make any sense here. The unit checked for the group picking filter is referred to by Matching unit.
 
Status
Not open for further replies.
Top