Jump to content

[CK2] Static Portrait Replacer ver. 4.00 [CKII 2.7.1+ Compatible]


Recommended Posts

Cost me a lot of time to add a portrait to the game. I use DXTbmp to read my dds files and it says they are DXT5 format, which must have height and width of number powerd by 2, I can never get it work. I have to save a ARGB format picture, then everything seems fine.

 

Still don't know why the portraits persented in Dark World Reborn mod have DXT5 format.

Link to comment

Cost me a lot of time to add a portrait to the game. I use DXTbmp to read my dds files and it says they are DXT5 format, which must have height and width of number powerd by 2, I can never get it work. I have to save a ARGB format picture, then everything seems fine.

 

Still don't know why the portraits persented in Dark World Reborn mod have DXT5 format.

 

May I suggest you use paint.NET instead? It certainly doesn't present the problems you mention when dealing with .dds.

Link to comment

 

Cost me a lot of time to add a portrait to the game. I use DXTbmp to read my dds files and it says they are DXT5 format, which must have height and width of number powerd by 2, I can never get it work. I have to save a ARGB format picture, then everything seems fine.

 

Still don't know why the portraits persented in Dark World Reborn mod have DXT5 format.

 

May I suggest you use paint.NET instead? It certainly doesn't present the problems you mention when dealing with .dds.

 

Thanks for the suggestion, I'm going to download it.

Link to comment

Don't think so. However, it would we worth giving a thought about replacing the trait system by a flag system, since flags are lighter in memory footprint than traits. Also, that'd be one less trait file for the initialisation process to parse.

 

(plus, IIRC, charinfo shows the flags a character has, but not its hidden traits, so it should also help debugging).

 

Unfortunately, if I moved to a flag system, then Dark World would have to move to a flag system if Dew wanted to take advantage of my updates. At that point, Dew would have to retrain himself how to use the flag system, and a lot of his scripts would have to be revised, since they're referencing portrait traits.

 

This might be a hard question to answer, but how much of a performance gain do you think we'd see moving to a flag system? If we're talking 1-2%, then yea, definitely not worth it. For me, I never noticed the trait system impacting anything, even before the massive Reaper's Due optimization update, but then again I have a strong PC.

 

It is nice to know though there's another method to assigning portraits.

 

Link to comment

 

 

Cost me a lot of time to add a portrait to the game. I use DXTbmp to read my dds files and it says they are DXT5 format, which must have height and width of number powerd by 2, I can never get it work. I have to save a ARGB format picture, then everything seems fine.

 

Still don't know why the portraits persented in Dark World Reborn mod have DXT5 format.

 

May I suggest you use paint.NET instead? It certainly doesn't present the problems you mention when dealing with .dds.

 

Thanks for the suggestion, I'm going to download it.

 

 

What I use is Photoshop CS5.1 using the Nvidia .dds plugin. Here's the free plugin:

https://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop

 

Paint.NET also works, but I don't use it so I wouldn't be able to help in that regard.

 

If you have Photoshop, I included a template in this file to help in adding your own portraits.

http://www.mediafire.com/file/z4qqmaub74jijrp/src_art_%28do_not_install%29.zip

Link to comment

Cost me a lot of time to add a portrait to the game. I use DXTbmp to read my dds files and it says they are DXT5 format, which must have height and width of number powerd by 2, I can never get it work. I have to save a ARGB format picture, then everything seems fine.

 

Still don't know why the portraits persented in Dark World Reborn mod have DXT5 format.

 

I use GIMP - and oddly enough - when saving things as .dds files, using the DXT5 format is the only way they properly show up in the game for me. So, that's why they have that format.

 

Don't think so. However, it would we worth giving a thought about replacing the trait system by a flag system, since flags are lighter in memory footprint than traits. Also, that'd be one less trait file for the initialisation process to parse.

 

(plus, IIRC, charinfo shows the flags a character has, but not its hidden traits, so it should also help debugging).

 

Unfortunately, if I moved to a flag system, then Dark World would have to move to a flag system if Dew wanted to take advantage of my updates. At that point, Dew would have to retrain himself how to use the flag system, and a lot of his scripts would have to be revised, since they're referencing portrait traits.

 

