Here's pretty much everything you need to know to code a station that'll function in combat, or make multi-part ships in Starsector 0.8.1:
Station Bases (the main bit where everything else is stuck on)
Spoiler
- The station base is a normal ship with its own .ship file. It'll usually be defined as a capital ship, but you can go smaller.
- The base has its own sprite, where you should make only the base, without any modules.
- It gets its own row in the ship_data.csv, where you can put in values for every column you'd use for a normal movable ship.
- You'll want to put "STATION" in its tags - that's what'll tell the game that it's a station, prevent it from being controlled, and make the AI stop moving.
- The STATION tag also makes it so that a station will already be on the battlefield when combat begins, instead of having to be manually deployed.
- You can put in campaign stats like maintenance, storage capacity and burn speed if you want to have your station be in a campaign fleet, or put them at 0 if you want.
- You can blank out the columns for peak performance time and CR loss per second, which you should probably do to prevent it from being outlasted.
- In the .ship file, put a LARGE HARDPOINT mount with the type as STATION_MODULE. This'll be where your modules will go. Give them normal weapon slot names. Give them an arc of 0, it doesn't matter, doesn't do anything. Changing the angle also changes the angle at which the module is facing, otherwise it'll point straight forwards.
- There are three hullmods made for station bases - Vast Bulk (vastbulk) which makes the station base invincible, Axial Rotation (axialrotation) which makes it spin to the right, and Targetting Supercomputer (supercomputer) which gives it +200% normal weapon range and +60% PD weapon range. Add these as built-in hullmods if you want them, but they aren't necessary.
- If you give your station base Vast Bulk, it'll die when all modules with ordnance points are disabled or destroyed. If it doesn't, the base will also have to be destroyed to kill the station.
- The speed that a station rotates at is dependent on the base's maximum turn speed, which it will always turn at.
- If you want your station base to have weapons that aren't part of a module, put those on as normal. Put on the optional hullmod Targetting Supercomputer (supercomputer) which gives it +200% normal weapon range and +60% PD weapon range, to prevent if from being outranged.
Station Modules (the extra parts that go onto the base)
Spoiler
- Modules are also their own separate ships. Usually defined as a frigate, but you can go bigger if you want to.
- Setting the size higher than "frigate" can make annoying whiteouts when the module is destroyed.
- Modules have sprites separate to the base. Make them just like normal ship sprites - pointing upwards. You can adjust their angle by changing the angle of the relevant weapon mount in the base's .ship file.
- They get their own row in the .csv, where you can fill out everything as normal.
- Campaign stats don't affect anything when put on a module - put them on the base, instead. Just set them as 0 for the module.
- Modules contribute their mass to the mass of the entire station.
- The module will appear with its center of mass where the relevant STATION_MODULE hardpoint is on the base.
- There are a few hullmods made for modules - Targetting Supercomputer (supercomputer) outlined in the previous section which increases range, Always Detaches (always_detaches) and Never Detaches (never_detaches) which either force a module to pop off the base after being disabled, or force it to stay attached. Otherwise, it'll pick a random option on death.
- Reduced Explosion (reduced_explosion) is a hullmod that reduces a ship's death explosion range and damage greatly, for use on modules where you don't want one module's destruction to damage other modules. Leave it off if you want to have important modules destroy nearby minor modules when disabled.
Variant Files (and other miscellaneous things)
Spoiler
- Station bases have variant files as normal. Assign weapon groups as you would for a normal ship, but also add in the slots for the modules. Just put in the slot name and instead of a weapon, put in the name of the module's .variant file. They won't appear in the weapon group in-game, so it doesn't matter what group they're in.
- Station modules also have normal variant files. Nothing special.
- Stations can be refit if they make their way into a player's fleet. You can refit any module that has ordnance points. Both the base and each module have separate ordnance point limits, capacitors, vents and hullmods. If the base or any module has a d-mod, the d-mod(s) can be restored separately for each part by selecting it and clicking Restore like you would restore a normal ship.
- Stations can be crewed by an officer, who will grant their bonuses to the base and all of the modules.
- Stations can be assigned roles in a .faction file as normal and they'll spawn as you'd expect, but you can use scripting to call on them when you want. Salvagable objects can have a chance to spawn a station when you try to salvage them - check out data/campaign/procgen/salvage_entity_gen_data.csv for an example.
- If a station is assigned a role in a .faction file, they will appear in markets, with every module that the variant listed would normally have. All the modules will have empty weapon slots except for built-ins.
- In dev mode, you can hold control and click on modules to take control of them.
Modular Ships (non-stations with station modules)
Spoiler
- You can set up your modular ship as normal.
- The main part of the ship has its own sprite, and each module has its own sprite, just like a station.
- Everything in ship_data.csv can be set up just like a normal ship, but add "SHIP_WITH_MODULES" to its tags, instead of STATION.
- Otherwise, everything is the exact same as making a station. Set up the STATION_MODULE large hardpoints, make modules just like for a normal station, slot them into the .variant file of the ship, and you're good to go!
- While the ship will be able to be controlled as normal, the modules are controlled by the AI.
- Modules can have their own shields. Make an invisible module, give it a shield, set the shield radius slightly higher or lower than the parent ship's radius, and have fun!
- Modules can also have their own ship systems! This isn't terribly useful with most vanilla ship systems, but you can have fun with things like EMP generators, flare launchers, and targetted systems like Interdictor Array. The module will automatically use their systems as it sees fit.
Hopefully this is useful to modders who want to make their own battlestations and multi-part ships!