Page 1 of 2

Release: Smart Select

Posted: 13 Nov 2010, 11:25
by aegis
Smart Select:
Selects units as you drag the selection rectangle over them and provides realtime selection filters.

http://www.youtube.com/v/5Bgu-3qwR0I

Supported modifier keys:
  • Ctrl: selection rectangle subtracts from existing selection
  • Shift: selection rectangle adds to existing selection
  • Alt: filter selection to only non-builder mobile combat units
  • Space: filter selection to only idle units
  • Z: filter selection to only already-selected unit types
Changelog:
1.0:
  • initial release
1.1:
  • minimap selection now supported
  • removed bug where you were able to select by click+dragging the mouse with a command active
1.11
  • fixed single click selection bug
1.12
  • fixed clicks blocked by other widgets causing units to be selected
1.13
  • no longer select buildings with weapons when alt is held
1.14
  • added lookup table to greatly improve performance when filtering combat units on large selections
1.2:
  • added Z meta key - when held, it filters new selections to only include currently selected unit types. it stacks with shift and alt.
  • when dragging a selection over both mobile units and buildings, just select the mobile units (not the buildings) unless shift is held
  • added options for both of the above additions a config section at the top of the widget file - selectBuildingsWithMobile and sameSelectKey
  • added selection box drawing on map when selecting through minimap
  • fixed minimap selection over sky
  • fixed flickering with some selection types and UnitShapes
1.21:
  • added support for dualscreen minimap
1.22:
  • added support for TraceScreenRay sky patch
1.3:
  • ctrl no longer subtracts from selection when you start with no units selected. this makes it possible to be holding ctrl to assign a unit group while you are dragging to select units
  • widget now works for spectators
1.35:
  • if filters reduced the selection to nothing, now select nothing instead of everything in the box.
  • added an idle unit filter, bound to the space key by default. this removes stationary non-builders and any other mobile or builder unit with orders queued from the potential selection.
1.36:
  • possibly fixed a bug very rarely causing single clicks to fail to select units
TODO:
  • I'm open to suggestions

Re: Release: Smart Select

Posted: 13 Nov 2010, 14:26
by luckywaldo7
Awesome widget is awesome <:

Re: Release: Smart Select

Posted: 13 Nov 2010, 16:38
by aegis
released 1.1 with minimap selection and a bug fixed.

Re: Release: Smart Select

Posted: 13 Nov 2010, 20:11
by very_bad_soldier
Adding/removing single units by left-clicking does not work when this is active.

Re: Release: Smart Select

Posted: 13 Nov 2010, 20:14
by aegis
I'll fix that now, seems I broke it in the last update

Re: Release: Smart Select

Posted: 13 Nov 2010, 20:28
by aegis
released 1.11 with TFC's bug fixed

next step is figuring out how to track offscreen selection position on camera angle change without using the terrain as reference point... because TraceScreenRay to terrain does nothing when there's no terrain there.

then I'll make selecting in minimap show a white selection box on terrain

Re: Release: Smart Select

Posted: 13 Nov 2010, 20:43
by Satirik
in photoshop alt = remove from selection and shift add to selection

Re: Release: Smart Select

Posted: 13 Nov 2010, 21:42
by aegis
I know, but in default spring alt does nothing and ctrl inverts selection iirc

Re: Release: Smart Select

Posted: 13 Nov 2010, 21:53
by aegis
bugfix release 1.13:
fixes units being selected when you click on other widgets
fixes buildings with weapons being selected when alt is held

Re: Release: Smart Select

Posted: 13 Nov 2010, 22:35
by Forboding Angel
Image

Re: Release: Smart Select

Posted: 14 Nov 2010, 01:02
by Niobium
You should merge the functionality of 'Z selector' into this widget (When Z is held, only units types that existed in original selection are selected), should be easy as its very similar to your combat filter. Good work btw

Re: Release: Smart Select

Posted: 14 Nov 2010, 01:27
by aegis
ah yeah that shouldn't take very much code... right now I'm working on a better way to calculate the original selection point (right now it depends on terrain, so doesn't work if you start your selection in the sky)

I'll see about Z after I get this done

Re: Release: Smart Select

Posted: 14 Nov 2010, 08:02
by aegis
1.2 released:
  • added Z meta key - when held, it filters new selections to only include currently selected unit types. this stacks with shift and alt.
  • when dragging a selection over both mobile units and buildings, only the mobile units are selected (not the buildings) unless shift is held
  • added options for both of the above additions a config section at the top of the widget file - selectBuildingsWithMobile and sameSelectKey
  • added selection box drawing on map when selecting through minimap
  • fixed minimap selection over sky
  • fixed flickering with some selection types and UnitShapes
1.21 fixes dualscreen minimap selection

Re: Release: Smart Select

Posted: 15 Nov 2010, 08:20
by aegis
1.22 released:
added support for this patch to allow TraceScreenRay in sky, which allows realtime selection when the selection rectangle originates in sky as well as ground

just needs dev approval and a new version of spring released before it's fixed ;)

anybody have any suggestions for sweet new features to add or functionality I should refine? I'm open to implementing anything awesome, even if it takes a bit of work.

I was thinking it'd be possible to extend this to area commands as well... I could start with area reclaim, and hook smart area reclaim into this
so dragging your area reclaim would highlight what it was you were going to reclaim, hotkeys could modify for metal/energy/both, and it could have similar behavior to current smart_area_reclaim widget except highlighting features in realtime like this selection engine
(I even know how to implement drawing a real area reclaim command in the middle of the queue now... so I can do smart_area_reclaim without command spam too)

Re: Release: Smart Select

Posted: 15 Nov 2010, 13:22
by UAF
Holding shift while clicking a selected unit does not deselect it from the group. This is normal RTS behavior.
I suspect this widget would do it with ctrl, but I still keep trying with shift because that's how it works in most games...

Re: Release: Smart Select

Posted: 15 Nov 2010, 16:25
by aegis
when you click a single unit, this widget doesn't do anything. this widget only kicks in when you drag your mouse. spring has always used control for that.

Re: Release: Smart Select

Posted: 15 Nov 2010, 16:29
by Satirik
aegis wrote:I know, but in default spring alt does nothing and ctrl inverts selection iirc
the default spring works like the selection in windows explorer ... you're making a photoshop like selection, you should use their keys

Re: Release: Smart Select

Posted: 15 Nov 2010, 16:30
by aegis
*sigh* I'll make it configurable at the top of the widget :P the current buttons (ctrl/shift) were closer to spring's defaults though (ctrl just deselects now instead of fully inverting selection... I made this change because there was no good way afaik to deselect a chunk out of a big section of mixed selected/deselected units)

Re: Release: Smart Select

Posted: 19 Nov 2010, 10:37
by klapmongool
Hmm, sounds nice. I'm having some problems getting it to work though (and im a lua noob/normal user). The functions described above don't work, yet when the widget is enabled the normal keys Do I have to add the keys i want to use in? In the user config section?

Re: Release: Smart Select

Posted: 19 Nov 2010, 12:36
by Gota
definitely add the reclaim thing you offered,sounds very convenient.