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

IrishZoroastrian

Private
3 Badges
Jul 9, 2019
24
2
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
I would like to create a custom portrait property to add more random customization (forehead tattoos) to the new ethnicity I made.
There is a .dds file with 5 frames that contains all the tattoos.

From the CK2 wiki on portrait modding (Link), I understood that to create a custom property, one just needs to add the follwoing:

To the portrait definitions file:
spriteType = {
name = "GFX_tattoosF_male"
texturefile = "gfx\\characters\\Atlantian\\forehead_tattoos_male.dds"
noOfFrames = 5
norefcount = yes
}


To the interface\portrait_properties\custom_properties.txt:

50 = { #New property number
0 = {
factor = 20
}
1 = {
factor = 20
}
2 = {
factor = 20
}
3 = {
factor = 20
}
4 = {
factor = 20
}

}
Where factor is a random chance a particular frame of a tattoo gets assigned to the character's portrait permanently.

Did everything exactly this way, yet only the 1st frame ever shows up. Sometimes, no frames show up, or tattoos switch at random intervals for no reason. Where is the mistake?
 
The property must be the next continuous number, you can't skip to a higher number.
I've tried number 38 (next available Property number) to no avail. Same behaviour persists. The way I made it work is through following:

38 = {
0 = {
factor = 20
modifier = {
factor = 1
culture = norse
}
}
1 = {
factor = 20
modifier = {
factor = 1
culture = norse
}
}
2 = {
factor = 20
modifier = {
factor = 1
culture = norse
}
}
3 = {
factor = 20
modifier = {
factor = 1
culture = norse
}
}
4 = {
factor = 20
modifier = {
factor = 1
culture = norse
}
}

}

As long as there is a modifier to the factor, somehow It works as intended. It can be clearly seen that the property has the same 20% chance of assignment as in the original (OP post) code.