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

guillotine

Private
25 Badges
Sep 23, 2017
23
0
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings III
  • Imperator: Rome
  • Crusader Kings II: Holy Fury
  • Surviving Mars: Digital Deluxe Edition
  • Surviving Mars
  • Crusader Kings Complete
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Magicka 2
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Magicka
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
Hi everyone,

I just started making my first mod for personal use based on a fictional universe of my own. I have questions about cultures and breeding. I'll explain some of my cultures to make my questions clearer; three of them are Claedran, Arboran, and Satoban, and each have different looks with the former being blonde-haired, blue-eyed; Arborans have brown hair and eyes; then Satobans being black-haired with grey eyes. I think I have colour modifications down when it comes to hair and eyes only, i'm not sure what to do about mixed-race children. I want children to have mix-and-match features from their parents, ie. a blonde Claedran with brown eyes from an Arboran parent or a brown haired, grey-eyed kid.

So, I figure I can just add every possible eye colour to each culture gfx group so that someone with an Arboran ethnicity could could have any colour eyes, then just code the DNA for all major families to make sure they have the correct colour eyes for their ethnicity. If i did this, however, wouldn't lowborn characters randomly spawn with eye colours that are incorrect for their region? How can I make the randomly generated characters also stick with the traits i want them to have if the culture can possibly have any eye/hair colour? Also, how do random characters such as lowborns get generated when i load up the game? I don't have to code all of them in the character notepad file, do i? Does anyone have any suggestions as to how i can get what i want here? Any help is greatly appreciated, and i'm sorry if this has been asked before.

Thank you!!
 

Toa Kraka

Dislikes you
67 Badges
Dec 25, 2011
1.810
1.226
  • Crusader Kings II
  • Europa Universalis III
  • Europa Universalis IV
  • Victoria 2
  • Teleglitch: Die More Edition
I want children to have mix-and-match features from their parents. Does anyone have any suggestions as to how i can get what i want here?
1. Instead of assigning several hair/eye color combinations to each graphical culture, make each combination of hair color and eye color into its own graphical culture. (You also will need to make some "dummy" cultures that don't correspond to pure cultures--e.g., blond_hair_brown_eyes_dummy_culture for blonde_hair_brown_eyes_gfx--since the set_graphical_culture command points to cultures, not to graphical cultures.)
2. Use on_birth events with the real_father/mother_even_if_dead scopes, the graphical_culture condition, and the set_graphical_culture command to mix and match features based on the features of the parent. For example, for the child of a pure Claedran and a pure Arboran, the odds could be 25% for claedran_gfx, 25% for blonde_hair_brown_eyes_gfx, 25% for brown_hair_blue_eyes_gfx, and 25% for arboran_gfx. (This also allows you to write events that check the child's graphical culture against its parents' graphical cultures. For example, if a Claedran and an Arboran have a child with brown hair and gray eyes, then the mother must have cheated with a Satoban! The child receives the Bastard trait and is disowned by its nominal father (set_father = 0 and dynasty = father_bastard) immediately after birth.)
 

guillotine

Private
25 Badges
Sep 23, 2017
23
0
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings III
  • Imperator: Rome
  • Crusader Kings II: Holy Fury
  • Surviving Mars: Digital Deluxe Edition
  • Surviving Mars
  • Crusader Kings Complete
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Magicka 2
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Magicka
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
1. Instead of assigning several hair/eye color combinations to each graphical culture, make each combination of hair color and eye color into its own graphical culture. (You also will need to make some "dummy" cultures that don't correspond to pure cultures--e.g., blond_hair_brown_eyes_dummy_culture for blonde_hair_brown_eyes_gfx--since the set_graphical_culture command points to cultures, not to graphical cultures.)
2. Use on_birth events with the real_father/mother_even_if_dead scopes, the graphical_culture condition, and the set_graphical_culture command to mix and match features based on the features of the parent. For example, for the child of a pure Claedran and a pure Arboran, the odds could be 25% for claedran_gfx, 25% for blonde_hair_brown_eyes_gfx, 25% for brown_hair_blue_eyes_gfx, and 25% for arboran_gfx. (This also allows you to write events that check the child's graphical culture against its parents' graphical cultures. For example, if a Claedran and an Arboran have a child with brown hair and gray eyes, then the mother must have cheated with a Satoban! The child receives the Bastard trait and is disowned by its nominal father (set_father = 0 and dynasty = father_bastard) immediately after birth.)

Hi,
Thanks for the response, it was terribly helpful, I just have a couple more questions if you don't mind?
1) Where precisely do i find the on_birth events and what would be an example line I would type in? I think i found the events document where I might add on_birth events but I'm not sure what I would type or where if I wanted to make a child inherit one of the four graphical types.
2) Do you happen to know if it's possible for me to put the hair files for, say, muslim cultures in a graphical culture with western skin tones/faces? And if so, would I be able to assign them western hair colours? Or, could I make all hairstyles available to all of my custom ethnicities/graphical cultures by putting all the graphics on one file (ex. western_female_hair_1.dds)?

