Custom Formations 2 - Page 5

Custom Formations 2

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

Moderator: Moderators

User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Custom Formations 2

Post by Niobium »

v2.2 released, fixes a very annoying bug with v2.1 when using a single unit.

Note that the single-unit path thing works with fight/attack/patrol/etc, handy to use if you have a single transport carrying a few units, as it also works with unload (So you have a line of evenly spaced unloads)
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: Custom Formations 2

Post by momfreeek »

I'd love the ability to spread different unit types evenly across the line.

so for instance: send 10 rocket bots and 10 thuds into a nice formation of rocket,thud,rocket,thud etc..

I guess this would need another meta key as it reintroduces crossed lines (but in a useful way if thats what you want).

Image

If it could make sure every unit type had a member as near to the middle as possible that'd be great (so if I have a bunch of units with a radar jammer the jammer isn't stuck on the end)
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Custom Formations 2

Post by manolo_ »

+1
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Custom Formations 2

Post by Niobium »

Um, a bit hard to do really.

Really you should just order them how you want, and theyll stay that way
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Custom Formations 2

Post by CarRepairer »

momfreeek wrote:I'd love the ability to spread different unit types evenly across the line.

so for instance: send 10 rocket bots and 10 thuds into a nice formation of rocket,thud,rocket,thud etc..

I guess this would need another meta key as it reintroduces crossed lines (but in a useful way if thats what you want).

Image

If it could make sure every unit type had a member as near to the middle as possible that'd be great (so if I have a bunch of units with a radar jammer the jammer isn't stuck on the end)
  • Click on one unit of type A.
  • Press your hotkey that selects all units of selected type within screen (mine is Z). (Same as double click but I hate double click.)
  • Drag a line.
  • Click on a unit of type B.
  • Z.
  • Drag a line.
It's a slightly slower process, but there can be countless scenarios where you want your custom formation to do what you want. It's simpler and more powerful to just have a several commands and hotkeys and combine them to do what you want.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Custom Formations 2

Post by Neddie »

Niobium wrote:Really you should just order them how you want, and theyll stay that way
Does that actually work now? Well, good.
User avatar
momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: Custom Formations 2

Post by momfreeek »

yeah, at least they'll stay in formation now (major improvment btw, much thanks). I was always having the crossover problem in nota where hundreds of kbots is the norm. Still, would be nice if I could get my aa bots spread evenly along hte line without fiddling.. with more diverse forces it can be a real pain to arrange them manually (not so much a problem in ba).
Niobium wrote:Um, a bit hard to do really.
it seems fairly simple if you just ignore the other optimisations (allow completely random crossovers). If you just want the force sorted the extra movement is not a big deal.
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Custom Formations 2

Post by Niobium »

Small update.

Single unit lines can now be inserted into a units queue by holding spacebar (meta). Which makes it good for getting around pathing issues.

Also fixed a small bug when inserting orders to single units (So you should update)
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Custom Formations 2

Post by Niobium »

Updated to v2.5:

v2.5
------
- Now works correctly with minimap
- Respects 'Issue commands on minimap' spring setting
- Smoother lines

Highly recommended to update due to minimap commands actually being usable again.
Gedanken
Posts: 121
Joined: 13 Oct 2008, 02:57

Re: Custom Formations 2

Post by Gedanken »

I am getting Spring hanging terminally when using latest version from Spring Downloader. When I give too many units commands or too many commands to some units I get a Spring hang. I tried with 0.80.4 and 0.80.4.1, but no luck. I am 90 percent sure it is this causing my hangs because it happens whenever I maneuver a large group of units. If it helps I can post what widgets I am using that it may conflict with, or post logs or whatever, but infolog.txt just stops with no crash information at all. D: This really sucks
Gedanken
Posts: 121
Joined: 13 Oct 2008, 02:57

Re: Custom Formations 2

Post by Gedanken »

