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

Lordinquisitor

Sergeant
35 Badges
May 31, 2015
77
610
  • Stellaris: Ancient Relics
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Stellaris: Megacorp
  • Europa Universalis IV: Golden Century
  • Stellaris: Synthetic Dawn
  • Age of Wonders: Planetfall
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV
  • Stellaris
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
Yeah, I myself was just about to edit my post to say that it was root. I misread the trigger as "is_heir" instead of "is_heir_of". I think it must be root, as root is the ai arranging the marriage. And that is what seems logical.
Also would mean that an heiress in a foreign court still could be marriaged away as long as the ruler isn't closely related to her, which I think is fine.

What I have atm is the following. After having looked at it then I think that Tsadiq's suggestion is sound, since it should prevent patri becoming rare and make sure that matri only happens for female rulers and heiresses. Though is gonna need testing, of course.

Code:
ai_wants_matrilineal_marriage = {
    OR = {
        scope:secondary_actor = {
            is_female = yes
            OR = {
                 is_ruler = yes
                 is_heir_of = root
            }
        }
        AND = {
            scope:secondary_actor = {
                is_female = yes
            }
            OR = {
                has_realm_law = female_only_law
                has_realm_law = female_preference_law
                faith = {
                    has_doctrine_parameter = female_dominated_law
                }
            }
        }
    }
}


Just wanted to point out, that this doesn´t work as intended. An unmarried female ruler will enter a normal, e.g. patrilineal marriage.

So far your initial solution works best; With female rulers arranging matrilineal marriages and rulers in general arranging matrilineal marriages for daughters who are first or second in the line of inheritance.
 

MediocreDoctor

Private
15 Badges
Sep 21, 2020
15
28
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Crusader Kings III
Where do you see that from the comments? I at least can't find anywhere in the code comments where it states who the actor is.

The way I read it then this code block only applies whenever the one being proposed is female. I..e whenever a ruler decides to ask somebody if they want to marry x, where x can be the ruler itself.
There also is that spouse_score_linearity thing which is -500, but I don't know if that applies to the AI too or only the player.

How else do you read it?

There's no point in checking if the secondary_actor is a woman if the secondary_actor in a marriage proposal is always a woman. It follows that both actor and secondary_actor can be either male or female, depending on circumstances.

The comment states that the secondary_actor is the character to be married. I conclude that the actor is the one doing the proposing (to marry the secondary_actor). Who else would be the actor?

Regardless, I assume the actor is the one who fires the ai_wants_matrilineal_marriage code.

So, if I'm reading the code right, the actor checks if the recipient of the proposal (secondary_actor) is female. If she is, and there's female preference/dominance laws, the actor (here the prospective husband) will want a matrilineal marriage.

However, if the actor is female, the recipient (secondary_actor) will be male, the check will return false, and the actor (here the prospective wife) will not want a matrilineal marriage.

This is my reasoning, but I am very open to the possibility that I am misunderstanding the (rather poorly documented) code, especially since my I feel that if my interpretation is correct, there's something really strange going on.
 
  • 1
Reactions:

Ninking

Colonel
55 Badges
Apr 9, 2012
807
1.986
  • Crusader Kings II: Charlemagne
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Pre-order
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Semper Fi
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • 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
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Monks and Mystics
  • Steel Division: Normandy 44
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Steel Division: Normand 44 - Second Wave
  • Europa Universalis IV: Cradle of Civilization
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Stellaris
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Imperator: Rome Sign Up
  • 500k Club
  • Victoria 2
  • Europa Universalis IV
  • Europa Universalis IV: Third Rome
Could someone make a mini mod with the relevant file and put it on https://mods.paradoxplaza.com/ , please? Or simply copy-paste the whole content of this file and tell me what folder it's supposed to be in?

I'm on the stupid Xbox game pass version and am forbidden to access the game files, and need to steal the commons folder from my friend before I can do any own modding :mad:
 
  • 1Like
Reactions:

MediocreDoctor

