pretty simple, i want to make a trigger that makes supply depots grant X amount of a resource at the end of a repeating timer, Ive got all the timer triggering figured out, my problem is i cant figure out how to make an event/condition that activates the trigger based on how many supply depots the player owns. Ive found how to do it for the ownership of a specific depot, but not a trigger for an amount of depots owned.
Pick each player in (active players) and do
-Pick each unit in units of type Supply Depot owned by Picked Player and do
- -Add X to Picked Player's minerals
This means it will add X resources once for every supply depot you own.
Edit: the above works as well. Instead of adding X resources repeatedly, just multiply X by the number of supply depots using the function Number of Units in Unit Group.
Instead of just adding X resources, go to the Function tab and use Arithmetic.
Change the operator to * and the first term to X, the second term to another function called Number of Units in Unit Group.
For the unit group, look under Function again and find Units In Region Matching Condition.
Change unit type to Supply Depot and Player to whichever player is getting paid.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
pretty simple, i want to make a trigger that makes supply depots grant X amount of a resource at the end of a repeating timer, Ive got all the timer triggering figured out, my problem is i cant figure out how to make an event/condition that activates the trigger based on how many supply depots the player owns. Ive found how to do it for the ownership of a specific depot, but not a trigger for an amount of depots owned.
Event - Timer Expires
Function - Arithmetic
Function - Number of Units in Unit Group
Periodic Event - every n game seconds
Pick each player in (active players) and do
-Pick each unit in units of type Supply Depot owned by Picked Player and do
- -Add X to Picked Player's minerals
This means it will add X resources once for every supply depot you own.
Edit: the above works as well. Instead of adding X resources repeatedly, just multiply X by the number of supply depots using the function Number of Units in Unit Group.
Still doesn't seem to work, some one is going to have to explain this in more detail, and with dumbed-down words ;)
Instead of just adding X resources, go to the Function tab and use Arithmetic.
Change the operator to * and the first term to X, the second term to another function called Number of Units in Unit Group.
For the unit group, look under Function again and find Units In Region Matching Condition.
Change unit type to Supply Depot and Player to whichever player is getting paid.