The thing that made me definitely question this widget was when I gave one unit a zillion move commands right around the map
(maybe 20-30 commands? I don't know) before hang. I can post the replay of this if you like but I am not sure it would have saved the crash
Gedanken
Posts: 121
Joined: 13 Oct 2008, 02:57

Re: Custom Formations 2

Post by Gedanken »

Update: no hangs (yet) since dropping back to BA default
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Custom Formations 2

Post by Niobium »

Gedanken was correct, v2.5 contains bug which can cause perma freezes.

v2.6 uploaded, fixed perma freezes.
User avatar
Karotte
Posts: 72
Joined: 03 Aug 2009, 17:30

Re: Custom Formations 2

Post by Karotte »

1. a bug o your widget: it crash with over 100-200 Units
2. would it b a opinion to mad it for attacking to? so that the heavy plasma towers can a attach a area in a line (would be usefull i think)
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Custom Formations 2

Post by Niobium »

Karotte wrote:1. a bug o your widget: it crash with over 100-200 Units
2. would it b a opinion to mad it for attacking to? so that the heavy plasma towers can a attach a area in a line (would be usefull i think)
1. I test with 500+ units frequently so I don't know about that, any more details? Does it crash or freeze? Are you sure it's CF2?
2. Hold alt, then drag an attack command
Gedanken
Posts: 121
Joined: 13 Oct 2008, 02:57

Re: Custom Formations 2

Post by Gedanken »

Karotte wrote:1. a bug o your widget: it crash with over 100-200 Units
2. would it b a opinion to mad it for attacking to? so that the heavy plasma towers can a attach a area in a line (would be usefull i think)
What version are you using? This was a bug with old widget
User avatar
Karotte
Posts: 72
Joined: 03 Aug 2009, 17:30

Re: Custom Formations 2

Post by Karotte »

whenn i try it with many units then it wont be disapear (the line) and when i klick a second time will go the line to this point too.
But it is dont crashing and freezing
User avatar
NTG
Posts: 23
Joined: 15 Nov 2008, 12:49

Re: Custom Formations 2

Post by NTG »

any chance for alt + command issue (move/fight/patrol) for group of units to work as for single unit? i'd find it pretty useful for managing small groups of raiders/scouts... guard on single unit is not an option in some cases :/

[EDIT]
i've made part of it but can't find a line that makes the first points (units go in line before following path)... changes in lines 363-368:

Code: Select all

		altGroup = (alt and ((button == 3) or ((button == 1) and ((activeid == CMD_PATROL) or 
											(activeid == CMD_FIGHT) or 
											(activeid == CMD_MOVE))))
											)
		
		if spGetSelUnitCount() == 1 or altGroup then
			
			-- Start ordering unit immediately
			-- Need keyState
			local keyState = {}
			if(not altGroup) then --fix - group won't start path in line
				if alt   then tinsert(keyState, "alt") end
			end
[EDIT]
this should work now... what do you think about that?

PS: it's my first thing in Lua ever (started some reading about it today) so it may need some fixes/improvements ;)
Attachments
unit_customformations2.lua
modified widget
(31.76 KiB) Downloaded 33 times
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Custom Formations 2

Post by Niobium »

New version:

v2.7
------
- Multiple units can be ordered to follow a line by holding ALT while drawing the line


Works with all orders except attack/unload, but you'd be silly to want that.
User avatar
NTG
Posts: 23
Joined: 15 Nov 2008, 12:49

Re: Custom Formations 2

Post by NTG »

nice one and shorter than mine... i guess i forgot about de Morgan's laws :roll:

thanks

[EDIT]
Niobium wrote:Works with all orders except attack/unload, but you'd be silly to want that.
actually i've tried with attack order (deleted that part preventing it) and works nice as well - unit was attacking all points in sequence... few long range cannons/some arty + repeat on and it's awesome xD

[EDIT]
result is about the same to previous behaviour but works much worse with short range units and during bombing heavy AA defence - it is almost impossible this way... too bad :(
Post Reply

Return to “Lua Scripts”