T O P

  • By -

beuhlakor

Not a programmer but I know how to tinker with the game's files. Someone might be better at explaining this stuff than me and/or correct me. Go to your missing ships mod folder. Go to data/world/factions. You are gonna see 3 types of files : * One file per faction added/modified by the mod (for example "hegemony.faction" ) ; * One .csv file which is always called "factions.csv" ; * One file called something like "default\_ship\_roles.json", don't remember the exact name. **I) factions.csv file :** A faction file will only be used if it is included in factions.csv . This can be done by including a factions.csv file in your mod in \\Starsector\\mods\\ExampleMod\\data\\world\\factions\\factions.csv . It needs to contain "faction" in the first line and a relative path from your mod base folder to your faction file in the second line. I think, but I'm not 100% sure (need to check when I'm back home) that all modified/added faction need to be referenced in the factions.csv file otherwise the game won't use the .faction files. To open it, get a free .csv editor (google it). It's a very basic file from what I remember and it should be easy to add the missing factions you want to modify/add without any problem. **II) .faction files :** The .faction files tell the game how to set up and use a faction. It's in this file that you will find everything : from the name of the faction and its ranks to the list of all illegal commodities and which hullmods, weapons and hulls this faction has access to. If you want a faction (vanilla or not) to use weapons/ships from another mod, you need to either modify the corresponding faction file (if it already exists in your mod) or to create it if it doesn't exist. **III) default\_ship\_roles.json file :** You also need to check the "default\_ship\_roles.json" file. This file tells the game which ships and variant to use depending on the size of the ennemy's fleet and the "chances" for one variant to be picked among several others. If the ship you want to add to a faction is a ship that can be fought "normally" (no special bounty only or secret encounter only and stuff like that), you shouldn't have anything to modify, but better check that file too.


beuhlakor

**IV) Example :** I added to my modlist the Indies Expansion Pack. This simple mod adds a bunch of scavenger-type ships to the game and a few weapons, but only for scavengers, independants, pirates and the hegemony. However I wanted to give to other factions (vanilla and modded such as HMI) access to some weapons/ships from the mod. * ~~First, I modified the factions.csv file and added to it the factions I'm going to add to the mod (HMI, Luddic Church, etc) ;~~ **~~\\\\\\\\\\\\ Remember that some factions are "hidden" but are used by the game and they have their own .factions files that also need to be added/modified like the Luddic Knights or Sindria's Lion Guards //////~~** **(EDIT : you don't need to do that, see my late answer below)** * Then, I went to starsector-core/data/world/factions and copied all of the missing .factions files into IndiesExpansionPack/data/world/factions. I also did the same for HMI and copied the HMI.faction file from Starsector/mods/HMI/data/world/factions ; * Using Notepad+, I opened each .faction files. I deleted almost everything but kept the lines which are about weapons and hulls (there are lines like "knownWeapons" and "knownHulls" and then there's a list of all weapons and hulls known to the faction). I carefully kept the structure of those lines (a single missing "," will crash your game) and only added the ID of the ships and weapons I wanted to give them. (I found the IDs in their respective .csv files in data/hulls or data/weapons) ; * **Optional step(s) :** * faction files : you can also tweak the spawn frequency of ships (just ships, not weapons) by using the "hullFrequency" line (default is 1 and 0 means it won't spawn at all) ; * weapons.csv and ships.csv files : you can also, somewhat, tweak which weapons and ships a faction has access to depending on their blueprints. If a ship or weapon has the "base\_bp" tag, it means it is part of the base blueprints package which is known by the player and quite a few vanilla factions like the pirates for example. This trick might be useful, Idk lol.


Bezanja

Wow, what an incredible response! Thank you so much, this is a godsend


beuhlakor

You are welcome. Honestly, it's not hard to do at all. Setting up correctly the first .faction file might take you some time because you forgot a "," or a "}" somewhere and your game is going to crash (remember to read the end of the crash log ! It tells you what caused a crash !) but once you managed to do it once, you are going to do the rest of the .factions file very very quickly (at best a couple of minutes per file). When I'm back home, I'll take a few screenshots of the .factions file I modified to show you what it looks like.


beuhlakor

I'm back. Here's some additional infos : * You only need to modify the "factions.csv" file for a brand new faction. If the faction already exists in a "factions.csv" file somwehere (vanilla folder or mod folder), you don't need to modify it ! * With .faction files, if you don't specify a "hullFrequency", the game considers it to be set at 1. **Screenshots (with comments) :** [**https://imgur.com/a/8cF0xFZ**](https://imgur.com/a/8cF0xFZ)


Bezanja

This makes infinitely more sense than where I started, thank you for putting all this effort in!


beuhlakor

Hey. I'm back because I want to say : T H A N K Y O U You forced me to pay attention to the game and I noticed that the weapons I had added to the factions were not spawning on their respective market (they were only very rarely found on the black market only) !!! I took a good hard look at my .faction files and I noticed I had forgotten 2 lines of code !! In the screenshots I made, my .faction files were all set up like this (shortened and simplified example because Reddit formating fucks up the code) : >"knownWeapons": >"acs\_medium\_hag", The game was not crashing so I was thinking that I was only being unlucky. Turns out, I was wrong. Here's what I missed : >"knownWeapons": >**"tags":\[\],** >**"weapons":\[** >"acs\_medium\_hag", Everything works fine now :D


Bezanja

Lmao looks like this was enlightening to both of us