to make a pack do if to to change a file or do i need to mod?
For factions the portraits themselves are 128x128 .PNG files with transparent background stored in
Starsector\starsector-core\graphics\portraits. How they are distributed in actual game is defined by .FACTION files stored in
Starsector\starsector-core\data\world\factions, particularly by
"standard_male" and
"standard_female" string arrays under
"portraits" section.
Although you can modify core game files to add new portraits in, you are better off adding them through a mod. As long as your mod maintains the core game files structure, it will just merge them in.
So, for example, if you want your mod to correctly add a new female and male portrait to Hegemony faction, it would look like this:
Starsector\mods\your_mod_name\data\world\factions\hegemony.faction containing the following code:
"portraits":{
"standard_male":[
"graphics/portraits/your_male_custom_portrait_1.png",
],
"standard_female":[
"graphics/portraits/your_female_custom_portrait1.png",
],
},
and the corresponding PNG files would be located in
Starsector\mods\your_mod_name\graphics\portraits, named
your_male_custom_portrait_1.png and
your_female_custom_portrait1.png accordingly.
After you are done with this, you will also need a mod_info.JSON file in base folder of your mod to make the game aware of its existence so you can enable it through launcher. You only need the bare minimum of ID, name, mod version, game version and description. So the code would look like this:
{
"id":"yourmodID",
"name":"your_mod_name",
"version": "1.0",
"description":"your_mod_description",
"gameVersion":"0.96a-RC10",
}
Aaaaaaaaand that's pretty much it. As long as .faction files in your mod correspond to the ones in core game files you can make it merge portraits to any faction in your game (the player faction is player.faction)