- Joined
- Apr 23, 2009
- Messages
- 94
I have this, and it doesn't work. At a loss for what to do.
Basically what i'm trying to do is have "Imp" automatically attack "Rock (Selected)" and attack the closest one. I just got back into map making and this is my first hurdle, so to speak.
-
Untitled Trigger 003
-

Events
-


Time - Every 3.00 seconds of game time
-
-

Conditions
-

Actions
-


Unit Group - Pick every unit in (Units owned by Player 2 (Blue) matching (((Unit-type of (Matching unit)) Equal to Imp) and ((Current order of (Matching unit)) Not equal to (Order(attack))))) and do (Actions)
-



Loop - Actions
-




Set Imp = (Picked unit)
-




Set PointVariable = (Position of (Picked unit))
-




Unit Group - Pick every unit in (Units of type Rock (Selected)) and do (Actions)
-





Loop - Actions
-






Set UnitArray[900] = (Picked unit)
-
-
-




For each (Integer A) from 0 to 900, do (Actions)
-





Loop - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Distance between (Position of UnitArray[(Integer A)]) and PointVariable) Less than TempDist
-
-







Then - Actions
-








Set TempDist = (Distance between (Position of UnitArray[(Integer A)]) and PointVariable)
-








Set TempUnit = UnitArray[(Integer A)]
-
-







Else - Actions
-
-
-
-




Unit - Order Imp to Attack TempUnit
-
-
-
-
Basically what i'm trying to do is have "Imp" automatically attack "Rock (Selected)" and attack the closest one. I just got back into map making and this is my first hurdle, so to speak.








