Page 1 of 1

QuickTransport: new lua widget?

Posted: 19 Nov 2007, 04:01
by RogerN
This is my first attempt at a lua widget, so it might be buggy. Use at your own risk :) Also, note that this widget is not compatible with the CustomFormations widget due to conflicting overrides.

http://www.unknown-files.net/spring/378 ... Transport/

The purpose of this widget is to reduce micromanagement for airlifting units. You need an airlift, and you need it now!

This lua widget overrides the ALT + move command (personally I never used it anyway). Nearby air transports will be given orders to move the selected units to the target destination. The air transports will attempt to unload the units relative to their original formation. After unloading, the air transports will return to their original position.

Basically, this widget saves you hassle of selecting air transports, giving the load order, and giving the unload order. It's all done with one click.

Posted: 21 Nov 2007, 22:01
by OverQuantum
Very good script, thank you.

But, IMHO, there is some problem with line 155

Code: Select all

if (not (UD.isBuilding or UD.isFactory)) and UD.springCategories["notair"] and UD.springCategories["notship"] then
Script not work on my Spring, until I remove this check:

Code: Select all

UD.springCategories["notship"]
I use Spring 0.75b2, XTA 8.1, but many widgets.
Downloaded file I place into \TASpring\LuaUI\Widgets\

ADD:
Same problem with TransportAssister, with same solution.
CustomFormations are not used.

Posted: 21 Nov 2007, 23:44
by RogerN
Script not work on my Spring, until I remove this check:
I admit that I don't have much lua experience. Could this be a purely mod-related issue? I never tested it with XTA, but I know that line of code works fine in BA. I am also running 0.75b2.

Posted: 22 Nov 2007, 08:04
by KDR_11k
I think it's your fault for assuming a category, not the mod's for not using the same categories you do. UnitDef.moveData.type == "ground" would be more effective but I think it'd be better if you made sure you watch the modrules on transportability, game.transportWhatever (which can allow non-ground units to be loaded).

Posted: 22 Nov 2007, 09:05
by Forboding Angel
Umm incompatability with custom formations is bad bad bad.

Posted: 22 Nov 2007, 15:34
by LordMatt
Forboding Angel wrote:Umm incompatability with custom formations is bad bad bad.
+1

Re: QuickTransport: new lua widget?

Posted: 13 Jan 2008, 23:39
by Kixxe
Could you add compabilty for chaning the allowed transports? Would be great to use it for other mods and ground transports...

Re: QuickTransport: new lua widget?

Posted: 15 Jan 2008, 09:51
by Licho
Note that CA contains widget which does similar thing and more:
http://www.caspring.org/wiki/FeatureTransportAi