New widget : split in groups

New widget : split in groups

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
Masure
Posts: 581
Joined: 30 Jan 2007, 15:23

New widget : split in groups

Post by Masure »

Hi,

I did this simple widget to manage a particular situation :

You have 20 T2 bombers. You have scouted and found an ennemy base without tons of aa. Ok let's go with the bombers. You select them and define your attack point. Then, as an experienced player, you know that 5 bombers will easily get this fusion so you have to make small groups of bombers to kill more buildings in single pass. Selecting small groups of bombers while flying to destination is something difficult. You can select ground units or select a bomber that already has a target defined.

Here is the widget :

- Select units
- Press Alt + 0-9 key
- It will split your selected units in groups of X units from the selection. X is the key number you pressed. e.g. : If you have 30 bombers and you want groups of five, press Alt + 5. You'll have 6 groups made.
- Then it will be easy to give each group a target in a short time

Download here

Issues :

- Didn't find how to clear the existing group before setting units in. If anyone knows the Lua call, it would be appreciated.

Thanks :

I don't know Lua enough so I took Licho's auto group widget to make this one.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: New widget : split in groups

Post by jK »

erm ever tried the SelectionEditor?
Masure
Posts: 581
Joined: 30 Jan 2007, 15:23

Re: New widget : split in groups

Post by Masure »

It can split a selection in groups ?
Masure
Posts: 581
Joined: 30 Jan 2007, 15:23

Re: New widget : split in groups

Post by Masure »

File updated. There were a ClearGroup I used for testing that makes the widget crash.

Download again if you want to try
Post Reply

Return to “Lua Scripts”