Private
15 Badges
Sep 21, 2020
15
28
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Crusader Kings III
Could someone make a mini mod with the relevant file and put it on https://mods.paradoxplaza.com/ , please? Or simply copy-paste the whole content of this file and tell me what folder it's supposed to be in?

I'm on the stupid Xbox game pass version and am forbidden to access the game files, and need to steal the commons folder from my friend before I can do any own modding :mad:

Code:
# Will AI for this character try to arrange matrilineal marriages?
# Note that the AI can still arrange patrilineal marriages based on the SPOUSE_SCORE_LINEALITY_MISMATCH_SCORE AI define
# root: the arranging AI character
# scope:secondary_actor: the character to be married
ai_wants_matrilineal_marriage = {
    scope:secondary_actor = {
        is_female = yes
    }
    OR = {
        has_realm_law = female_only_law
        has_realm_law = female_preference_law
        faith = {
            has_doctrine_parameter = female_dominated_law
        }
    }
}

These are the last lines from 00_rules.txt, found in game/common/scripted_rules

Unchanged. I'm still trying to figure out what to change it to.
 

DaJay42

First Lieutenant
56 Badges
Jan 31, 2018
253
661
  • Magicka 2
  • Majesty 2 Collection
  • Pillars of Eternity
  • Imperator: Rome
  • Crusader Kings II
  • Crusader Kings III
  • Europa Universalis IV
  • Victoria 2
  • Surviving Mars
  • Age of Wonders III
  • Hearts of Iron III
  • Cities in Motion 2
  • Cities: Skylines
  • Shadowrun Returns
  • Stellaris
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Common Sense
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Stellaris: Distant Stars
  • Stellaris: Federations
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Ancient Relics
  • Stellaris: Nemesis
How else do you read it?

There's no point in checking if the secondary_actor is a woman if the secondary_actor in a marriage proposal is always a woman. It follows that both actor and secondary_actor can be either male or female, depending on circumstances.

The comment states that the secondary_actor is the character to be married. I conclude that the actor is the one doing the proposing (to marry the secondary_actor). Who else would be the actor?

Regardless, I assume the actor is the one who fires the ai_wants_matrilineal_marriage code.

So, if I'm reading the code right, the actor checks if the recipient of the proposal (secondary_actor) is female. If she is, and there's female preference/dominance laws, the actor (here the prospective husband) will want a matrilineal marriage.

However, if the actor is female, the recipient (secondary_actor) will be male, the check will return false, and the actor (here the prospective wife) will not want a matrilineal marriage.

This is my reasoning, but I am very open to the possibility that I am misunderstanding the (rather poorly documented) code, especially since my I feel that if my interpretation is correct, there's something really strange going on.

As far as I can see, in 'ai_wants_matrilineal_marriage', there is no 'actor'. There is only 'root', who is the character arranging the marriage; if 'secondary_actor' is a courtier, that's their liege, otherwise (if a ruler or wanderer) it's the character themselves.

The prospective other party in the marriage doesn't actually appear in this part of the script. It is only in 'marriage_ai_accept_modifier' that they are considered.
 
  • 1
Reactions:

MediocreDoctor

Private
15 Badges
Sep 21, 2020
15
28
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Crusader Kings III
How else do you read it?

There's no point in checking if the secondary_actor is a woman if the secondary_actor in a marriage proposal is always a woman. It follows that both actor and secondary_actor can be either male or female, depending on circumstances.

The comment states that the secondary_actor is the character to be married. I conclude that the actor is the one doing the proposing (to marry the secondary_actor). Who else would be the actor?

Regardless, I assume the actor is the one who fires the ai_wants_matrilineal_marriage code.

So, if I'm reading the code right, the actor checks if the recipient of the proposal (secondary_actor) is female. If she is, and there's female preference/dominance laws, the actor (here the prospective husband) will want a matrilineal marriage.

However, if the actor is female, the recipient (secondary_actor) will be male, the check will return false, and the actor (here the prospective wife) will not want a matrilineal marriage.

This is my reasoning, but I am very open to the possibility that I am misunderstanding the (rather poorly documented) code, especially since my I feel that if my interpretation is correct, there's something really strange going on.

