- Joined
- Apr 5, 2013
- Messages
- 154
I'm using this trigger for a zombie map, where every 3.00 seconds the zombies attack a nearby player that is ALIVE. The problem here is that the zombies will still choose to attack units/locations where a dead player is if its closer than a live one. Help would be appreciated, every time I try to return to this map I just can't seem to work it out.
-
OrderZombieAttack
-
Events
-
Time - Every 3.00 seconds of game time
-
-
Conditions
-
Actions
-
Custom script: call RemoveLocation (udg_EP)
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(PlayerUnit[(Integer A)] is alive) Equal to True
-
-
Then - Actions
-
Custom script: call RemoveLocation (udg_EP_PLAYER[bj_forLoopAIndex])
-
Set EP_PLAYER[(Integer A)] = (Position of PlayerUnit[(Integer A)])
-
-
Else - Actions
-
-
-
-
Unit Group - Pick every unit in ALLZombies and do (Actions)
-
Loop - Actions
-
Set EP = (Position of (Picked unit))
-
-------- Player 1 --------
-
Set PLAYERNUMBER = 1
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[2])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[3])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[4])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[5])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[6])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[7])
-
-
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack PlayerUnit[PLAYERNUMBER]
-
-
Else - Actions
-
-
-------- Player 2 --------
-
Set PLAYERNUMBER = 2
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[1])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[3])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[4])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[5])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[6])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[7])
-
-
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack PlayerUnit[PLAYERNUMBER]
-
-
Else - Actions
-
-
-------- Player 3 --------
-
Set PLAYERNUMBER = 3
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[1])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[2])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[4])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[5])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[6])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[7])
-
-
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack PlayerUnit[PLAYERNUMBER]
-
-
Else - Actions
-
-
-------- Player 4 --------
-
Set PLAYERNUMBER = 4
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[1])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[2])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[3])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[5])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[6])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[7])
-
-
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack PlayerUnit[PLAYERNUMBER]
-
-
Else - Actions
-
-
-------- Player 5 --------
-
Set PLAYERNUMBER = 5
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[1])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[2])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[3])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[4])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[6])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[7])
-
-
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack PlayerUnit[PLAYERNUMBER]
-
-
Else - Actions
-
-
-------- Player 6 --------
-
Set PLAYERNUMBER = 6
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[1])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[2])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[3])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[4])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[6])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[7])
-
-
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack PlayerUnit[PLAYERNUMBER]
-
-
Else - Actions
-
-
-------- Player 7 --------
-
Set PLAYERNUMBER = 7
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[1])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[2])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[3])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[4])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[6])
-
(Distance between EP and EP_PLAYER[PLAYERNUMBER]) Less than (Distance between EP and EP_PLAYER[7])
-
-
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack PlayerUnit[PLAYERNUMBER]
-
-
Else - Actions
-
-
-------- Idiot Corner --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Idiot Corner <gen> contains (Picked unit)) Equal to True
-
-
Then - Actions
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units in Idiot Corner <gen>) and do (Actions)
-
Loop - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of REAL <gen>)
-
-
-
-
Else - Actions
-
-
-
-
-