Wanted: Go To Nearest Transport!

Wanted: Go To Nearest Transport!

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

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Wanted: Go To Nearest Transport!

Post by Argh »

Yup, another meta-behavioral request. Might be easier to code than Retreat!, so I'm offering it up, in the hopes that somebody gets around to it.

Basically, when GoToNearestTransport is invoked, a circular selection area is presented to the user (like all other area-specific stuff, just using a unique color). Then the following occurs:

1. All Units under the area are selected, then sorted out. All that CannotBeTransported, and all Buildings, are removed from the results.

2. The script then searches the player's inventory, looking for all Units with a TransportCapacity > 0.

3. All Units that are <= TransportSize of the nearest Transport are sent to it, using a standard Load command passed through the script.

4. Extra mega-points if the script can even determine how many Units can fit into a given Transport, and starts sending the Units to the next nearest if the Units heading towards the nearest >= the transportMass value of the Transport, and so on and so forth.
User avatar
gamer17
Posts: 235
Joined: 21 Feb 2007, 23:51

Post by gamer17 »

This would be cool
Post Reply

Return to “Lua Scripts”