QuickTransport: new lua widget?

QuickTransport: new lua widget?

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

Moderator: Moderators

Post Reply
User avatar
RogerN
Posts: 238
Joined: 24 Jul 2006, 23:29

QuickTransport: new lua widget?

Post 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.
User avatar
OverQuantum
Posts: 1
Joined: 21 Nov 2007, 21:50

Post 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.
User avatar
RogerN
Posts: 238
Joined: 24 Jul 2006, 23:29

Post 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.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post 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).
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

Umm incompatability with custom formations is bad bad bad.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Forboding Angel wrote:Umm incompatability with custom formations is bad bad bad.
+1
Kixxe
Posts: 1547
Joined: 14 May 2005, 10:02

Re: QuickTransport: new lua widget?

Post by Kixxe »

Could you add compabilty for chaning the allowed transports? Would be great to use it for other mods and ground transports...
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: QuickTransport: new lua widget?

Post by Licho »

Note that CA contains widget which does similar thing and more:
http://www.caspring.org/wiki/FeatureTransportAi
Post Reply

Return to “Lua Scripts”