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

Grand Admiral Edward

Colonel
17 Badges
Sep 5, 2020
811
611
  • Crusader Kings II: Sword of Islam
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • 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
  • Crusader Kings II: Charlemagne
I posted this over in the users mod forum (and a complaint about this a couple of months ago), but didn't get a response, so I'm going to try here. I want to create a mod that does a few things, but have no idea where the right files are. The mod I want to create adds +100 points (or however marriage is weighted) to marrying close family in your religion has the Divine Marriage Tenet. I also want to make Incestuous trait show up, even if incest is accepted. Not only that, Incestuous should be a Virtue if the religion has Divine Marriage.
 

Grand Admiral Edward

Colonel
17 Badges
Sep 5, 2020
811
611
  • Crusader Kings II: Sword of Islam
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • 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
  • Crusader Kings II: Charlemagne
Actually, adding Incestuous as a virtue to Divine Marriage I've figured out. It's just where are the files that show how marriage is weighted, so I can add a preference (if not outright demand) for characters to marry close family.
But I was missing a step in my first post. How do I make Incestuous be given if the Marriage Doctrine is Unrestricted Marriage? That would help, if Incesstuous is a virtue and accepted by my faith, to be able to actually GET it.
 
Last edited:

Grand Admiral Edward

Colonel
17 Badges
Sep 5, 2020
811
611
  • Crusader Kings II: Sword of Islam
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • 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
  • Crusader Kings II: Charlemagne
Can anyone help me, please? I just want to be able to make it so people marry their children, parents, and/or siblings. That could also be used for even more good by making the AI choose marriages for traits, alliances, claims, or inheritances...
 

brainiac1530

Captain
Dec 21, 2013
378
714
Marriage acceptance uses a scripted_modifier defined in common\scripted_modifiers\00_marriage_scripted_modifiers.txt. You'll want to add a modifier with a trigger like the below. Since the tenet already (necessarily) requires the unrestricted consanguinity doctrine, there's no need to check for that separately.

Code:
scope:secondary_recipient = {
    faith = { has_doctrine = tenet_divine_marriage }
    is_close_family_of = scope:secondary_actor
}
Since, in practice, all of the up to four characters involved could have different faiths, it's not entirely clear whose faith should be checked. For some reason, the game uses only the recipient's faith. To an extent this makes sense, since this is who's assessing the offer. You could try and be consistent with that or try and come up with your own criteria.

Normally, the incestuous trait will never be earned with the Unrestricted Marriage doctrine. If you want Divine Marriages to earn it, the fastest way would be to modify either the marriage interaction itself common\character_interactions\00_marriage_interactions.txt or the scripted effect marriage_interaction_on_accept_effect it uses (common\scripted_effects\00_marriage_interaction_effects.txt)

If you do choose to modify the marriage interaction directly, you can add a modifier directly into that block and thus change one less file.
 

Grand Admiral Edward

Colonel
17 Badges
Sep 5, 2020
811
611
  • Crusader Kings II: Sword of Islam
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • 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
  • Crusader Kings II: Charlemagne
Anyone mind checking my code to see if it works?
For the marriage acceptance, I put it under faith.
#########
# FAITH #
#########
modifier = { # A recipient will want to marry close family members
scope:secondary_recipient = {
faith = { has_doctrine = tenet_divine_marriage }
is_close_family_of = scope:secondary_actor
}
}
For adding incestuous, I put it under Management Script For Various Events/Contenr
###MANAGEMENT SCRIPT FOR VARIOUS EVENTS/CONTENT###

#If your marrying a close family member, give incestuous trait
if = {
limit = {
is_close_family_of = scope:secondary_actor
}
scope:actor = { player_heir = scope:secondary_actor }
}
scope:primary_actor = {
add_trait = incestuous
}
scope:secondary_actor = {
add_trait = incestuous
}
}
 

brainiac1530

Captain
Dec 21, 2013
378
714
Your modifier lacks a modifier. The trigger will probably work, but it needs to add something to acceptance. Just add a line like
add = 50. It's probably a good idea to add a description too. Have a look around in the localization files to see what it should look like, or you could reuse desc = MARRY_CONSANGUINITY_REASON, since the original modifier and this one can never coexist. I don't think I've ever seen that tooltip in game, so I don't know exactly what it says.

For adding the incestuous trait, keep in mind that in the marriage/betrothal interactions, the secondary_actor and secondary_recipient are the ones actually getting married/betrothed. In some cases, they may well be the same person as the actor and recipient, but there's no guarantee they will be. There is no primary_actor scope in this interaction, it's just called actor.
 

Grand Admiral Edward

Colonel
17 Badges
Sep 5, 2020
811
611
  • Crusader Kings II: Sword of Islam
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • 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
  • Crusader Kings II: Charlemagne
