Hi guys,
I am still working on my map, where players can buy strong units at the cost of an additional upkeep paid in gold.
I am using an integer variable to count the total "Mercenary_Upkeep".
The upkeep is calculated by the following action:
Player Group - Pick every player in (All players) and do (Player - Add (0 - Total_Upkeep_Mercs[(Player number of (Picked player))]) to (Picked player).Current gold).
This works as I count positited numbers but have to substract it from the regular income recieved, thats why its 0 - "Mercenary_Upkeep".
For now I have a total of 5 potential mercenary units to be recruited. The problem starts here. I want to add all 5 units to the total "Mercenary_Upkeep", each with a different amount of upkeep. I figured out how to do this with 2 mercenary units as you can read below:
All Mercenary Upkeep set
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Player Group - Pick every player in (All players) and do (Set VariableSet Total_Upkeep_Mercs[(Player number of (Picked player))] = (((Number of living Golden Centaur Horde 1 units owned by (Picked player)) x 120) + ((Number of living Golden Centaur Horde 2 units owned by (Picked player)) x 190)))
Like this, each unit will calculate a different amount of upkeep, still added to the same variable. But how do I do this with more than 2 units? The arithmetic fucntion only allows you to do this with 2 of them in one action.
Please help me out
))
I am still working on my map, where players can buy strong units at the cost of an additional upkeep paid in gold.
I am using an integer variable to count the total "Mercenary_Upkeep".
The upkeep is calculated by the following action:
Player Group - Pick every player in (All players) and do (Player - Add (0 - Total_Upkeep_Mercs[(Player number of (Picked player))]) to (Picked player).Current gold).
This works as I count positited numbers but have to substract it from the regular income recieved, thats why its 0 - "Mercenary_Upkeep".
For now I have a total of 5 potential mercenary units to be recruited. The problem starts here. I want to add all 5 units to the total "Mercenary_Upkeep", each with a different amount of upkeep. I figured out how to do this with 2 mercenary units as you can read below:
All Mercenary Upkeep set
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Player Group - Pick every player in (All players) and do (Set VariableSet Total_Upkeep_Mercs[(Player number of (Picked player))] = (((Number of living Golden Centaur Horde 1 units owned by (Picked player)) x 120) + ((Number of living Golden Centaur Horde 2 units owned by (Picked player)) x 190)))
Like this, each unit will calculate a different amount of upkeep, still added to the same variable. But how do I do this with more than 2 units? The arithmetic fucntion only allows you to do this with 2 of them in one action.
Please help me out