Jump to content

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


Recommended Posts

Amazing support mate! :D

 

I have moded 00_religions.txt for heir designation to norse pagan, enabled enatic on succession_laws.txt and a custom flag for a kingdom. I highly doubt those little tweaks have something to interfere with the mod!

 

Regards

 

What culture are you playing as? It's possible I messed up the code in one of them and you happen to just be playing the culture I screwed up on.

 

Beyond that, I'm testing the age thing on my end and my portrait isn't changing. What I would do if you have the free time, assuming the culture isn't the issue, is try jumping into a quick singleplayer game with no sub-mods enabled and seeing if it works for you. Give yourself add_trait griffith2 and use age 70 to make yourself old. Pick the same culture you were using in your multiplayer game. If it's still giving you issues, then its the culture. If it isn't, then its either multiplayer or one of your sub-mods.

Link to comment

I was playing as norse. I tried to replicate it on a singleplayer game and it seems fine, looks like what you said, the savegame became corrupted for some reason. Maybe is just the fact that I had to edit it in order to get the portrait replace working, since the console says no cheats in MP >.<. There is no way of using the console on mp game?

Link to comment

I was playing as norse. I tried to replicate it on a singleplayer game and it seems fine, looks like what you said, the savegame became corrupted for some reason. Maybe is just the fact that I had to edit it in order to get the portrait replace working, since the console says no cheats in MP >.<. There is no way of using the console on mp game?

Not without a mod that you can teach to assign portraits automatically. Even then, you would need to program the mod based on the criteria you want for portrait assigning. For example, maybe cruel chars could pull from a select random batch of photos, while kind chars use a different batch. Problem with this approach is the entire game's chars would acquire portraits (unless you define only the player as a fast trigger target, in which case only the player's character would receive a portrait), and you're leaving an element of chance that your character might get a portrait you don't like. At that point, it's impossible to remove if you can't use console.

 

Due to the unreliability of portrait assigning with that approach and the vastly different opinions players will have over the handling of such a mod, it's not an approach that would work as a mod release. Every player would have to edit it to tailor to their needs.

Link to comment

the portrait traits are invisible and they dont appear in the ruler deigner. They work its that you cant see them in the traits section of a character or in the rule designer.

 

That's intentional. I used to have trait icons prior to the Reaper's Due patch, but that patch introduced the ability to have invisible traits. This is a welcome addition, because my traits were purely cosmetic anyways, meaning hovering over them was largely useless, and they took up a trait slot, which CKII already is cramped for trait space as it is, especially with the advent of Reaper's Due having trait symptoms and other new traits. It's worth noting invisible traits existed prior to Reaper's Due; however, they would still take up a trait slot, resulting in this vacuum of space that looked odd, so I knew that was a poor solution to hiding the traits, so I was instead forced to embrace visible trait icons.

 

If you'd like to reenable the visibility of trait icons, it's very easy: Go into common/remedy_portrait_traits.txt and next to each portrait it will say hidden = yes. Set each one to no. To make this process quicker, if you have Notepad++, you can do a find and in the replace tab for all entries equaling hidden = yes, set it to replace with hidden = no.

 

The anime portraits actually are enabled in the ruler designer, but I disabled the ruler designer traits for the template pack because I don't see the point in having a bunch of empty trait icons. You can enable them anyways in the remedy_portraits_traits.txt by setting customizer = no to customizer = yes. The icons won't be there, but you'll see the selection boxes.

Link to comment

You can do that in notpad++? Holy shit that makes everything easier.

 

Yea, I love Notepad++. At first I was reluctant to download it, even though it was free, because I prefer to limit what I download for adware/malware issues, but if you do anything modding related -- even if you're just editing someone else's code -- it's absolutely essential. I'll never go back.

 

Something else you can do is install settings that highlight key words in CKII to make sections of your code stand out. It makes everything more legible, so it's easier to catch issues. My favorite part is when you select a start or end bracket, you can see what bracket that matches up with, so you know your code is closed off correctly. Here's a screenshot of a window from a mod I'm working on:

post-204-0-12403300-1480726816_thumb.jpg

Link to comment
  • 2 weeks later...

 

 

 

 

Just curious, if you know, would it be possible to get more portrait slots by cutting out other features (like traits, I noticed all of the gfx are trait related to trigger) that doesn't alter the face? 

 

 

cab243b148ab808f98cd28a19f6a0bc3.png

 

feels bad

 

Is there any reason why you capped it 22 frames? Mine seems to cycle back to frame 1 after I use 27 frames.

 

