Module fleet
Functions for adding fleets of pilots.
Functions
add ([count=1], ship, faction, location, pilotname, parameters) | Wrapper for pilot.add() that can operate on tables of ships. |
Functions
- add ([count=1], ship, faction, location, pilotname, parameters)
-
Wrapper for pilot.add() that can operate on tables of ships.
The first pilot is set to be the fleet leader.
TODO: With a little work we can support a table of parameters tables, but no one even wants that. (Yet?)
Parameters:
- count Number of times to repeat the pattern. (default 1)
- ship Ship(s) to add.
- faction Faction(s) to give the pilot.
- location Location(s) to jump in from, take off from, or appear at.
- pilotname Name(s) to give each pilot.
- parameters Common table of extra parameters to pass pilot.add(), e.g. {ai="escort"}.
Returns:
-
Table of created pilots.
Usage:
pilots = fleet.add( 1, "Pirate Hyena", "Pirate" ) -- Creates a single Pirate Hyena.
pilots = fleet.add( 1, "Pirate Hyena", "Pirate", nil, nil, {ai="pirate_norun"} ) -- Ditto, but use the "norun" AI variant.
pilots = fleet.add( 2, { "Rhino", "Koala" }, "Trader" ) -- Creates four Trader ships.