Well might I add that you and all the other developer(s) did a fantastic job with the new ship generator.
The summary helped, but I'll be able to see the file in whole sooner or later.
If anyone else is interested, here's a little script I wrote so I could spawn in a ship no-fuss, with any parameters I wanted, giving much more access to the game's ship generator than the ~dev script. All arguments are optional, and the default will spawn a fully functioning ship in front of the player. Returns the created ship (Entity).
function spawn_ship(args)
-- Accepted args. All are optional. Indent indicates fallback option(s).
-- args.faction
-- args.factionIndex
-- args.plan
-- args.style
-- args.typeName -- either "Ship", "Carrier", "Freighter", "Miner", "Station", or "XsotanShip"
-- args.styleName -- seed for ship style randomization
-- args.seed -- seed for ship plan randomization, based on style constraints
-- args.volume
-- args.maxBlocks -- 200 for fighters and shuttles; 5,000 for most ships; 10,000 for stations
-- args.scaleToFit -- usually 1 or nil?
-- args.material
-- args.materialType -- number: 0 = Iron, etc.
-- args.sector -- sector to spawn ship in
-- args.name -- ship name
-- args.position -- position to spawn ship at in sector
-- args.arrivalType -- 0, 1, or 2
-- args.crew
-- args.shieldDurability
-- args.defenseLevel -- 2 is "careful", usually 1 for players, usually 0 for ai.
local StyleGenerator = include("internal/stylegenerator.lua")
local Galaxy = include("galaxy")
args.faction = args.faction or Faction(args.factionIndex) -- defaults to player's faction
if args.plan == nil then
if args.style == nil then
local generator = StyleGenerator(args.faction.index)
args.style = generator["make" .. (args.typeName or "Ship") .. "Style"](generator, Seed(args.styleName or math.random(0xffffffff)))
end
args.plan = GeneratePlanFromStyle(
args.style,
Seed(args.seed or math.random(0xffffffff)),
args.volume or Balancing_GetSectorShipVolume(args.faction:getHomeSectorCoordinates()) * 7.5,
args.maxBlocks or 5000,
args.scaleToFit or 1,
args.material or Material(args.materialType or MaterialType.Iron)
)
end
args.sector = args.sector or Sector()
local ship = args.sector:createShip(
args.faction,
args.name or "",
args.plan,
args.position or MatrixLookUpPosition(-Entity().look, Entity().up, Entity().translationf + Entity().look * 100),
args.arrivalType or EntityArrivalType.Jump
)
ship.crew = args.crew or ship.idealCrew
ship.shieldDurability = args.shieldDurability or ship.shieldMaxDurability
ship:addScriptOnce("data/scripts/entity/startbuilding.lua")
ship:addScriptOnce("data/scripts/entity/entercraft.lua")
ship:addScriptOnce("data/scripts/entity/exitcraft.lua")
ship:addScriptOnce("data/scripts/entity/invitetogroup.lua")
ship:addScriptOnce("data/scripts/entity/orderchain.lua")
ship:addScriptOnce("data/scripts/entity/transfercrewgoods.lua")
local boarding = Boarding(ship)
boarding.defenseLevel = args.defenseLevel or 2
return ship
end
Example:
spawn_ship{name = "My Ship 9000"}