• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Measter

Major
70 Badges
Jan 2, 2011
612
4
  • Crusader Kings II
  • Europa Universalis IV: Pre-order
  • Sword of the Stars II
  • Sword of the Stars
  • Sengoku
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Magicka
  • Heir to the Throne
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Cities in Motion 2
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Conclave
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mandate of Heaven
  • BATTLETECH
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Age of Wonders III
  • 500k Club
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis III Complete
  • Europa Universalis III Complete
portraitbuilder1.1.png


Portrait Builder 1.1.7 (Download) (requires .Net 3.5)​

Note: I've decided to stop development of this program, and release the source code. You can find it here.

I finally finished it. This is intended for create custom characters so that you can choose the appearance, though you can also use it to modify a character in a saved game.

For the properties code, I've left the prisoner, boils, red dots, and scars as 0, so the game can set those as needed. Properties may be overridden by the game.

Portrait data is loaded from vanilla's portrait.gfx file, or from a single mod.

Version History:

Version 1.1.7
- Added logging. Outputs log on error, and can be forced to output with -log.
- Now attempts to load portrait info from all .gfx files in \interface.
- Can now load mods from My Documents folder.
- Fixed crash when trying to parse a portrait type which already exists.

Version 1.1.6
- Fixed bug in import validation.
- Changed notice text in import dialog to specify 11 digits.

Version 1.1.5
- Updated for CKUtils 1.8.
- Now loads portrait sprites from portrait_sprites.gfx.
- Added selector for the 11th property digit.
- Importing now requires 11 digits for property code.

Version 1.1.4
- Changed UI setup to not be dependent on certain keywords in layer names. As a result of this, female portrait sets will have the Beard pull down filled, but changing it won't do anything.

Version 1.1.3
- Fixed bug in Muslim hair rendering in vanilla files.

Version 1.1.2
- Added digit to DNA code output to prevent game crash(again).
- Fixed bug when importing DNA codes when using a female portrait set.
- DNA and Property codes are now no longer randomized when changing portrait sets.

Version 1.1.1
- Fixed bug causing crash due to lack of beard on females.

Version 1.1
- Rewrote the program to use CK2s portrait.gfx file instead of .portset files.

Version 1.0.3
- Added randomization button.

Version 1.0.2
- Fixed bug causing the first tile to have the wrong index.

Version 1.0.1
- Changed the DNA output to match the length of that in the game's character definition.
 
Last edited:
  • 1
Reactions:
DL'ing. Good work. I will comment.

EDIT: Very nice. So it outputs a dna and props code and you put that in the char file? That sounds like a good tool to have. :cool:

Have you tried it with mods or does it only work with vanilla gfx files?
 
Last edited:
Wonderful work, I really enjoyed trying all the different looks. The to copy the dna and properties is really cool.

Used it also to check my mod's beatified portraits looks with different setups.

Thx:)
 
Last edited:
Do you mind if when I release the beta Cuman Mod this evening, I also include an optional .portset file so that it can work with your Builder?
 
I'm glad it works for you all, and you like it.

Do you mind if when I release the beta Cuman Mod this evening, I also include an optional .portset file so that it can work with your Builder?

By all means. That's why I added the ability to do that. It would have been much easier to hardcode the portrait values. One thing to note is that this program doesn't do any masking outside of the portrait circle because I was a bit lazy, so anything outside of that will still be drawn. It shows up on one of the Muslim clothes tiles.
 
Awesome. I knew you could do it!
 
This is awesome. Thanks so much!

Western Male seems to have "i" set as the zero value for Beards when it should actually be "h".

Does the eye color setting actually do anything in-game? I thought that was rolled into and determined by hair color.
 
DNA strings generated by this program are causing my save games containing them to crash on load. After some investigation, I noticed that the strings generated by the program (for Western Males, at least) are one character shorter than the DNA strings evident in the game's history files -- I seem to have solved the problem by tacking a zero on the end of the string. (I don't know what that character is supposed to do.)
 
DNA strings generated by this program are causing my save games containing them to crash on load. After some investigation, I noticed that the strings generated by the program (for Western Males, at least) are one character shorter than the DNA strings evident in the game's history files -- I seem to have solved the problem by tacking a zero on the end of the string. (I don't know what that character is supposed to do.)

That's strange, I haven't had any crashes when using the output of the program. I also hadn't noticed that the strings in the save games were 11 characters, either. It must have changed in a recent patch. I've uploaded a new version that sticks a 0 on the end of the DNA string, which should stop this crashing.
 
I want to know why I get the black one in game instead of the blond one I designed with your tool... I added a 0 at the end of the DNA to make it an 11 string sequence - is that because of it?

"0" makes slot random.

And about hair colors... I saw it, when I loaded up last created DNA. Something is wrong with it.
 
The problem with the hair colour was the same as the same as the beard problem Grandmasta mentioned, and only effected the first item on the list, probably why I didn't catch it. The new version fixing that bug is in the OP.

You should know, however, that the game will override the properties sometimes. Here's an example, showing Harold I, and his brother Sveyn where both were given the same DNA and Property codes (Harold is middle aged, while Sveyn is young here):

portraitbuilderoverride.jpg


As you can see Harold has hair, different clothes, headwear, and background. Meanwhile, Sveyn's portrait is the same as it is in the builder. The game hasn't changed anything
 
Wish I had this tool when I started working on my mod. :(

And on randomization: the game is like that... it decides it wants to randomize some characters in some fashion and there's nothing you can do about it, no matter what dna you specify. I can see this easily with my mod... there's a few characters that refuse to display according to their assigned dna.
 
The problem with the hair colour was the same as the same as the beard problem Grandmasta mentioned, and only effected the first item on the list, probably why I didn't catch it. The new version fixing that bug is in the OP.

So, when will you add new version? My polish character with brown hair in game still gets blond in your builder...
 
Last edited:
So, when will you add new version? My polish character with brown hair in game still gets blond in your builder...

I'm afraid I can't reproduce it here, version 1.0.2 is outputting the hair colours correctly. The only thing I can think of that would cause a problem is if you're using a mod that changes the portrait.gfx file.
 
Wish I had this tool when I started working on my mod. :(

And on randomization: the game is like that... it decides it wants to randomize some characters in some fashion and there's nothing you can do about it, no matter what dna you specify. I can see this easily with my mod... there's a few characters that refuse to display according to their assigned dna.

The King of England cannot go around like a bald friar, Shaytana! :D Rank trumps everything as far as I can tell, but you have more experience with portrait modding.