View topic - Release: Smart Select



All times are UTC + 1 hour


Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Release: Smart Select
PostPosted: 13 Nov 2010, 11:25 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
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


Attachments:
unit_smart_select.lua [11.3 KiB]
Downloaded 124 times
Top
 Offline Profile  
 
PostPosted: 13 Nov 2010, 14:26 

Joined: 17 Sep 2008, 03:36
Location: your imagination
Awesome widget is awesome <:


Top
 Offline Profile  
 
PostPosted: 13 Nov 2010, 16:38 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
released 1.1 with minimap selection and a bug fixed.


Top
 Offline Profile  
 
PostPosted: 13 Nov 2010, 20:11 
Lua Coder
User avatar

Joined: 20 Feb 2007, 01:10
Adding/removing single units by left-clicking does not work when this is active.


Top
 Offline Profile  
 
PostPosted: 13 Nov 2010, 20:14 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
I'll fix that now, seems I broke it in the last update


Top
 Offline Profile  
 
PostPosted: 13 Nov 2010, 20:28 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
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


Top
 Offline Profile  
 
PostPosted: 13 Nov 2010, 20:43 
Lobby Developer

Joined: 16 Mar 2007, 18:27
in photoshop alt = remove from selection and shift add to selection


Top
 Offline Profile  
 
PostPosted: 13 Nov 2010, 21:42 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
I know, but in default spring alt does nothing and ctrl inverts selection iirc


Top
 Offline Profile  
 
PostPosted: 13 Nov 2010, 21:53 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
bugfix release 1.13:
fixes units being selected when you click on other widgets
fixes buildings with weapons being selected when alt is held


Top
 Offline Profile  
 
PostPosted: 13 Nov 2010, 22:35 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
Image


Top
 Offline Profile  
 
PostPosted: 14 Nov 2010, 01:02 
User avatar

Joined: 07 Dec 2008, 02:35
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


Top
 Offline Profile  
 
PostPosted: 14 Nov 2010, 01:27 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
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


Top
 Offline Profile  
 
PostPosted: 14 Nov 2010, 08:02 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
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


Top
 Offline Profile  
 
PostPosted: 15 Nov 2010, 08:20 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
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)


Top
 Offline Profile  
 
PostPosted: 15 Nov 2010, 13:22 

Joined: 02 Jan 2008, 19:25
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...


Top
 Offline Profile  
 
PostPosted: 15 Nov 2010, 16:25 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
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.


Top
 Offline Profile  
 
PostPosted: 15 Nov 2010, 16:29 
Lobby Developer

Joined: 16 Mar 2007, 18:27
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


Top
 Offline Profile  
 
PostPosted: 15 Nov 2010, 16:30 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
*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)


Top
 Offline Profile  
 
PostPosted: 19 Nov 2010, 10:37 

Joined: 13 Aug 2007, 12:19
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?


Top
 Offline Profile  
 
PostPosted: 19 Nov 2010, 12:36 
Supreme Annihilation Maintainer
User avatar

Joined: 11 Jan 2008, 16:55
definitely add the reclaim thing you offered,sounds very convenient.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.