You can bind the command
select to a key, in order to define custom selection commands. After select, you can specify a selector, that defines which units will be selected.
This selector consists of three parts:
- SOURCE: Which units to choose from.
- FILTER: Narrow down the list of units.
- CONCLUSION: What to do exactly with the units that were chosen and filtered.
These three parts are all succeeded by a literal plus sign (
+), so there is one
+ between SOURCE and FILTER, one between FILTER and CONCLUSION, and one after CONCLUSION. Do not use a space (
AllMap+_Builder+_SelectAll+ is a valid selector, where:
AllMapis the SOURCE
_Builderis the FILTER and
_SelectAllis the CONCLUSION.
Note that there is an underscore (
_) between each element, even if there is already a plus sign (
+), for hysterical raisins…
The SOURCE describes the set of units that you want to filter and pick a selection from. For players, these are restricted your team. It can be one of
AllMap: All active units on the entire map.
Visible: All active units that are currently visible.
PrevSelection: All units present in previous selection; that is, the one active before you hit the selection key.
FromMouse_<float>: All units that are at most a distance of
<float>away from the mouse cursor.
FromMouseC_<float>: Same as above, but using a vertical cylinder instead of a sphere. This is good for selecting airplanes or ships on deep water.
The FILTER is an arbitrarily long list of filters.
Here are the filters. Note that “units” generally means both buildings and mobile units. Typing both got old real quick.
Every filter can be preceded by
Not to negate it. You have to use a
_ to separate the
Not from the filter, as in
Keep only units that have an absolute health greater than
AbsoluteHealth_100: Keep only units that have more than 100 health points left.
Not_AbsoluteHealth_100: Keep only units that have less than 101 health points left.
Keep only units that can fly.
Keep only units and buildings that can construct. This means Factories, Construction Turrets, Constructors, but not Rezzers.
Keep only units that can build other units or buildings.
Keep only buildings, not mobile units.
Keep only units of category
Keep only units that can cloak.
Keep only units that are currently cloaked.
Keep only units that currently have a Guard order.
Keep only units whose internal name (unitDef name) matches
IdMatches_armcom: keep only Armada Commanders (internally named
Keep only units that are currently idle, i.e. do not have any active order.
Keep only units that are in control group
Not_InGroup_<int>: keep all units that are not currently in control group
Keep only units that are in any control group.
Not_InHotkeyGroup: keep all units that are not currently in any control group.
Keep only units of the same type (unitDefID) as any unit in the selection before this
select command was run.
Keep only units that have a jammer radius greater than 0.
Keep only units that have a weapon that requires manual firing (currently only the commanders and Armada Thor).
Keep only units whose name contains the
Keep only units that have a radar or sonar radius greater than 0.
Keep only units that can resurrect other units.
Keep only units that have health greater than
Not_RelativeHealth_10: Keep only units that have less than 10% health.
Keep only units where the
<string> rules parameter has the exact value
Keep only units that are stealthy.
Keep only units that can transport other units.
Keep only units that currently have a Wait order.
Keep only units that have a maximum weapon range greater than
Keep only units that have any weapons.
The CONCLUSION specifies what to do with the units that are left from the source after running through all the filters.
If the CONCLUSION starts with
_ClearSelection, your new selection will replace the old one; otherwise, it will just add to it. It must be followed by exactly one of:
SelectAll: all units
SelectOne: one unit, will also center the camera on that unit. This command remembers which unit was selected, on repeating the selection command, the next unit will be selected, so you can cycle through all matching units.
SelectClosestToCursor: one unit, the one closest to the mouse cursor.
<integer>units. Repeating this command adds
<float>percent of the units.
Recall that between every two tokens, there must be an underscore
_, even if there is also a
+. Another way to put it is that before every word in your selector except the SOURCE, there must be an underscore.
Some examples. Again, “unit” also includes buildings.
Selects everything on the entire map.
Selects any (one) idle builder (unit or building) on entire map. Repeatedly running this command will cycle through all idle builders.
Selects all units with radar/sonar/jammer.
Selects all non-aircraft armed units
Selects all units of any type that was in your previous selection.
Note that up to now, all keys said
ClearSelection, hence they replaced your old selection.
Selects all units of any type that was in your previous selection, unless they are already in a hotkey group.
From your previous selection, leaves everything that is below 30% health, and not a building. (Use this to quickly retreat damaged units.)