Code:
For each (Integer CommanderOrders) from 1 to 12, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Commander[CommanderOrders] Equal to No unit
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
JoinedBandits[CommanderOrders] Equal to True
Then - Actions
Unit - Create 1 Guard Commander for Player 10 (Light Blue) at (Player 10 (Light Blue) start location) facing Default building facing degrees
Set Commander[CommanderOrders] = (Last created unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
JoinedSoldiers[CommanderOrders] Equal to True
Then - Actions
Unit - Create 1 Guard Commander for Player 7 (Green) at (Player 7 (Green) start location) facing Default building facing degrees
Set Commander[CommanderOrders] = (Last created unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TheUndead[CommanderOrders] Equal to True
Then - Actions
Unit - Create 1 Undead Commander for (Player(CommanderOrders)) at ((Player(CommanderOrders)) start location) facing Default building facing degrees
Set Commander[CommanderOrders] = (Last created unit)
Else - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Commander[CommanderOrders] is dead) Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
JoinedBandits[CommanderOrders] Equal to True
Then - Actions
Hero - Instantly revive Commander[CommanderOrders] at (Player 10 (Light Blue) start location), Hide revival graphics
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
JoinedSoldiers[CommanderOrders] Equal to True
Then - Actions
Hero - Instantly revive Commander[CommanderOrders] at (Player 7 (Green) start location), Hide revival graphics
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TheUndead[CommanderOrders] Equal to True
Then - Actions
Hero - Instantly revive Commander[CommanderOrders] at ((Player(CommanderOrders)) start location), Hide revival graphics
Else - Actions
Do nothing
Else - Actions
Do nothing
Unit - Order Commander[CommanderOrders] to Attack-Move To (Random point in (Playable map area))
Cinematic - Ping minimap for (All players) at (Position of Commander[CommanderOrders]) for 3.00 seconds
Game - Display to (All players) the text: (String((Unit-type of Commander[CommanderOrders])))
Wait 20.00 seconds
Trigger - Run (This trigger) (checking conditions)
I have no idea why but it stops ressurrecting the commanders randomly and the tests in there (Pinging and text of unit-type) focuses onto the center of the map and says nothing indicating to me that the units don't exist randomly, but do exist not allowing for others to be created.
The map is nothing but heros and a few buildings (depending), only player's heros revive, rest eventually get removed depending on the situation. Commanders are counted as a player's hero but for the computers.
4 commanders (2 undead 1 bandit 1 soldier) are created from the start, another is made for the opposite side depending on which a player joins (cannot join undead). But as I said, each eventually just dissappears....
Anyone have a clue?