Jump to content

[mod] Species_Classes and Portraits text file generator


Recommended Posts

1 hour ago, KingSuperJam said:

i'm fairly certain everything's been set up right but i'm having problems with specifically reptilians being generated correctly almost all of them are blank black boxes and thats even with no mods other then the portrait mod i was putting together. I'm pretty sure i can manually fix them but i haven't been able to get it to do it correctly with just the script

okay so i found the cause of the issue, one of the portraits i was working with was the snakes or vipers as it's listed in the files from lewd galaxy but the images are named SNAKE!, apparently that ! causes something to break every single species photo from the entire category it's in, i couldn't tell you why but removing the ! fixed it completely

Edited by KingSuperJam
typoe's e.e
Link to comment
On 10/27/2023 at 8:37 PM, KingSuperJam said:

okay so i found the cause of the issue, one of the portraits i was working with was the snakes or vipers as it's listed in the files from lewd galaxy but the images are named SNAKE!, apparently that ! causes something to break every single species photo from the entire category it's in, i couldn't tell you why but removing the ! fixed it completely

I think I know why.

The portraits file (and maybe others) can't handle certain characters in it's name.
I had a similar problem with brackets "(" and ")", so I had to get the code to replace them with underscore "_".
In your case I think it refused to work with the exclamation mark "!".
I'm guessing there is more that it can't deal with, but I couldn't find a list at the time.

Line 492 is what's checking for bad characters in the file name.
If you find more and want the code to handle it you could modify that line.
I think that line is pretty self explanatory in how to add more characters to the list of replaced ones. Edit: Happy to give an example/help if needed though
Just don't replace underscore ?

Edited by Goregath
Link to comment
  • 4 weeks later...
On 11/25/2023 at 1:54 AM, hawwwwwwwwk said:

does this only work for new species or also to add more portraits to already existing species?


TL;DR -> Can do both, depending on naming convention.


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Assume you have a folder called 'TestMod' and the only directory in there was 'TestMod\gfx\models', with folders of each race (Aquatic, Anthropod, ... etc.).

  • The program searches in each folder looking for files it recognizes (only dds and png by default)
  • It will then check if species classes and portraits folders exist (creating them if not)
  • Both the species classes and portraits folders is populated with the txt files needed to tell Stellaris what to do with the images

 

If you have other mods, this should* just add to your pool.

If you use this repeatedly on the one folder, it will recreate the txt files and update the contents.
If you use this on an existing mod, it may recreate or double up on portraits depending on file names used.


*My understanding of Stellaris mods is that it looks for recognized txt files and overrides them.

Example one:
You may notice that in Vanilla Framework there are two files: 00_species_classes.txt and 01_base_species_classes.txt that are both empty. This is because Stellaris will see that file, use it instead of it's own, and stop generating the normal portraits.

Example two:
Earlier in the development of this program it used 'test' in the text file names which would generate duplicate portraits of Vanilla Framework. So Stellaris appears to accept new files and just add their contents to the game, so long as the name is unique.

So how mods play together may be down to naming convention.


The original point of this program is to make it easier to simply sort your pictures and inject them into a Vanilla Framework quickly. I was in the process of making it more general so it was easy for other modders to use. Which would make it faster for modders to do more important/exciting stuff rather than copy paste 1000 lines over and over to get their portraits in.
 

Link to comment
  • 2 weeks later...
On 12/9/2023 at 9:26 PM, Trololololololge said:

hello ive followed your instructions for IDLE and yet i still got the 'invalid decimal literal'

Screenshot (694).png


Can you check if it worked?

For the IDLE instructions you don't need that third line, the first two are all that's needed.
Invalid decimal literal is upset at the '.' in IDLE as it doesn't understand what to do.
The third line is what you need if you are running it in terminal/cmd/powershell.
Which is why it's upset.

But it looks like the first two worked fine, so it should have worked correctly.

Link to comment
  • 2 weeks later...
On 6/29/2023 at 2:33 PM, Goregath said:

I've been looking into that.

The hardest part is making a naming convention that works/is easy to use.

The next is making sure the code doesn't break if not enough portraits are used found.
 

But it's next on my list and I already have an idea of how to do it.


If Is there is a good example mod that has sets for each leader type that I could practice on to start?

 

 

Way late I know, but I drifted away from Stellaris (and my mod) for a while so I just got around to giving your script a shot with my gendered portraits.  Sorry I didn't see your note to provide you a example mod.  But. works like a charm and makes my life way easier when I need to make changes.  Serious props for this script.

Link to comment
10 hours ago, Fake438 said:

For some reason in IDLE the whole thing just hangs on "detecting paths". Anyone else encounter this? 

pzthon.PNG