Would love to know a method to automate adding this many traits and modifiers that I gotta do manually, lol.

 

 

Beyond removing blinded, red dots, boils, scars, and the multiplayer purple vignette graphics, I haven't experimented with removing any others. There might be other methods, but for me, just 84 portraits was plenty, let alone 105, lol. Maybe I'll dabble around and see what I can come up with.

 

I capped each portrait set to 21 because as far as I could tell, I had to. Any portraits after 21 (22 if you count the empty box on the far-left) would be ignored when I tried adding them to characters. Are you saying you're able to get up to a cap of 26 frames? If so, I'll have to re-examine what I might have overlooked. That would be huge, because it would be 26 x 5 = 130 portraits as opposed to 21 x 5 = 105. That's almost an entire extra set.

 

The only method I know to automate traits and portraits would be on pre-generated characters, such as the Game of Thrones characters. Each character's traits are pre-assigned on start-up in the history folder, so they automatically acquire their traits when a new game commences. You can see that in this screenshot here that I'm working on - the game hasn't even started yet, and they have portraits:

 

O0bkkZ6.jpg

 

 

Problem is, in a traditional CKII game, characters are randomly generated, so I doubt this would apply to you.

 

I just increased the frames to 27 (includeds frame 1, invisible one, total of 26 usable frames) and added 5*152 to your frame. I've replaced all the 0-13 things with static pictures, just need to fill in the template now. 

 

By automate, I meant like a typewriting programming, gotta copy and paste over and over again traits and frames to create more, lol. Thankfully I finished all of them. 

 

I already have a method of auto assigning the traits on start game, though not during menu or character selection.

 

If you remove all the character graphics you end up with something like this for every character without the portaittrait

dbfb690af2eda2998ffe97d36eaf8f75.png

 

Trying to figure out how to make the portrait trait not appear but guess there's no way of hiding it.

 

d02ce4ae1c78c52d384be52b12cbd30c.png

 

 

Can i please have the portraits you're using? i cant seem to find them :(

 

Link to comment

Remedy, when I add_trait, absolutely nothing happens to the portrait, it just remains..well, the same.

am I doing something wrong?

 

 

I do use CK2plus alongside this, but Dark World's portrait pack worked just fine with CK2plus

 

Ooooh Wait, its mythos-historical fantasy, isn't it?

Link to comment

Remedy, when I add_trait, absolutely nothing happens to the portrait, it just remains..well, the same.

am I doing something wrong?

 

 

I do use CK2plus alongside this, but Dark World's portrait pack worked just fine with CK2plus

 

Ooooh Wait, its mythos-historical fantasy, isn't it?

It could be a few things. When you add the portrait, do you get red text in the console message, saying it can't find the trait bc it's missing?

 

If it accepts the code, and you don't see the portrait, that could be a property slot issue, which could be two things. Are you applying the portrait to a custom culture? My files only include support for the vanilla cultures, so you must add your own culture support, which is easy to do -- copy the custom culture gfx from the user mod into my mod folder, then change the property slots to look similar to my own files. It could also be CKII+ sharing an interface/portrait_properties txt file, conflicting with my own. The reason that may not be an issue in Dark World is if Dark World has a dependency hooked to CKII+. What you can do is just copy over all my portrait properties code containing the portrait data to replace CKII+, or vice versa, or you might try adding CKII+ as a dependency to treat my mod as a sub-mod.

 

Im not sure anout Mythos, but the easiest way to confirm if a mod is a culprit is to disable it and see if that fixes it. If not, keep disabling mods until you found the culprit

Link to comment
  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...

Hi, everyone. Keep in mind Monks and Mystics is releasing on March 7th that includes another portrait pack, so after it releases, expect to see an update on my end within a day or two.

 

Now that I have that out of the way, I just released a substantial update. I recommend it for the fix to Ugric old females not working.
 

ver 3.22:

  • Now supports up to 650 portraits; increased from the previous 520 portraits. While this many portraits might sound insane, this was necessary because if a modder uses my portrait pack in their mod while a separate player adds their own portraits on top of the author's work, it's good to ensure there's enough portraits to accommodate both the author AND the player, as they're fighting for portrait space!
     
  • Added small numbers corresponding to each portrait number in the bottom-left of each frame. These numbers are on the alpha layer, so they will NOT show up in-game. I did this as a matter of convenience -- if a person has an entire strip of portraits filled in, they lose out on the portrait numbering information, so they have to count out the number of portraits to know what portrait to call up in the console! This should simplify the process of knowing what portrait number you're looking at when it's filled in. I only did this for the template pack, not my anime pack, as my anime pack uses a naming convention, unlike the template pack's numbering approach.
     
  • Fixed a typo in the ugric cultural file, causing portraits to not work on Ugric female old age characters.
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).

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).

 