I've re-read the comment to the original code, and I think I was misunderstanding the code.

Here's my new, hopefully correct and certainly more logical, understanding:

Actor, or root, is the one arranging the marriage (i.e., an AI ruler). That ruler is proposing that secondary_actor gets married (to someone who's not mentioned in the code). (I was previously thinking of the marriage in terms of modern marriages, not arranged marriages which of course is what's happening in CK3.)

So the AI ruler want to marry off someone (which presumably could be themselves), checks to see if the person to be married off is female and that there are female preference/dominance laws, and if so proposes a matrilineal marriage.

The recipient of the proposal may or may not accept, but that's not controlled by this bit of code. (SPOUSE_SCORE_LINEALITY_MISMATCH_SCORE presumably comes into play here.)

If I'm correct, this means that my proposal to check relative status of prospective husband and wife (in the case of equality laws) won't work, unless there's some code to check the gender of the other party. I'll have to dig in some other code, I think.
 

MediocreDoctor

Private
15 Badges
Sep 21, 2020
15
28
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Crusader Kings III
As far as I can see, in 'ai_wants_matrilineal_marriage', there is no 'actor'. There is only 'root', who is the character arranging the marriage; if 'secondary_actor' is a courtier, that's their liege, otherwise (if a ruler or wanderer) it's the character themselves.

The prospective other party in the marriage doesn't actually appear in this part of the script. It is only in 'marriage_ai_accept_modifier' that they are considered.

I belive you are correct. I was typing up my (revised) conclusion when you posted and didn't notice your comment :)
 

MediocreDoctor

Private
15 Badges
Sep 21, 2020
15
28
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Crusader Kings III
root (probably synonymous with actor) proposes to recipient that secondary_actor gets married to secondary_recipient. (From _character_interactions.info)

So new code suggestion.

If there are female preference/dominant rules, and the AI is trying to marry off a woman, the AI will want a matri marriage.
If there are equality laws, and the AI is trying to marry off a woman, and the woman is of higher ruler tier or from a cooler dynasty, the AI will also want matri marriage (ties favor women; random is probably also fair but I don't want to clutter the code (i.e., I don't know how)).

I have not checked it, and it should probably also take into consideration if the woman (or man) is in line to inherit something nice (like som fancy silverware, or France).

Code:
# Will AI for this character try to arrange matrilineal marriages?
# Note that the AI can still arrange patrilineal marriages based on the SPOUSE_SCORE_LINEALITY_MISMATCH_SCORE AI define
# root: the arranging AI character
# scope:secondary_actor: the character to be married
ai_wants_matrilineal_marriage = {
    scope:secondary_actor = {
        is_female = yes
    }
    scope:secondary_actor = {
        set_variable = {
            name = wife  # We already checked that secondary_actor is female
            value = scope:secondary_actor
        }
    }
    scope:secondary_recipient = {
        set_variable = {
            name = husband  # We already checked that secondary_actor is female, so secondary_recipient must be male
            value = scope:secondary_recipient
        }
    }
    OR = {
        has_realm_law = female_only_law
        has_realm_law = female_preference_law
        faith = {
            has_doctrine_parameter = female_dominated_law
        }
        AND = {
            OR = {
                has_realm_law = equal_law
                faith = {
                    has_doctrine_parameter = gender_equal_law
                }
            }
            OR = {
                husband.highest_held_title_tier <= wife.highest_held_title_tier
                husband.dynasty_prestige_level <= wife.dynasty_prestige_level
            }
        }
    }
}
 

picmarluc

Private
69 Badges
May 18, 2014
13
33
  • Crusader Kings II
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV
  • Crusader Kings III
  • Age of Wonders: Planetfall
  • Stellaris
  • Hearts of Iron III
  • Pillars of Eternity
  • Cities: Skylines
  • Hearts of Iron IV: Cadet
  • Mount & Blade: Warband
  • Surviving Mars
  • BATTLETECH
  • Prison Architect
  • Cities in Motion 2
  • Victoria 2
  • Age of Wonders III
  • Europa Universalis IV: Wealth of Nations
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Res Publica
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris Sign-up
  • 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: Mandate of Heaven
  • BATTLETECH: Flashpoint
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • For the Motherland
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Sign Up
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Europa Universalis IV: Art of War
  • Warlock: Master of the Arcane
