Mod Example: Sector
This mod adds a new sector with lots of resource-rich asteroids. It also extends the sector specifics so that the sector is recognized where necessary.
About[edit | edit source]
richasteroidfield.luaScript that will generate the sector
richasteroidfield.luaExtension so that the new sector is added to
richasteroidfield.lua[edit | edit source]
SectorTemplate.getProbabilityWeight(x, y)Sets the probability (in comparison to other sectors) of this sector
SectorTemplate.offgrid(x, y)true, if the sector is meant to be a yellow dot (hidden mass sector) on the map, false for a green dot (default sector)
SectorTemplate.gates(x, y)indicates if the sector should have gates (if yes, be sure to actually create gates in
SectorTemplate.stations(x, y)indicates how many ships and stations (from, to) there can be in this sector. Important for estimates of missions.
SectorTemplate.musicTracks()The music that should be played in this sector
SectorTemplate.generate(player, seed, x, y)Function that is called when the sector generation actually happens
SectorTemplate.generate(player, seed, x, y) ist the heart of this script. It creates the content of the sector, in this case several rich asteroid fields.
modinfo.lua[edit | edit source]
serverSideOnly = trueThe mod can be run server-side only as sector generation only happens on the server. The mod also doesn't add any new scripts, assets or localization.
clientSideOnly = falseClient side only is impossible, since the mod is already server side only. Sector generation happens only on the server.
saveGameAltering = falseThe mod doesn't add any new scripts or assets to the game, so it doesn't alter save games in a way that they might become corrupted once the mod is no longer active. It only reuses already existing game objects and logic.