That is conceivable with the new changes M&M brings, but I don't think it could have been done that way originally.

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).

 

That is conceivable with the new changes M&M brings, but I don't think it could have been done that way originally.

 

Why not? In my mind, it should be pretty straightforward:

 

 

 

0. Remove the trait entries relating to the portrait traits.

1. Open all txt files in the mod in notepad++, press Ctrl+f and click on the "replace" tab and check the "regular expressions" checkbox. Here, we do three replacement as follows (order is important.).

2. In the find field type add_trait\s*=\s*(portrait\d+) and in the replace field type set_character_flag = \1; then hit "replace in all open files".

3. In the find field type reomve_trait\s*=\s*(portrait\d+) and in the replace field type clr_character_flag = \1; then hit "replace in all open files".

3. In the find field type trait\s*=\s(portrait\d+) and in the replace field type has_character_flag = \1; then hit "replace in all open files.

 

 

 

That should take care of 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).

 

That is conceivable with the new changes M&M brings, but I don't think it could have been done that way originally.

 

Why not? In my mind, it should be pretty straightforward:

 

 

 

0. Remove the trait entries relating to the portrait traits.

1. Open all txt files in the mod in notepad++, press Ctrl+f and click on the "replace" tab and check the "regular expressions" checkbox. Here, we do three replacement as follows (order is important.).

2. In the find field type add_trait\s*=\s*(portrait\d+) and in the replace field type set_character_flag = \1; then hit "replace in all open files".

3. In the find field type reomve_trait\s*=\s*(portrait\d+) and in the replace field type clr_character_flag = \1; then hit "replace in all open files".

3. In the find field type trait\s*=\s(portrait\d+) and in the replace field type has_character_flag = \1; then hit "replace in all open files.

 

 

 

That should take care of it.

 

A non-trait system wont randomize.  Of course you could program several randomizers for that but... not sure if it is worth 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).

 

That is conceivable with the new changes M&M brings, but I don't think it could have been done that way originally.

 

Why not? In my mind, it should be pretty straightforward:

 

 

 

0. Remove the trait entries relating to the portrait traits.

1. Open all txt files in the mod in notepad++, press Ctrl+f and click on the "replace" tab and check the "regular expressions" checkbox. Here, we do three replacement as follows (order is important.).

2. In the find field type add_trait\s*=\s*(portrait\d+) and in the replace field type set_character_flag = \1; then hit "replace in all open files".

3. In the find field type reomve_trait\s*=\s*(portrait\d+) and in the replace field type clr_character_flag = \1; then hit "replace in all open files".

3. In the find field type trait\s*=\s(portrait\d+) and in the replace field type has_character_flag = \1; then hit "replace in all open files.

 

 

 

That should take care of it.

 

A non-trait system wont randomize.  Of course you could program several randomizers for that but... not sure if it is worth it.

 

I fear I'm not following you. What do you mean with "randomize" here? Are you refering to either the random or random_list script commands? Both of those works with any command, including setting and removing character flags.

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).

 

That is conceivable with the new changes M&M brings, but I don't think it could have been done that way originally.

 

Why not? In my mind, it should be pretty straightforward:

 

 

 

0. Remove the trait entries relating to the portrait traits.

1. Open all txt files in the mod in notepad++, press Ctrl+f and click on the "replace" tab and check the "regular expressions" checkbox. Here, we do three replacement as follows (order is important.).

2. In the find field type add_trait\s*=\s*(portrait\d+) and in the replace field type set_character_flag = \1; then hit "replace in all open files".

3. In the find field type reomve_trait\s*=\s*(portrait\d+) and in the replace field type clr_character_flag = \1; then hit "replace in all open files".

3. In the find field type trait\s*=\s(portrait\d+) and in the replace field type has_character_flag = \1; then hit "replace in all open files.

 

 

 

That should take care of it.

 

A non-trait system wont randomize.  Of course you could program several randomizers for that but... not sure if it is worth it.

 

I fear I'm not following you. What do you mean with "randomize" here? Are you refering to either the random or random_list script commands? Both of those works with any command, including setting and removing character flags.

 

Sorry about that... I was getting how my own system worked mixed into my head for some reason.  Because of how I programmed the static portraits on my centaur race, they actually randomize automatically upon birth and are based off of a one of the letters on your character's properties string.

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