I think what happens is:
  1. If the AI (the actor) decides to get a character married (themself or a child) it uses the ai_wants_matrilineal_marriage to check if it needs to do an matrilineal marriage. For males thats a no, for females it depends.
  2. The actor sends then a offer to a recipient.
  3. The recipient accepts based on the marriage_ai_accept_modifier which already considers if it should make a matrilineal marriage. This is also the reason why player offers for patrilineal marriage to female heirs were getting refused.
(I think and hope for optimization reasons that the actor actually only sends out offers that would be accepted.)

So before 1.1 the AI happily married their daughters and heirs away in patrilineal marriage but if someone wanted to marry their daughter and heir patrilinealy they refused.
With 1.1 the AI also considers if it should propose a matrilineal marriage. At least this is how I understand it.

Looking in the code I actually can't find the place that makes the AI refuse patrilineal marriage offers for female heirs and I also testet this in game and could successfully offer patrilineal marriages to female heirs. So it seems the bolded parts are actually not true. Sorry for that.


This also means that it is probably not enough to change ai_wants_matrilineal_marriage as marriage_ai_accept_modifier needs to be changed as well.


Edit: I probably should not try to figure things out while I am a bit tired. There actually is a patrilineal marriage malus but it was not applied for the characters I checked as the recipient was of different dynasty then the secondary_recipient. It is just -100 though so not very high in contrast to the -1000 matrilineal malus for male heirs.
 
Last edited:

Wagonlitz

Resident WW Foreigner
103 Badges
Jul 19, 2010
8.196
5.452
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III: Chronicles
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Europa Universalis IV
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Victoria 3 Sign Up
  • Hearts of Iron III Collection
  • Europa Universalis IV: Dharma
  • Crusader Kings III: Royal Edition
  • Supreme Ruler 2020
  • Pirates of Black Cove
  • Crusader Kings Complete
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Cradle of Civilization
  • Steel Division: Normand 44 Sign-up
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Reapers Due
  • Europa Universalis: Rome
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Imperator: Rome Sign Up
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings III Referal
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Distant Stars
  • Rome Gold
  • Deus Vult
  • Europa Universalis IV: Common Sense
  • Europa Universalis III
  • Europa Universalis III Complete
  • Heir to the Throne
Just wanted to point out, that this doesn´t work as intended. An unmarried female ruler will enter a normal, e.g. patrilineal marriage.

So far your initial solution works best; With female rulers arranging matrilineal marriages and rulers in general arranging matrilineal marriages for daughters who are first or second in the line of inheritance.
Ah. Good to know.
There's no point in checking if the secondary_actor is a woman if the secondary_actor in a marriage proposal is always a woman. It follows that both actor and secondary_actor can be either male or female, depending on circumstances.
The way I understand it is that teh secondary_actor is the character to be married, i.e. the same as you, and that the root is the person setting up the marriage. Who the actor is I don't know. But given that the person setting it up already is root, then I would presume that actor is the person the marriage proposal is sent to. I..e the one who has to accept it.
 

picmarluc

Private
69 Badges
May 18, 2014
13
33
  • Crusader Kings II
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV
  • Crusader Kings III
  • Age of Wonders: Planetfall
  • Stellaris
  • Hearts of Iron III
  • Pillars of Eternity
  • Cities: Skylines
  • Hearts of Iron IV: Cadet
  • Mount & Blade: Warband
  • Surviving Mars
  • BATTLETECH
  • Prison Architect
  • Cities in Motion 2
  • Victoria 2
  • Age of Wonders III
  • Europa Universalis IV: Wealth of Nations
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Res Publica
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris Sign-up
  • 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: Mandate of Heaven
  • BATTLETECH: Flashpoint
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • For the Motherland
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Sign Up
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Europa Universalis IV: Art of War
  • Warlock: Master of the Arcane
