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

cometspire

Recruit
12 Badges
Feb 4, 2019
7
0
  • Cities in Motion
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Majesty 2 Collection
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Holy Fury
  • Prison Architect
  • Crusader Kings III
Is there a way to make it so that characters are only able to have children with other characters of the same culture or religion, or even better, only with certain cultures or religions?
 
Solution
In common\on_actions\00_on_actions.txt you'll find this:

Code:
on_pregnancy = {
	events = {
 		400 # Pregnancy in matrimony
 		401 # Pregnancy out of wedlock
 		402 # Pregnancy in matrimony, with another father!
 		410 # Pregnancy as consort
 		412 # Pregnancy as consort, with another father!
 		HFP.20401 # Hidden event to set clock for regency during final months.
 		HFP.20556 # Umbrella event for positive pregnancy flavor.
 	}
}

Try changing it to this, make adjustments as you see fit, and see if it works as desired.
Code:
on_pregnancy = {
	effect = {
		if = {
			limit = { 
				father_of_unborn = {
					NOT = { culture = ROOT }
				}
			}
			
			cancel_pregnancy = yes
		}
	}
	
	events = {
 		400 # Pregnancy in matrimony
 		401 #...
You can't prevent it from happening. The diplomatic marriage interaction is hardcoded. Replacing it with targeted decisions is begging for problems.
You could fire events when characters marry (look at on_actions), and divorce them if the characters involved don't match your desired requirements. How that turns out in the long term I can't say.
 
Upvote 0
I don't necessarily mind them marrying, it's specifically them being able to have kids together that I want to prevent. Is there no way of making a character infertile to other characters of different cultures/religions?
 
Upvote 0
Fertility applies to a character, not to a relationship. You could apply a fertility penalty by means of on_actions, of course. That would still leave various events that can cause impregnation.
 
Upvote 0
That on_action fires those announcement events. You could fire an effect, since those always fire before events, and/or adjust the triggers for those events, to ensure the desired outcome.
 
Upvote 0
In common\on_actions\00_on_actions.txt you'll find this:

Code:
on_pregnancy = {
	events = {
 		400 # Pregnancy in matrimony
 		401 # Pregnancy out of wedlock
 		402 # Pregnancy in matrimony, with another father!
 		410 # Pregnancy as consort
 		412 # Pregnancy as consort, with another father!
 		HFP.20401 # Hidden event to set clock for regency during final months.
 		HFP.20556 # Umbrella event for positive pregnancy flavor.
 	}
}

Try changing it to this, make adjustments as you see fit, and see if it works as desired.
Code:
on_pregnancy = {
	effect = {
		if = {
			limit = { 
				father_of_unborn = {
					NOT = { culture = ROOT }
				}
			}
			
			cancel_pregnancy = yes
		}
	}
	
	events = {
 		400 # Pregnancy in matrimony
 		401 # Pregnancy out of wedlock
 		402 # Pregnancy in matrimony, with another father!
 		410 # Pregnancy as consort
 		412 # Pregnancy as consort, with another father!
 		HFP.20401 # Hidden event to set clock for regency during final months.
 		HFP.20556 # Umbrella event for positive pregnancy flavor.
 	}
}
 
Upvote 0
Solution
More of a generic comment on game flavor. It would be great if we could get rid of the whole "feudal rulers want to marry nomad people because they are technically emperors". Probably they did that only under duress and certainly not for prestige effects...
 
Upvote 0
In common\on_actions\00_on_actions.txt you'll find this:

Code:
on_pregnancy = {
    events = {
         400 # Pregnancy in matrimony
         401 # Pregnancy out of wedlock
         402 # Pregnancy in matrimony, with another father!
         410 # Pregnancy as consort
         412 # Pregnancy as consort, with another father!
         HFP.20401 # Hidden event to set clock for regency during final months.
         HFP.20556 # Umbrella event for positive pregnancy flavor.
     }
}

Try changing it to this, make adjustments as you see fit, and see if it works as desired.
Code:
on_pregnancy = {
    effect = {
        if = {
            limit = {
                father_of_unborn = {
                    NOT = { culture = ROOT }
                }
            }
           
            cancel_pregnancy = yes
        }
    }
   
    events = {
         400 # Pregnancy in matrimony
         401 # Pregnancy out of wedlock
         402 # Pregnancy in matrimony, with another father!
         410 # Pregnancy as consort
         412 # Pregnancy as consort, with another father!
         HFP.20401 # Hidden event to set clock for regency during final months.
         HFP.20556 # Umbrella event for positive pregnancy flavor.
     }
}
I assume I should make a copy of this folder inside my mod folder structure and edit that instead of just editing the actual game files right?
 
Upvote 0
I assume I should make a copy of this folder inside my mod folder structure and edit that instead of just editing the actual game files right?
yes. on_actions merge, so just create new file containing only new content, no need to copy the existing content
 
Upvote 0
It seems to be working just as described. Using the pollinate console command I impregnated two characters, one of the same culture, and one of a different culture, and whilst the give_birth command worked on them both the day after using the pollinate command, it only worked on the character that was my culture after a couple of months had passed, whereas the other character was stated to not be pregnant when I used it on her then. Thank you so much for your help and patience!
 
Upvote 0