Your modifier lacks a modifier. The trigger will probably work, but it needs to add something to acceptance. Just add a line like
add = 50. It's probably a good idea to add a description too. Have a look around in the localization files to see what it should look like, or you could reuse desc = MARRY_CONSANGUINITY_REASON, since the original modifier and this one can never coexist. I don't think I've ever seen that tooltip in game, so I don't know exactly what it says.
So, like this? I actually don't do that much modding (mainly just changing numbers (when I have, at best, the game ignores whatever I put. Worst, it just crashes when I start it). Need to make sure I have enough brackets (or not too many) and that they are in the right place.
#########
# FAITH #
#########
modifier = { # A recipient will want to marry close family members
scope:secondary_recipient = {
faith = { has_doctrine = tenet_divine_marriage }
is_close_family_of = scope:secondary_actor
}
add = {
value = 1000
}

desc = MARRY_CONSANGUINITY_REASON

}
Maybe I should even add a line like:
scope:secondary_recipient = {
faith = { has_doctrine = tenet_divine_marriage }
is_not_close_family_of = scope:secondary_actor
}
add = {
value = -2000
}
For adding the incestuous trait, keep in mind that in the marriage/betrothal interactions, the secondary_actor and secondary_recipient are the ones actually getting married/betrothed. In some cases, they may well be the same person as the actor and recipient, but there's no guarantee they will be. There is no primary_actor scope in this interaction, it's just called actor.
The reason I put primary_actor is so it would grant it to the person making the marriage/betrothal, since both members of the marriage should be getting it. I changed the primary_actor to just actor. Basically, what I want it to do is the father is the liege and betroths his son to his daughter, both the son and daughter get incestuous. And if the landed son offers to marry his landed sister, again both should get the incestuous trait. Likewise, if a father marries his daughter, again, both should get the incestuous trait. About the only thing that's not really necessary (because the father should have it ANYWAY) is if he offers a marriage between his son and daughter, he shouldn't get the incestuous trait (although you could argue since he arranged the incestuous pairing, then he should get it as well, but that's going a bit too far, even for me.
 

Grand Admiral Edward

Colonel
17 Badges
Sep 5, 2020
811
611
  • Crusader Kings II: Sword of Islam
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • 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
  • Crusader Kings II: Charlemagne
Here's the updated code, fully fleshed out (and using the right tag this time)
Code:
    #########
    # FAITH #
    #########
    modifier = { # A recipient will want to marry close family members
        scope:secondary_recipient = {
                faith = { has_doctrine = tenet_divine_marriage }
                is_close_family_of = scope:secondary_actor
        }
        add = {
            value = 1000
        }
        scope:recipient.faith = {
            faith_hostility_level = {
                target = scope:actor.faith
                value > faith_fully_accepted_level
            }
        }
        add = {
            value = -10
            if = {
                limit = {
                scope:secondary_recipient = {
                            faith = { has_doctrine = tenet_divine_marriage }
                            is_not_close_family_of = scope:secondary_actor
        }
        add = {
            value = -2000
        }
                        }
                    }
                }
                subtract = -2000
            }
      
        desc = MARRY_CONSANGUINITY_REASON

    }
For the Incestuous trait, here's the slightly updated code.
Code:
    #If your marrying a close family member, give incestuous trait
    if = {
        limit = {
            is_close_family_of = scope:secondary_actor
            }
            scope:actor = { player_heir = scope:secondary_actor }
        }
        scope:actor = {
            add_trait = incestuous
        }
        scope:secondary_actor = {
            add_trait = incestuous
        }
    }
Should I delete the scope:actor = { player_heir = scope:secondary_actor } part of the code, since I want it to apply to any close family members, and not hust the player heir?
 

Grand Admiral Edward

Colonel
17 Badges
Sep 5, 2020
811
611
  • Crusader Kings II: Sword of Islam
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • 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
  • Crusader Kings II: Charlemagne
Ok, it's still not working. First, I had too many brackets (and had some of the code I had copied and pasted in my code), so marriages would not be accepted at all. Now, it's like my code doesn't even exist. Can someone PLEASE help me get this right?

Code:
    #########
    # FAITH #
    #########
    modifier = { # A recipient will want to marry close family members
        scope:recipient = {
                faith = has_doctrine = tenet_divine_marriage
                is_close_family_of = scope:actor
        }
        add = {
            value = -10
            if = {
                limit = {
                    scope:recipient = {
                            faith = has_doctrine = tenet_divine_marriage
                            is_not_close_family_of = scope:actor
                        }
                    }
                }
                subtract = 2000
            }
        desc = MARRY_CONSANGUINITY_REASON
    }
The Scope:recipient should be the person receiving the offer from the scope:actor, right? So if the recipient isn't a close family member of the actor, there should be -2000 to the marriage.
And also to make sure that it works against courtiers (which it doesn't), I added the target to my court and married him. I got the Incestuous trait, despite him not being a close family member. Then I tried with my half brother, and I got the incestuous trait, but my half brother did not. In all attempts, the sister was landed and doing it herself. When the mother tried to marry her sister/daughter to her son/nephew, the son/nephew got the trait, but the sister/daughter didn't.
Here's the code for to give Incestuous on what's supposed to be familial marriages, but to no surprise, it doesn't work either.
Code:
    ###MANAGEMENT SCRIPT FOR VARIOUS EVENTS/CONTENT###
    
    #If your marrying a close family member, give incestuous trait
    if = {
        limit = {
            is_close_family_of = scope:secondary_actor
            }
            scope:actor = { player_heir = scope:secondary_actor }
        }
        scope:actor = {
            add_trait = incestuous
        }
        scope:secondary_actor = {
            add_trait = incestuous
        }
    }