Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Planet Search Overhaul (07/13/24)

Author Topic: what type of file do portraits use  (Read 618 times)

cinnaguns

  • Ensign
  • *
  • Posts: 1
    • View Profile
what type of file do portraits use
« on: August 27, 2023, 02:12:09 AM »

to make a pack do if to to change a file or do i need to mod?
Logged

Fenrir

  • Captain
  • ****
  • Posts: 276
    • View Profile
Re: what type of file do portraits use
« Reply #1 on: August 27, 2023, 07:11:12 AM »

.png files. Portrait pack mods are relatively simple, you can copy existing ones' structures to make your own.
Logged
*cough* try tossing the PK into a black hole *cough*

Nettle

  • Admiral
  • *****
  • Posts: 662
  • making humorous maneuvers
    • View Profile
Re: what type of file do portraits use
« Reply #2 on: August 27, 2023, 01:42:33 PM »

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:

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:

Code
{
"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)
« Last Edit: August 27, 2023, 10:05:51 PM by Nettle »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3060
    • View Profile
Re: what type of file do portraits use
« Reply #3 on: August 27, 2023, 05:33:40 PM »

.faction is not part of the file names. So it is just "hegemony.faction", "player.faction", etc.

Same for .ship, .variant, etc. They are JSON files with custom type names.
Logged

SpaceDrake

  • Admiral
  • *****
  • Posts: 547
  • Piloting space mecha for fun and profit(?)
    • View Profile
Re: what type of file do portraits use
« Reply #4 on: August 27, 2023, 08:15:26 PM »

Nettle beat me to it. Though as one note: Starsector does also support the .jpg format, as well as .png.

That said, you'll usually want .png for better color fidelity.
Logged

Nettle

  • Admiral
  • *****
  • Posts: 662
  • making humorous maneuvers
    • View Profile
Re: what type of file do portraits use
« Reply #5 on: August 27, 2023, 10:02:07 PM »

.faction is not part of the file names. So it is just "hegemony.faction", "player.faction", etc.

Same for .ship, .variant, etc. They are JSON files with custom type names.

Indeed, that's just my bad, edited my original reply.
Logged