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

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