This might be a hard question to answer, but how much of a performance gain do you think we'd see moving to a flag system? If we're talking 1-2%, then yea, definitely not worth it. For me, I never noticed the trait system impacting anything, even before the massive Reaper's Due optimization update, but then again I have a strong PC.

 

It is nice to know though there's another method to assigning portraits.

 

 

 

I'm fine with whatever is decided. I've heard some folks suspect that there is a flag threshold that a character can have before there are issues, but I've never seen anything that squarely verified that or not. I have seen so many flags on a character though, that they weren't all visible via charinfo. So I wouldn't necessarily consider that a strong selling point.

 

Link to comment

Fuck, apparently the new portrait packs can only be obtained through purchasing Monks and Mystics, so I have to add that as a requirement now. Of course, the player can just delete the culture gfx files for the portrait packs they are missing, but still, I wish Paradox would have more consistency with how these portraits are distributed. This would be the first time my mod requires major DLC.

Link to comment

Why? I'd say tht if anything it's nice of then to basically give the portraits for free ('cause I bet it would have been still 15 bucks without the face pack).

 

Interestingly, now we have folder structure in portrit_properties, so your custom layers can be defined in it's own .txt file. So that's one more step for compatibility with other mods.

Link to comment

Fuck, apparently the new portrait packs can only be obtained through purchasing Monks and Mystics, so I have to add that as a requirement now. Of course, the player can just delete the culture gfx files for the portrait packs they are missing, but still, I wish Paradox would have more consistency with how these portraits are distributed. This would be the first time my mod requires major DLC.

 

Yeah, the actually announced it just a day or two before release from what I saw. They said after getting so much slack for releasing 2-3 DLC packs at once (usually the main content one with 1 or 2 supporting portrait/clothing/army packs), they've listened to the feedback and have decided to now combine them into a single package. 

Link to comment

Why? I'd say tht if anything it's nice of then to basically give the portraits for free ('cause I bet it would have been still 15 bucks without the face pack).

 

Interestingly, now we have folder structure in portrit_properties, so your custom layers can be defined in it's own .txt file. So that's one more step for compatibility with other mods.

 

I'm glad you said that. Yea, that's a welcome change I just noticed, so now my portrait_properties.txt is just called "remedy_portrait_properties.txt" and isn't replacing the official Paradox file. Saves time on coding the file, because I was able to delete all that extra Paradox crap above the portrait code, so now when the modder opens the file, my portrait coding is right there at the top for them to edit.

 

Unfortunately, I'd still have to do some work to make it compatible with other portrait mods, such as Art's Anime Portraits, because he uses different culture gfx files than I do, so I'd have to join my code with his, but I'll see if he updates his before I do anything.

 

Anyways, I'm uploading the new version of my mod in a few minutes from now.

Link to comment

Okay, new version is now live.

ver 3.30:

  • CKII now allows user's to create their own portrait_properties interface file. I've called mine "remedy_portrait_properties" and deleted all the now unnecessary code above my portrait code. This slightly improves compatibility, and makes it convenient for modders to not have to scroll down to reach the start of my portrait code.
     
  • Added Monks & Mystics support for the free portrait pack. This includes the files for portraits_norman, portraits_english, portraits_german, and portraits_german_early.
     
  • Organized files to conform to Paradox reorganizing things.
     
  • Updated included portrait charts aiding you in what regions of the map the portraits correspond to, and what culture files represent each portrait pack. As always, if you're missing any portrait dlc, delete the corresponding culture_gfx files in the interface folder that you're missing to ensure compatibility on your end! Otherwise, by default, I'm assuming you own ALL the portrait dlc!
    post-204-0-18615400-1488939579_thumb.png post-204-0-25671100-1488939598_thumb.png
Link to comment

Just noticed that in the 2.6 version, the portraits properties files had a lot of instances of or-clauses with a single element, meaning that the or themselves were redundant. I guessed I'd just point out since I'm poking a bit with the code.

 

It turns out that for some reason using my proposal of replacong traits checks with flags checks doesn't work. Damnit, Paradox!

Link to comment

If you're missing any of the Paradox official portrait dlc, then you'll experience incompatibility issues. The good news is you can fix this: reference the following two charts. What region of the world map are you experiencing broken portraits? Cross-reference that region of the map with the 2nd image and delete the corresponding cultural_gfx file/s located in my interface folder. By default, I must assume my users have all the portrait dlc, so it's up to you to correct this on your end, as it'd be absurd for me to put out dozens of different mod versions accommodating all the different missing portrait dlc possibilities.

 

post-204-0-87902900-1488940987_thumb.png --> post-204-0-36251300-1488941018_thumb.png

 

And for the modders out there, one day, I had attempted to add a "has_dlc" code check event to try to notify the user of any missing portrait dlc they have with included instructions on how to fix what they're missing, until I realized "has_dlc" only works on major dlc. Portraits aren't major enough. Damn you, Paradox.

Link to comment

Alright, so you're probably tired from fixing things today so no rush to answer my question here.

 

When you get the time, and are willing to help, do you mind walking me through how to get this to be compatible with Seiji's anime portrait pack again?

Of course the other issue is that the german portrait pack screws up Seiji (not sure why it does but the English pack doesn't), but I'm hoping he will update it soon.

Link to comment

Alright, so you're probably tired from fixing things today so no rush to answer my question here.

 

When you get the time, and are willing to help, do you mind walking me through how to get this to be compatible with Seiji's anime portrait pack again?

Of course the other issue is that the german portrait pack screws up Seiji (not sure why it does but the English pack doesn't), but I'm hoping he will update it soon.

 

You're referring to Anime Portraits Patch 2.6.X?

 

Yea, the problem he currently has is his German and English portraits need to include new cultural_gfx files: portraits_norman.gfx, portraits_german_early.gfx, portraits_german.gfx, and portraits_english.gfx.

 

Once that's done, the code from his cultural files needs to be merged with my code, because our files can't coexist together. If his files take precedence, then his files will load and not my portraits, and vice versa, so the code needs to be combined. To do that, you'll be doing about half an hour of copy pasting. Not exactly hard, but time consuming, I'm not going to lie. The following code needs to be copy pasted several times into each cultural gfx file at the end of each property slot section. Each cultural file has multiple property sections. You may as well get started and maybe just wait on him to add the other new portrait files.

 

Do just one file and test it in-game before doing all the others. That would suck if you did something wrong to all of them and wasted all that time and have to go over and redo them. Reference my files for a better understanding of what this looks like in practice.

 

At the end of each of his property slot sections in his files, you'll find two lines:

"GFX_character_imprisoned:p6"

"GFX_player_overlay:p11"

 

Paste over them with:

"GFX_player_overlay:p11"

"GFX_character_remedy_portrait_swapping:p14"

"GFX_character_remedy_portrait_swapping2:p15"

"GFX_character_remedy_portrait_swapping3:p16"

"GFX_character_remedy_portrait_swapping4:p17"

"GFX_character_remedy_portrait_swapping5:p18"

"GFX_character_remedy_portrait_swapping6:p19"

"GFX_character_remedy_portrait_swapping7:p20"

"GFX_character_remedy_portrait_swapping8:p21"

"GFX_character_remedy_portrait_swapping9:p22"

"GFX_character_remedy_portrait_swapping10:p23"

"GFX_character_remedy_portrait_swapping11:p24"

"GFX_character_remedy_portrait_swapping12:p25"

"GFX_character_remedy_portrait_swapping13:p26"

"GFX_character_remedy_portrait_swapping14:p27"

"GFX_character_remedy_portrait_swapping15:p28"

"GFX_character_remedy_portrait_swapping16:p29"

"GFX_character_remedy_portrait_swapping17:p30"

"GFX_character_remedy_portrait_swapping18:p31"

"GFX_character_remedy_portrait_swapping19:p32"

"GFX_character_remedy_portrait_swapping20:p33"

"GFX_character_remedy_portrait_swapping21:p34"

"GFX_character_remedy_portrait_swapping22:p35"

"GFX_character_remedy_portrait_swapping23:p36"

"GFX_character_remedy_portrait_swapping24:p37"

"GFX_character_remedy_portrait_swapping25:p38"

"GFX_character_imprisoned:p6"

 

Do this to an offline copy of his mod. If you do this to a subscribed Steam version, if he updates his mod, you'll lose all your work.

Link to comment

I've just released a hotfix update:

ver 3.31:

  • Fixed an extra quotation mark I left behind in the 01_portraits_mediterranean.gfx file (thanks Dew). I had a CTD playing M&M, and this might be the reason, but I haven't isolated if that was the culprit, or just Paradox's fault. My update is save game compatible with my last version.

   

Link to comment

 

Alright, so you're probably tired from fixing things today so no rush to answer my question here.

 

When you get the time, and are willing to help, do you mind walking me through how to get this to be compatible with Seiji's anime portrait pack again?

Of course the other issue is that the german portrait pack screws up Seiji (not sure why it does but the English pack doesn't), but I'm hoping he will update it soon.

 

You're referring to Anime Portraits Patch 2.6.X?

 

Yea, the problem he currently has is his German and English portraits need to include new cultural_gfx files: portraits_norman.gfx, portraits_german_early.gfx, portraits_german.gfx, and portraits_english.gfx.

 

Once that's done, the code from his cultural files needs to be merged with my code, because our files can't coexist together. If his files take precedence, then his files will load and not my portraits, and vice versa, so the code needs to be combined. To do that, you'll be doing about half an hour of copy pasting. Not exactly hard, but time consuming, I'm not going to lie. The following code needs to be copy pasted several times into each cultural gfx file at the end of each property slot section. Each cultural file has multiple property sections. You may as well get started and maybe just wait on him to add the other new portrait files.

 

Do just one file and test it in-game before doing all the others. That would suck if you did something wrong to all of them and wasted all that time and have to go over and redo them. Reference my files for a better understanding of what this looks like in practice.

 

At the end of each of his property slot sections in his files, you'll find two lines:

"GFX_character_imprisoned:p6"

"GFX_player_overlay:p11"

 

Paste over them with:

"GFX_player_overlay:p11"

"GFX_character_remedy_portrait_swapping:p14"

"GFX_character_remedy_portrait_swapping2:p15"

"GFX_character_remedy_portrait_swapping3:p16"

"GFX_character_remedy_portrait_swapping4:p17"

"GFX_character_remedy_portrait_swapping5:p18"

"GFX_character_remedy_portrait_swapping6:p19"

"GFX_character_remedy_portrait_swapping7:p20"

"GFX_character_remedy_portrait_swapping8:p21"

"GFX_character_remedy_portrait_swapping9:p22"

"GFX_character_remedy_portrait_swapping10:p23"

"GFX_character_remedy_portrait_swapping11:p24"

"GFX_character_remedy_portrait_swapping12:p25"

"GFX_character_remedy_portrait_swapping13:p26"

"GFX_character_remedy_portrait_swapping14:p27"

"GFX_character_remedy_portrait_swapping15:p28"

"GFX_character_remedy_portrait_swapping16:p29"

"GFX_character_remedy_portrait_swapping17:p30"

"GFX_character_remedy_portrait_swapping18:p31"

"GFX_character_remedy_portrait_swapping19:p32"

"GFX_character_remedy_portrait_swapping20:p33"

"GFX_character_remedy_portrait_swapping21:p34"

"GFX_character_remedy_portrait_swapping22:p35"

"GFX_character_remedy_portrait_swapping23:p36"

"GFX_character_remedy_portrait_swapping24:p37"

"GFX_character_remedy_portrait_swapping25:p38"

"GFX_character_imprisoned:p6"

 

Do this to an offline copy of his mod. If you do this to a subscribed Steam version, if he updates his mod, you'll lose all your work.

 

 

First, thank you so much for the response.

Secondly, it still doesn't work.

 

I figured I would consult you before I try doing more on my own, but I copied those lines everywhere as said in the celtic portrait interface file in the anime portrait pack. It didn't work.

Next I tried editing the portrait_property file for the anime portrait mod. This also failed me.

Finally i tried copying over all the files I could think of into the anime portrait pack. At least ones that wouldn't screw things over such as the portrait strips, and the trait files. Also an unfortunate failure.

I was testing them all on the irish count of Dublin. When I try to add with the console it says "Added trait Portrait to Chief *name* of *county*" where name and country are replaced by such, and no portrait overlay is added. I figured it would have said the portrait number, but wasn't sure.

 

Again, thank you so much for the help. If I remember I had trouble like this last time.

 

edit: Here is a link to the updated Seiji Anime Portraits mod if it will help. https://mega.nz/#!yYpySSzY!jjFrY2nya1hWXvNZLawEjEI1XhQ8sB6fLr4sRTOyyDU

Link to comment

Okay, I figured it out. Few things:
1.) Another file I overlooked conflicting with my mod is interface/portraits/portrait_sprites.gfx. I copied all my "remedy" code at the top into the top of Seiji's file.

2,) For some reason, Seiji has his portraits_muslim_early.gfx file in the interface/portraits folder despite being a dlc, whereas mine is outside the portraits folder in the interface, so the mod was loading both files twice, screwing up the faces for those characters.

 

3.) Seiji's file structure is just a mess. He has files with nothing in them, is using 00_portrait_properties instead of his own custom file, and just file locations seem baffling. You're really going to just need to combine the two mods altogether, because I'm not sure a dependency sub-mod is going to work here when the files aren't sharing similar locations to each other. I seem to recall us having to do this last time.

 

I've made a mod with my changes. All you need to do is just copy paste my code I mentioned earlier into each cultural file. I did a few of the cultural files myself, tested them, and confirmed it works, 100%. Use the attached mod alone -- do not enable both my template pack or Seiji's anime mod, because I merged the two.

animeportraits_remedy_templatepack.zip

Link to comment

Okay, I figured it out. Few things:

1.) Another file I overlooked conflicting with my mod is interface/portraits/portrait_sprites.gfx. I copied all my "remedy" code at the top into the top of Seiji's file.

 

2,) For some reason, Seiji has his portraits_muslim_early.gfx file in the interface/portraits folder despite being a dlc, whereas mine is outside the portraits folder in the interface, so the mod was loading both files twice, screwing up the faces for those characters.

 

