Automatically replaces and distributes guard commands across units that share a group.
In practice, this comes in three parts:
- When a guarded unit dies, if it was in a group, any units that were guarding it are reassigned to guard another unit from that group.
- When a factory creates a unit, if the factory has a guard order to a unit in a group, the newly created unit is assigned to guard a unit from that group instead of only the original target.
- When a user guard order is issued targeting a grouped unit, the units given that order are assigned to guard units from that group instead of just the original target.
Some use cases for this widget are:
- Keeping mobile radar and jammer units around your group of artillery. With this widget, the radar/jammer units' guard commands will be spread out among the artillery units, and if any artillery units die, your guard orders won't dissappear - they'll just get reassigned.
- Distributing repair bots to important units. For example, if you want each of your titans or flagships to be guarded by rez bots/subs, set the factory waypoint on your t1 lab to one of the titans, and as units are created, their guard orders will be distributed among any units in that group of important units.
Many aspects of the widget can (and should) be configured through the settings page.
Notes:
- Since this manipulates commands, it might conflict with some other widgets that use the guard command.
- The widget does not keep track of what group a unit is assigned to guard - all state is derived from the actual command queues of the units. This means, among other things, that if every valid unit in a group dies, your guard order will be gone as well.
- Only guard commands for your own units are considered, since any other units cannot be in your groups.
https://gist.github.com/salinecitrine/0869c55905c2582163f2dd55522481cf (right click + "Save Link as..." on "Raw")