Wanted: Go To Nearest Transport!
Posted: 31 May 2007, 04:36
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.
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.