(Note: this question is motivated by openers that involve a decent amount of multitasking and in which we can be mineral starved, e.g., controlling reapers/hellions in 3CC-based TvZ builds, which have sensitive building timings.)
Also, my question is far more specific than this one with a very similar title: What's the most efficient way to select workers to build things in Starcraft 2?
Let's say I have a worker (on a far mineral patch) who I'd like to use to build the next key structure in my opener. Let's also say that (for efficiency purposes) I've added this worker to its own control group.
Is there a sequence of commands - which do NOT involve looking at the worker itself - that would make the worker first return minerals (if it happens to be holding any) and then proceed to build the designated building?
The key aspects of the command sequence (if it exists) are as follows:
- If the worker is NOT holding minerals when the command(s) are issued, (i.e., its traveling from the CC to its mineral patch), then the worker should immediately proceed to the designated building location, i.e., it should not proceed to the designated location after picking up minerals
- If the worker is holding minerals (i.e., its traveling from the mineral patch to the CC), then it should first return the minerals before proceeding to the designated building location, i.e., it should not proceed to the designated location with minerals in hand
- If the worker is in process of mining, then I'd be (relatively) indifferent as to what happens, as my priority is satisifying conditions (1) and (2).
Why am I asking this?
If such a method exists, then it would be possible to quickly and efficiently issue the following commands (where [XXX] represents a placeholder for the unknown command sequence):
- Go to camera location for production buildings
- Select worker by pressing the control group (as we will not have vision of the mineral line on maps with large main bases)
- Execute command(s) [XXX] (i.e., a placeholder)
- Give command to build structure