Page 1 of 1

Classed key bindings

Posted: 20 Sep 2006, 08:14
by trepan
Another key binding feature has been added to SVN.
The bindunittype keyword can be used to bind a
keyset to a class of units that you define. You can
also setup the order that will be used to cycle through
the list of unit types that meet your requirements. Here
is an example:

http://trepan.homelinux.net/spring-diffs/advkeys.txt

P.S. That example file is my working test config, so
you'll have to excuse me if it's a little sloppy / incomplete.
The other feature demonstrated at the end of the file is the
positional icon access (using iconpos)

Posted: 20 Sep 2006, 17:43
by LordMatt
Please forgive my ignorance, but does that mean we could assign a key combination to select particular kinds of units (e.g. ctrl + alt + r selects all rockos on screen)?

Posted: 20 Sep 2006, 19:39
by knorke
// setup the build categories
keysym build_energy b3
keysym build_mex b2
keysym build_builder b1
keysym build_factory b0
I think its like hotkeys for buildings? Like you select a builder, press M and can place a Mex. No need for scrolling through the list.

Posted: 20 Sep 2006, 19:48
by Argh
If nothing else, this oughtta be extremely useful to the AI folks. Cool :-)

Posted: 20 Sep 2006, 21:38
by trepan
Yup, that's a fairly good description. It doesn't just work for builders
making buildings though, the same bindings also apply to factories
making units (ex: selecting an advanced kbot factory and hitting the
stealth binding will send out a spy bot).

Also note that the same mex build binding will produce a Moho mex
for adv builders, and a normal mex for simpler builders.
I think its like hotkeys for buildings? Like you select a builder, press M and can place a Mex

Posted: 21 Sep 2006, 08:24
by KDR_11k
How are the units assigned to the keys, e.g. how does Spring know what is a powerplant?

Posted: 21 Sep 2006, 08:51
by FireCrack
KDR_11k wrote:How are the units assigned to the keys, e.g. how does Spring know what is a powerplant?
Things like this in the posted file

Code: Select all

bindbuildtype &build_energy {
  req    totalEnergyOut > 1.0
  sort   not needGeo
  sort   -minWaterDepth
  sort   techLevel
  sort   totalEnergyOut
}

Posted: 21 Sep 2006, 22:32
by knorke
Will you be able to "cycle" through the buildings?
Like Windmill, Tidal, Solar and Adv. Solar are bound to the same hotkey and by pressing "E" (for energy, example) you can switch..

Posted: 21 Sep 2006, 22:36
by trepan
You could already cycle through the building types, this
classing system just makes it easier to setup the bindings.

The "sort" property in bindbuildtype determines the order
of the cycling.