Thank you!
PS. it's super strange to see people that aren't me talking about Arborans and Claedrans, haha
 

Toa Kraka

Dislikes you
67 Badges
Dec 25, 2011
1.810
1.226
  • Crusader Kings II
  • Europa Universalis III
  • Europa Universalis IV
  • Victoria 2
  • Teleglitch: Die More Edition
1) Where precisely do i find the on_birth events and what would be an example line I would type in? I think i found the events document where I might add on_birth events but I'm not sure what I would type or where if I wanted to make a child inherit one of the four graphical types.
1. In your mod, create an empty file called, e.g., guillotinemod/common/on_actions/guillotinemod.txt.
2. In that file, create a section:
Code:
on_birth = {
  events = {
    guillotinemod.1
  }
}
3. Create another empty file called, e.g., guillotinemod/events/guillotinemod.txt.
4. In that file:
Code:
namespace = guillotinemod # Don't forget this line!
character_event = {
  id = guillotinemod.1
  # Other stuff goes here
  is_triggered_only = yes # on_birth
  # Other stuff goes here
}
# Other events go here

Use the relevant wiki page for more-detailed guidance on creating events in general and on_birth events in particular.
2) Do you happen to know if it's possible for me to put the hair files for, say, muslim cultures in a graphical culture with western skin tones/faces? And if so, would I be able to assign them western hair colours? Or, could I make all hairstyles available to all of my custom ethnicities/graphical cultures by putting all the graphics on one file (ex. western_female_hair_1.dds)?
I'm not even remotely acquainted with culture-graphics modding--I was just extrapolating from the description that you gave in your first post. You'll have to wait for someone more knowledgeable to reply, or just use the relevant wiki page.
 

Korbah

Ratel
137 Badges
Mar 3, 2011
4.758
1.272
  • Europa Universalis IV
  • Crusader Kings II: Holy Knight (pre-order)
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Campus
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Victoria 3 Sign Up
  • Hearts of Iron IV: No Step Back
To add muslim hair to other graphical cultures is fairly easy, simply find the "hair" lines in the portraits.gfx files and replace them with the matching muslim ones. That's all the change necessary. The hairs will use whatever colours you enter into the colour blocks for that culture in the same file.

Adding on to the above advice, I've written a snippet of script for you to change graphical culture.
Code:
namespace = guillotinemod # Don't forget this line!
character_event = {
    id = guillotinemod.1
    hide_window = yes
  
    is_triggered_only = yes
  
    immediate = {
        random_list = {
            50 = {
                if = {
                    limit = {
                        real_father = { graphical_culture = satobangfx }
                    }
                    set_graphical_culture = satobangfx
                }
            }
            50 = {
                if = {
                    limit = {
                        mother_even_if_dead = { graphical_culture = satobangfx }
                    }
                    set_graphical_culture = satobangfx
                }
            }
        }
    }
}
I haven't checked that in game but my custom editor language isn't reporting any issues with it so it should work. Obviously you'd need to change the satobangfx to the correct graphical culture.
So to break down that script

namespace allows you to define event ids without causing conflicts with vanilla or other modifications. CK2 will automatically assign a range to that namespace, nothing else will use that same range of ids.
id is of course the event's "name"
hide_window will prevent anyone actually seeing the event, it will run silently in the background. Since on_birth fires on the child and new borns aren't playable, there's no sense having it be visible. That would just mean you'd need additional lines or the parser bitches at you (it makes your error log a bit longer than it has to be).
is_triggered_only prevents the event from firing unless called (which it will be from the on_birth action)
immediate will fire the effects of the event as soon as it occurs, so no interaction necessary.
I've placed your character culture inheritance into a random list, that currently has a 50/50 chance of giving the newborn the gfx from the mother or father so long as the mother or father already have that graphical culture.

That's basically all there is to it really.

One caveat with my quick example is that it may fail if there is no real father. For that you can include an if statement with having a real father as a condition for example but I'll leave solving that one to you. The CK2 Wiki is a really awesome resource to learn modding from.
 

guillotine

Private
25 Badges
Sep 23, 2017
23
0
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings III
  • Imperator: Rome
  • Crusader Kings II: Holy Fury
  • Surviving Mars: Digital Deluxe Edition
  • Surviving Mars
  • Crusader Kings Complete
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Magicka 2
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Magicka
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
Hi guys!
I managed to incorporate muslim hair and ended up combining western and muslim hair so i can have all the choices. So that's great, the edges of the hair got kinda fucked and are now too opaque, but it's worth it overall. Finally getting to the point where i can make the mixed-ethnicity cultures but where exactly are these defined? mod>gfx>characters? or is it in

portraitType = {
name = "PORTRAIT_northmangfx_male"
effectFile = "gfx/FX/portrait.lua"

would it be this name here that gets changed? i feel like no because it's male/female specific.