Jump to content

5b641a68697514fe

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by 5b641a68697514fe

  1. 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"}
  2. Hello, I am enjoying Avorion right now. But I'd like to learn much more about everything that happens in the file "internal/stylegenerator.lua". I've checked the documentation provided with the game, the front page of the Internet website, DuckDuckGo, the Avorion wiki... but I was sadly unable to locate any documentation, noting that the documentation is "not necessarily complete". The best documentation would simply by the LUA code. According to forum moderator koonschi's comment number 25054, "we don't encrypt anything". I have a legal copy of Avorion. What would be the best way to obtain the LUA code (or detailed documentation) for the "internal/stylegenerator.lua" file? Thank you very much for your assistance.
×
×
  • Create New...