I tested my code from the previous page and I have to admit I have no clue what is happening.:eek:
I looked at a few female rulers and female heirs and basically have seen all possibilities.
For example Duchess Matilda first married patrilinealy but after I killed her husband she married matrilinealy. So I killed more husbands and yeah most of times she married matrilinealy but sometimes patrilinealy. I did the same with some female heir with the same result. Most of the times it was a matrilineal betrothel but sometimes it was patrilineal.
There were also a few marriages/betrothal that should not have happened like one time Matilda had a matrilineal betrothal with an heir to something. The holder and father (I checked that they were actually the same) should never have agreed to such a betrothel.
 
  • 1
  • 1Like
Reactions:

ShepherdOfCats

First Lieutenant
Sep 28, 2020
275
920
wagon,

I know absolutely nothing about modding but do you suppose there would be a way to look at the files on how AI made matri-marriage decisions in Crusader Kings 2 and see if it is similar to CK3? I know it's a different engine but maybe some of the rules might be similar? Again I know nothing other than if you can figure out a way to keep the AI from committing dynasty suicide, you will be a hero.
 

Wagonlitz

Resident WW Foreigner
103 Badges
Jul 19, 2010
8.196
5.452
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III: Chronicles
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Europa Universalis IV
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Victoria 3 Sign Up
  • Hearts of Iron III Collection
  • Europa Universalis IV: Dharma
  • Crusader Kings III: Royal Edition
  • Supreme Ruler 2020
  • Pirates of Black Cove
  • Crusader Kings Complete
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Cradle of Civilization
  • Steel Division: Normand 44 Sign-up
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Reapers Due
  • Europa Universalis: Rome
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Imperator: Rome Sign Up
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings III Referal
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Distant Stars
  • Rome Gold
  • Deus Vult
  • Europa Universalis IV: Common Sense
  • Europa Universalis III
  • Europa Universalis III Complete
  • Heir to the Throne
Most of the times it was a matrilineal betrothel but sometimes it was patrilineal.
Dn't forget about the bug where matri bethrotals turn into patri bethrotals when you actually get to make the marriage, i.e. when both are of age, and it's impossible for you to click the matri button there.
So matri bethrotals should be expected to turn into patri marriages. That's somethign that needs to be accounted for when looking at whether these things work.

wagon,

I know absolutely nothing about modding but do you suppose there would be a way to look at the files on how AI made matri-marriage decisions in Crusader Kings 2 and see if it is similar to CK3? I know it's a different engine but maybe some of the rules might be similar? Again I know nothing other than if you can figure out a way to keep the AI from committing dynasty suicide, you will be a hero.
I don't know. There might be, but I'd doubt it as the jomani layer might have changed things very considerably plus the engine itself has changed a lot since 2012.
But there could be, but I doubt it.
 

ShepherdOfCats

First Lieutenant
Sep 28, 2020
275
920
Literally fixing the Dev's mess :rolleyes:

I wouldn't mind so much if they just forgot or made an error, but from their responses, they honestly don't see it as a problem. Yikes!

Looks like all my hopes are on modders at this point.
 
  • 6
Reactions:

Tatterhood

Conscientious Objector
29 Badges
Jun 9, 2016
1.569
1.470
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Jade Dragon
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Crusader Kings II
  • Stellaris: Synthetic Dawn
  • 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
  • Crusader Kings II: Charlemagne
wagon,

I know absolutely nothing about modding but do you suppose there would be a way to look at the files on how AI made matri-marriage decisions in Crusader Kings 2 and see if it is similar to CK3? I know it's a different engine but maybe some of the rules might be similar? Again I know nothing other than if you can figure out a way to keep the AI from committing dynasty suicide, you will be a hero.
In CK2 marriage decisions were 100% hardcoded iirc.
 

Wagonlitz