3.) Seiji's file structure is just a mess. He has files with nothing in them, is using 00_portrait_properties instead of his own custom file, and just file locations seem baffling. You're really going to just need to combine the two mods altogether, because I'm not sure a dependency sub-mod is going to work here when the files aren't sharing similar locations to each other. I seem to recall us having to do this last time.

 

I've made a mod with my changes. All you need to do is just copy paste my code I mentioned earlier into each cultural file. I did a few of the cultural files myself, tested them, and confirmed it works, 100%. Use the attached mod alone -- do not enable both my template pack or Seiji's anime mod, because I merged the two.

 

Haha, thanks.

And you're right Seiji does need to reorganize.

 

Link to comment

Alright I did all the copying except for some reason it uses the default game portraits instead of the anime ones. Which makes no sense to me considering I checked that the culture files all point to the gfx files, and they do. I'm just really at a loss. I've ran it by itself. With dark world, with shattered world, and with both darkworld and shattered world. I just don't have any idea what's wrong with it. Maybe it will work for someone else at least, or maybe I'm just a retard who misread something you said.

 

 

Link to comment

Alright I did all the copying except for some reason it uses the default game portraits instead of the anime ones. Which makes no sense to me considering I checked that the culture files all point to the gfx files, and they do. I'm just really at a loss. I've ran it by itself. With dark world, with shattered world, and with both darkworld and shattered world. I just don't have any idea what's wrong with it. Maybe it will work for someone else at least, or maybe I'm just a retard who misread something you said.

 

You ran my attached mod by itself and still saw default portraits? Yea, that's not right. I just now tested it by itself and all of them show up fine for me. Obviously, make sure the mod is enabled in your launcher, otherwise I have no clue.

 

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