Starcraft – How to efficiently tell workers to return minerals before going to build something in Starcraft 2

starcraft-2

(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?

My question:

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:

  1. 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
  2. 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
  3. 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):

  1. Go to camera location for production buildings
  2. Select worker by pressing the control group (as we will not have vision of the mineral line on maps with large main bases)
  3. Execute command(s) [XXX] (i.e., a placeholder)
  4. Give command to build structure

Best Answer

The "Return Cargo" command is what you're looking for here, (default C). This command when issued will tell the worker to return the resources they are carrying.

The way you would use this command is to first tell the worker to go to some place, in your situation it would be the place you want to construct something. You would then hit "Return Cargo", if the worker is not carrying resources then you can not issue this command, as the command will change to "Harvest Resources", if they are carrying resources they will return them to the base.

So after sending the "Return Cargo" command you would hold shift [1] and then queue the building that you'd like to build.

[1] Note: There's a chance that depending on the timing the worker will go mine resources first, that is why myself and many people I've seen do not queue this command, but rather spam C while sending the move command (this is due to the worker queueing up mining first and then go do your queued command) until they can see that none are carrying resources (from the lack of the "Return Cargo" command).

So to answer your question, the sequence would be:

  1. Camera Key for building location
  2. Control group with worker
  3. Click to move
  4. C "Return Cargo"
  5. Building keys

If you wanted to handle the third situation efficiently too, you would shift click to somewhere near the resources/base, then C then click to move to building location.