You've inspired me to update it with some of my previous changes.
I added more warnings for when it fails to detect folders (which is what I'm guessing is happening)

Can you try the latest version with verbose? (same way as you did in the picture will work)


My Guess:
My guess is that it is finding the folder (gfx\models), but ignoring all the subfolders in there.
If it is empty it will say nothing (changed in new version 1_0_8), otherwise it is ignoring all the contents (but will say what it ignores when verbose and version 1_0_8).

There is a list in the code (line 84 to 88 in version 1_0_8) that has the folder names it will look into.
Looks like this:

#Playable species folders

Topspecies_names=['Aquatic', 'Arthropoid', 'Avian',

                'Fungoid', 'Humanoid', 'Kemonomimi',

                'Lithoid', 'Machine', 'Mammalian',

                'Molluscoid', 'Necroid', 'Plantoid',

                'Reptilian', 'Toxoid'] #Only the normal types will work, the rest are special (I think)


At the moment it uses these folder names to determine where each portrait set ends up in the portraits and species files.
I would recommend following that naming convention if possible.

 

 

Link to comment
14 hours ago, Goregath said:


You've inspired me to update it with some of my previous changes.
I added more warnings for when it fails to detect folders (which is what I'm guessing is happening)

Can you try the latest version with verbose? (same way as you did in the picture will work)


My Guess:
My guess is that it is finding the folder (gfx\models), but ignoring all the subfolders in there.
If it is empty it will say nothing (changed in new version 1_0_8), otherwise it is ignoring all the contents (but will say what it ignores when verbose and version 1_0_8).

There is a list in the code (line 84 to 88 in version 1_0_8) that has the folder names it will look into.
Looks like this:

#Playable species folders

Topspecies_names=['Aquatic', 'Arthropoid', 'Avian',

                'Fungoid', 'Humanoid', 'Kemonomimi',

                'Lithoid', 'Machine', 'Mammalian',

                'Molluscoid', 'Necroid', 'Plantoid',

                'Reptilian', 'Toxoid'] #Only the normal types will work, the rest are special (I think)


At the moment it uses these folder names to determine where each portrait set ends up in the portraits and species files.
I would recommend following that naming convention if possible.

 

 

Sorry for the late response I did not expect anyone to respond so quickly. Anyway the new version works just fine. 

IDLE.PNG

Link to comment

Could I have a gentleman record a video on how to make a species using this tool from start to finish? I can't wrap my head around the already existing tutorials I could find on Youtube to make a portrait mod but I would very much like to. Additionally it would simply be nice to add to the description of this tool so our like minded can't complain about not knowing how to make mods.

Link to comment
  • 3 weeks later...
On 1/13/2024 at 5:27 PM, Yourmamu said:

Could I have a gentleman record a video on how to make a species using this tool from start to finish? I can't wrap my head around the already existing tutorials I could find on Youtube to make a portrait mod but I would very much like to. Additionally it would simply be nice to add to the description of this tool so our like minded can't complain about not knowing how to make mods.

Seconded on this... I have no clue how to get this to work, I tried running it and I only get syntax errors.

Link to comment
  • 2 weeks later...
On 1/14/2024 at 8:27 AM, Yourmamu said:

Could I have a gentleman record a video on how to make a species using this tool from start to finish? I can't wrap my head around the already existing tutorials I could find on Youtube to make a portrait mod but I would very much like to. Additionally it would simply be nice to add to the description of this tool so our like minded can't complain about not knowing how to make mods.


I've added a video of using this script. EDIT: it's with the python files in the downloads.
It has two test cases: one with just the VF portrait files, and another with one portrait set.
It uses both terminal and IDLE.

 

On 1/31/2024 at 10:34 AM, sila said:

Seconded on this... I have no clue how to get this to work, I tried running it and I only get syntax errors.

 

You may have to send/post the syntax errors.
Most likely it'll be a bug in the code or some edge case I didn't account for.

Edited by Goregath
Link to comment
On 2/22/2024 at 12:12 PM, Frederto said:

I'm having trouble adding new portraits. The female and male work fine, but when I give the species the futa trait all the portraits default to F1 of that species and won't change. This is for all species.


I've seen this once before so I can guess at the problem.
There was an issue where the race was set to all female, or all male, and then gets the futa trait.
Having a conflicting gender setting vs trait will cause all portraits to become F1 of the species.
 

On 7/6/2023 at 9:37 AM, Goregath said:

 

I think I know what's wrong.

I can replicate the problem if I have a species that is set to all female where you set the name, and has the futa trait.
This will cause all the portrait conditions to fail and the default be the only available portrait .

 

Edit:

I should note that the leader you pick before entering a game will respect the trait pick (in this case futa), and show up in game correctly. Every other portrait will be the default one after you start the game.

Screenshot 2023-07-06 093508.png

Screenshot 2023-07-06 093531.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use