Resident WW Foreigner
103 Badges
Jul 19, 2010
8.196
5.452
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III: Chronicles
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Europa Universalis IV
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Victoria 3 Sign Up
  • Hearts of Iron III Collection
  • Europa Universalis IV: Dharma
  • Crusader Kings III: Royal Edition
  • Supreme Ruler 2020
  • Pirates of Black Cove
  • Crusader Kings Complete
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Cradle of Civilization
  • Steel Division: Normand 44 Sign-up
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Reapers Due
  • Europa Universalis: Rome
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Imperator: Rome Sign Up
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings III Referal
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Distant Stars
  • Rome Gold
  • Deus Vult
  • Europa Universalis IV: Common Sense
  • Europa Universalis III
  • Europa Universalis III Complete
  • Heir to the Throne
So far then my initial fix, i.e. the one from the OP, seems to be working, as I've e.g. had a duke with four daughters matri the first two and patri the last two.
 
  • 1Like
Reactions:

Monkbel

Lt. General
101 Badges
Oct 21, 2009
1.227
535
  • Crusader Kings II
  • Cities in Motion
  • Victoria 2: A House Divided
  • Majesty 2
  • Hearts of Iron III
  • BATTLETECH: Flashpoint
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Conclave
  • Stellaris: Distant Stars
  • 500k Club
  • Cities: Skylines - Parklife
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Steel Division: Normandy 44
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Imperator: Rome Sign Up
  • Shadowrun Returns
  • Stellaris: Apocalypse
  • BATTLETECH: Season pass
  • Prison Architect
  • Surviving Mars
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Cities: Skylines - Campus
  • Magicka: Wizard Wars Founder Wizard
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Dharma
  • Shadowrun: Dragonfall
  • BATTLETECH
  • Imperator: Rome
  • Victoria 2
  • Imperator: Rome Deluxe Edition
  • Warlock 2: The Exiled
  • BATTLETECH - Digital Deluxe Edition
Yeah, I myself was just about to edit my post to say that it was root. I misread the trigger as "is_heir" instead of "is_heir_of". I think it must be root, as root is the ai arranging the marriage. And that is what seems logical.
Also would mean that an heiress in a foreign court still could be marriaged away as long as the ruler isn't closely related to her, which I think is fine.

What I have atm is the following. After having looked at it then I think that Tsadiq's suggestion is sound, since it should prevent patri becoming rare and make sure that matri only happens for female rulers and heiresses. Though is gonna need testing, of course.

Code:
ai_wants_matrilineal_marriage = {
    OR = {
        scope:secondary_actor = {
            is_female = yes
            OR = {
                 is_ruler = yes
                 is_heir_of = root
            }
        }
        AND = {
            scope:secondary_actor = {
                is_female = yes
            }
            OR = {
                has_realm_law = female_only_law
                has_realm_law = female_preference_law
                faith = {
                    has_doctrine_parameter = female_dominated_law
                }
            }
        }
    }
}


Thank you @Wagonlitz - I tested your code and it seems to work, I made a mod from your code https://steamcommunity.com/sharedfiles/filedetails/?id=2243573311 so it's easier for others to use it. thanks
 
  • 2
  • 1Love
Reactions:

ShepherdOfCats

First Lieutenant
Sep 28, 2020
275
920
Gonna try this one out. Thanks.
 

Wagonlitz

Resident WW Foreigner
103 Badges
Jul 19, 2010
8.196
5.452
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis III: Chronicles
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Europa Universalis IV
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Victoria 3 Sign Up
  • Hearts of Iron III Collection
  • Europa Universalis IV: Dharma
  • Crusader Kings III: Royal Edition
  • Supreme Ruler 2020
  • Pirates of Black Cove
  • Crusader Kings Complete
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Cradle of Civilization
  • Steel Division: Normand 44 Sign-up
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Reapers Due
  • Europa Universalis: Rome
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Imperator: Rome Sign Up
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings III Referal
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Distant Stars
  • Rome Gold
  • Deus Vult
  • Europa Universalis IV: Common Sense
  • Europa Universalis III
  • Europa Universalis III Complete
  • Heir to the Throne
  • 1Love
Reactions: