After defining the multi-indexed timer [for up to 2 buildings that provide income every so often under the control of the same player in a game with up to 4 different players (hence the multi-indexing)] in a multi-trigger situation (one activates the other, for ex. when a timer is started and defined, another trigger that checks for its expiration is needed) I can't have multi-indexed timer variable in the activated trigger's event (it can't have more than 1 index and it can't be from a variable) which is needed for my vision of the income generator to work. It works with 1 building per player, but going more than that is impossible as it seems...or is it? here's the code of the main trigger:
-
Incomev2
-
Events
-
Unit - A unit Finishes construction
-
-
Conditions
-
(Unit-type of (Constructed structure)) Equal to Farm
-
-
Actions
-
Set Income_Player_Number = (Player number of (Owner of (Constructed structure)))
-
Set Income_Farm_Count[Income_Player_Number] = (Income_Farm_Count[Income_Player_Number] + 1)
-
-------- Number of farms of player x are now = farms of player x + 1 --------
-
Set Farm_Position[Income_Farm_Count[Income_Player_Number]] = (Position of (Constructed structure))
-
-------- Variable is now position of the most recently built farm by player x (for ex. Farm_Position[1[1]] points to the position of the first farm player 1 built; Farm_Position[2[1]] to the position of the second farm player 1 built) --------
-
Countdown Timer - Start Income_Timer[Income_Farm_Count[Income_Player_Number]] as a Repeating timer that will expire in 5.00 seconds
-
-------- A timer is started that will be unique to each farm constructed, for ex. If a player 1 builds his first farm, the name of this variable timer is Income_timer[1[1]] --------
-
Set Income_Timer[Income_Farm_Count[Income_Player_Number]] = (Last started timer)
-
Player - Limit training of Farm to 2 for (Owner of (Constructed structure))
-
Trigger - Turn on incomev2P1 <gen>
-
Trigger - Turn on incomev2P2 <gen>
-
Trigger - Turn on incomev2P3 <gen>
-
Trigger - Turn on incomev2P4 <gen>
-
-
-
Time - Income_Timer[1] expires
-
Time - Income_Timer[1[1]] expires