Is it possible to get number of workers that gather specified unit with resource?
There is a number of harvesters u can see when selecting mineral or geyser during game, i just need to get this number.
There's likely an easier data related way but what I would do is assign each mineral field an integer ID. I would do this by having a trigger run whenever a mineral field enters region [entire map]. I would give it and assign it the next available consecutive integer.
I would store that ID as a custom value in the minerals. I would also set up a unit variable array with the mineral field stored as that value in the array. Every time a unit mines from that mineral field, it would raise a worker count associated with the ID of the mineral field by 1. After the time it takes for the worker to return it would be lowered by 1. Retrieve the count by returning the integer variable associated with the ID.
Is it possible to get number of workers that gather specified unit with resource?
There is a number of harvesters u can see when selecting mineral or geyser during game, i just need to get this number.
You can do it technical by testing for behaviors, abilities and/or orders.
Orders: you can scan workers near command centers or what not and see if they are doing gather orders, or return cargo orders.
Abilities: fire off a trigger when gather or return is used
Behaviors: same as abilities but has resource behavior which triggers on the return trip. you would need to have something for the going and mining.
@Dzuke911: Go
There's likely an easier data related way but what I would do is assign each mineral field an integer ID. I would do this by having a trigger run whenever a mineral field enters region [entire map]. I would give it and assign it the next available consecutive integer.
I would store that ID as a custom value in the minerals. I would also set up a unit variable array with the mineral field stored as that value in the array. Every time a unit mines from that mineral field, it would raise a worker count associated with the ID of the mineral field by 1. After the time it takes for the worker to return it would be lowered by 1. Retrieve the count by returning the integer variable associated with the ID.