• 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.
A change what made to the game to force all courtiers to be generated with a dynasty if they are in the history files if I remember correctly.
You have to do effect = { dynasty = none } on their birth I believe to have the game force them to be lowborn
 
Is there a condition to compare the number of provinces or holdings (i.e. realm size) of the realms of two characters?
I'm not aware of a specific trigger you can use. Nor do I know this will work, but you could try it and tell us:

Code:
ROOT = {
  export_to_variable = { which = myrealmvar value = realm_size }
  export_to_variable = { which = hisrealmvar value = realm_size who = FROM }
}

(Assuming the 2 you want to compare are ROOT & FROM…)

Then you could use the standard variable checks to do something with them.
 
OK, here's another one from me: There is a particular minor title, unique in the whole world. (It has grant = 1, and only one sovereign is permitted to appoint it.) What is the most efficient way to check whether it currently has a holder?
Is it a specific sovereign who can give it, or just 1 who could be anybody?
 
I'm not aware of a specific trigger you can use. Nor do I know this will work, but you could try it and tell us:

Code:
ROOT = {
  export_to_variable = { which = myrealmvar value = realm_size }
  export_to_variable = { which = hisrealmvar value = realm_size who = FROM }
}

(Assuming the 2 you want to compare are ROOT & FROM…)

Then you could use the standard variable checks to do something with them.

Yeah, I did consider that, but considering I'm trying to use it in a cb it probably isn't worth the effort.
 
I want to create musical DLC, containing at least 30 songs, with approx one song per culture. Do I have to buy one music pack and replace it or I can create this kind of things from scratch?
 
I want to create musical DLC, containing at least 30 songs, with approx one song per culture. Do I have to buy one music pack and replace it or I can create this kind of things from scratch?
You can of course mod that, no need to overwrite any DLC.
Just create a mod, put a /music folder in it, and into that folder you can put all your song files in .ogg format. I'm not sure if any other formats work, but I think not!
Also, you'll have to put a .txt file there that controls when each song is played.
For a more detailed explanation, I'll direct you to the wiki: http://www.ckiiwiki.com/Music_modding

Edit: Also note that your .txt file should NOT be named like the vanilla file ("songs.txt"), as that can cause problems (no music in the main menu). Name it any other name you like, e.g. "mysongs.txt".
 
A change what made to the game to force all courtiers to be generated with a dynasty if they are in the history files if I remember correctly.
You have to do effect = { dynasty = none } on their birth I believe to have the game force them to be lowborn

For long-term cleanliness sake, if you use this method does the random dynasty get generated anyway, just that the new member gets overwritten as lowborn?

I ask because the save file would still then be burdened with unused dynasties, a pet peeve of mine when I started editing save files.
 
For long-term cleanliness sake, if you use this method does the random dynasty get generated anyway, just that the new member gets overwritten as lowborn?

I ask because the save file would still then be burdened with unused dynasties, a pet peeve of mine when I started editing save files.
Yep, however as far as I know it is the only way unless you define all your lowborns with the same dynasty then on startup overwrite that dynasty by scoping to one of them and doing any_dynasty_member_even_if_dead and making them lowborn. That should mean you only end up with one extra dynasty but not sure if that is worse for the game engine to scope to all lowborns at the start of every game.
Although it would be better to have Paradox just fix dynasty=0 not working to make people lowborn again.
 
Anybody know of some vital changes with Monks and Mystics?

I've started working back up on my own mod and I've noticed it wants to crash if I try and use ruler designer (that is, crashing at starting the actual game)
It also crashes randomly in-game if I use my historical character to play the mod. It's very bare-bones and worked fine back when I was working on it. My guess is there has been a change to religion stuff, but overall I'm ignorant as to what M&M may have implemented.
 
Where should I be looking / is it moddable on how often the AI uses hunt apostates or whatever else that may be leading them to burning spouses and close relatives at the stake?

My eyes were bleeding after looking through mnm_secret_religious_societies_decisions.txt (don't think its there) and councillor_decision.txt was surprisingly bare.

It seems to be having way too often in my game and I'd like to tone it down. I've had AI literally burn through multiple wives and I'm pretty sure I've seen them burn their sons alive!!!
 
Where should I be looking / is it moddable on how often the AI uses hunt apostates or whatever else that may be leading them to burning spouses and close relatives at the stake?

My eyes were bleeding after looking through mnm_secret_religious_societies_decisions.txt (don't think its there) and councillor_decision.txt was surprisingly bare.

It seems to be having way too often in my game and I'd like to tone it down. I've had AI literally burn through multiple wives and I'm pretty sure I've seen them burn their sons alive!!!

Probably
Code:
#Lord Spiritual finds a heretic
character_event = {
   id = 75050
   desc = "EVTDESC75050"
   picture = GFX_evt_heretic
 
   capable_only = yes
 
   is_triggered_only = yes
 
   trigger = {
       independent = no
       has_job_title = job_spiritual
       trait = zealous
       liege = {
           religion = ROOT
           NOT = {
               character = ROOT
           }
           any_courtier = {
               age = 16
               is_heresy_of = ROOT
               prisoner = no
           }
       }
   }
 
   weight_multiplier = {
       days = 1
   }
 
   immediate = {
       liege = {
           random_courtier = {
               limit = {
                   age = 16
                   is_heresy_of = ROOT
                   prisoner = no
               }
               save_event_target_as = target_heretic
           }
       }
   }
 
   option = {
       name = "EVTOPTA75050" #Demand to liege that vassal should be burned at the stake
       liege = {
           character_event = {
               id = 75051
               days = 1
               random = 2
               tooltip = "EVTTOOLTIP75051"
           }
       }
   }
   option = {
       name = "EVTOPTB75050" #Demand to liege that X should be exiled.
       liege = {
           character_event = {
               id = 75052
               days = 1
               random = 2
               tooltip = "EVTTOOLTIP75052"
           }
       }
   }
}
in job_flavour_events.txt

notepad++; use "search in files for" in CK2/events text: "stake", tada.
Disclaimer: that of course doesn't necessarily mean that its indeed the event you refer to, but i'd say it is..

Admittedly the more interesting part is probably how this event gets triggered in the first place...
The part to exclude spouses or close relatives would be in the follow-up event (75051) i suppose.

edit (18 may): also see response to me by Zaltys four posts further down
 
Last edited:
Please, help with AGOT mod...
I want Lanisters swim in gold, so I want more gold mines available.

Code:
    ###unique buildings###
    ca_goldmine = {
        desc = ca_goldmine_desc
        potential = {
            OR = {
                province_id = 174 #Golden Tooth (2)
                province_id = 175 #Nunn's Deep
                province_id = 177 #Pendrick Hills
          
                province_id = 173 #Ashemark
                province_id = 178 #Sarsfield
                province_id = 179 #Goldshire
                province_id = 180 #Hornvale
                province_id = 181 #Brent Brook
                province_id = 182 #Casterly Rock
                province_id = 187 #Castamere
          
                region = world_asshai
                duchy = { title = d_the_axe }
            }
        }
        gold_cost = 400
        build_time = 730
        tax_income = 4
        ai_creation_factor = 110
        trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
        extra_tech_building_start = 10.0 # Never get at start of game
    }
    ca_large_goldmine = {
        desc = ca_goldmine_desc
        potential = {
            FROMFROM = {
                OR = {
                    title = b_casterly_rock
                    title = b_castamere
                    title = b_axemountainscastle
                    title = b_axecastle
                }
            }
        }
        upgrades_from = ca_goldmine
        #trigger = { always = no }
        gold_cost = 400
        build_time = 160
        tax_income = 8
        ai_creation_factor = 110
    }
 
 
    ca_silvermine = {
        desc = ca_silver_desc
        potential = {
            OR = { 
                province_id = 164 #The Crag
                province_id = 170 #Maunhill
                province_id = 189 #Myatt
                province_id = 190 #Lonmont
                province_id = 195 #Silverhall
                province_id = 334 #Yronwood
            }
        }
        gold_cost = 500
        build_time = 730
        tax_income = 4
        ai_creation_factor = 110
        trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
        extra_tech_building_start = 10.0 # Never get at start of game
    }

Code:
    ###unique buildings###
    ca_goldmine = {
        desc = ca_goldmine_desc
        potential = {
            OR = {
            #    province_id = 174 #Golden Tooth (2)
            #    province_id = 175 #Nunn's Deep
            #    province_id = 177 #Pendrick Hills








          
            #    province_id = 173 #Ashemark
            #    province_id = 178 #Sarsfield
            #    province_id = 179 #Goldshire
            #    province_id = 180 #Hornvale
            #    province_id = 181 #Brent Brook
            #    province_id = 182 #Casterly Rock
            #    province_id = 187 #Castamere

                region = world_westerlands    # akchir 
                region = world_asshai
                duchy = { title = d_the_axe }
            }
        }
        gold_cost = 400
        build_time = 730
        tax_income = 4
        ai_creation_factor = 110
        trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
        extra_tech_building_start = 10.0 # Never get at start of game
    }
    ca_large_goldmine = {
        desc = ca_goldmine_desc
        potential = {
            FROMFROM = {
                OR = {
                #    title = b_casterly_rock
                #    title = b_castamere
                #    province_id = 174 #Golden Tooth (2)
                duchy = { title = d_golden_tooth }         
                province_id = 182 #Casterly Rock
                province_id = 187 #Castamere
                #    province_id = 181 #Lannisport         
                    title = b_axemountainscastle
                    title = b_axecastle
                }
            }
        }
        upgrades_from = ca_goldmine
        #trigger = { always = no }
        gold_cost = 400
        build_time = 160
        tax_income = 8
        ai_creation_factor = 110
    }
 
 
    ca_silvermine = {
        desc = ca_silver_desc
        potential = {
            OR = { 
            #    province_id = 164 #The Crag
            #    province_id = 170 #Maunhill
            #    province_id = 189 #Myatt
            #    province_id = 190 #Lonmont
            #    province_id = 195 #Silverhall
                duchy = { title = d_silverhill }
                province_id = 334 #Yronwood
            }
        }
        gold_cost = 500
        build_time = 730
        tax_income = 4
        ai_creation_factor = 110
        trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
        extra_tech_building_start = 10.0 # Never get at start of game
    }
Started new game. Result:

http://prntscr.com/f8yk3q

what I should fix?
 
Last edited:
Your problem is this:
Code:
       potential = {
           FROMFROM = {
                OR = {
                #    title = b_casterly_rock
                #    title = b_castamere
                #    province_id = 174 #Golden Tooth (2)
                duchy = { title = d_golden_tooth }       
                province_id = 182 #Casterly Rock
                province_id = 187 #Castamere
                #    province_id = 181 #Lannisport       
                    title = b_axemountainscastle
                    title = b_axecastle
                }
            }
        }
FROMFROM is the barony title. The province is the base scope. Try:
Code:
       potential = {
            OR = {
                duchy = { title = d_golden_tooth }       
                province_id = 182 #Casterly Rock
                province_id = 187 #Castamere
               FROMFROM = {
                   OR = {
                       title = b_axemountainscastle
                       title = b_axecastle
                   }
               }
            }
        }
 
Probably
Code:
#Lord Spiritual finds a heretic
character_event = {
   id = 75050
   desc = "EVTDESC75050"
   picture = GFX_evt_heretic
 
   capable_only = yes
 
   is_triggered_only = yes
 
   trigger = {
       independent = no
       has_job_title = job_spiritual
       trait = zealous
       liege = {
           religion = ROOT
           NOT = {
               character = ROOT
           }
           any_courtier = {
               age = 16
               is_heresy_of = ROOT
               prisoner = no
           }
       }
   }
 
   weight_multiplier = {
       days = 1
   }
 
   immediate = {
       liege = {
           random_courtier = {
               limit = {
                   age = 16
                   is_heresy_of = ROOT
                   prisoner = no
               }
               save_event_target_as = target_heretic
           }
       }
   }
 
   option = {
       name = "EVTOPTA75050" #Demand to liege that vassal should be burned at the stake
       liege = {
           character_event = {
               id = 75051
               days = 1
               random = 2
               tooltip = "EVTTOOLTIP75051"
           }
       }
   }
   option = {
       name = "EVTOPTB75050" #Demand to liege that X should be exiled.
       liege = {
           character_event = {
               id = 75052
               days = 1
               random = 2
               tooltip = "EVTTOOLTIP75052"
           }
       }
   }
}
in job_flavour_events.txt

notepad++; use "search in files for" in CK2/events text: "stake", tada.
Disclaimer: that of course doesn't necessarily mean that its indeed the event you refer to, but i'd say it is..

Admittedly the more interesting part is probably how this event gets triggered in the first place...
The part to exclude spouses or close relatives would be in the follow-up event (75051) i suppose.
Yep, and 75040 too.
Those are fired from early random events (on_action), and are extremely poorly designed. No check for traits or anything. A kind ruler can outright decide to burn his lover or concubine (or even primary spouse) who's pregnant with his child, or his own children. If you keep an eye of how many concubines end up burned by that event, the number is actually ridiculously high.

It's even worse now that it doesn't check for secret religions either.

One of the first things I fixed in my personal mod.
 
Last edited:
Yep, and 75040 too.
Those are fired from early random events (on_action), and are extremely poorly designed. No check for traits or anything. A kind ruler can outright decide to burn his lover or concubine (or even primary spouse) who's pregnant with his child, or his own children. If you keep an eye of how many concubines end up burned by that event, the number is actually ridiculously high.

It's even worse now that it doesn't check for secret religions either.

One of the first things I fixed in my personal mod.

Code:
#Lord Spiritual finds infidel
character_event = {
    id = 75040
    desc = "EVTDESC75040"
    picture = GFX_evt_heretic
   
    capable_only = yes
   
    is_triggered_only = yes
   
    trigger = {
        independent = no
        has_job_title = job_spiritual
        trait = zealous
        liege = {
            is_nomadic = no
            religion = ROOT
            NOT = {
                character = ROOT
            }
            any_courtier = {
                age = 16
                NOT = {
                    religion_group = ROOT
                }
                NOT = {
                    has_character_flag = banished_religion
                }
                NOT = {
                    character = ROOT
                }
                prisoner = no
                NOT = {
                    is_close_relative = ROOT
                    is_friend = ROOT
                    is_main_spouse = ROOT
                    is_consort = ROOT
                    is_lover = ROOT
                    dynasty = ROOT
                }
            }
        }
    }
   
    weight_multiplier = {
        days = 1
    }
   
    immediate = {
        liege = {
            random_courtier = {
                limit = {
                    age = 16
                    NOT = {
                        religion_group = ROOT
                    }
                    NOT = {
                        has_character_flag = banished_religion
                    }
                    NOT = {
                        character = ROOT
                    }
                    prisoner = no
                    NOT = {
                        is_close_relative = ROOT
                        is_friend = ROOT
                        is_main_spouse = ROOT
                        is_consort = ROOT
                        is_lover = ROOT
                        dynasty = ROOT
                    }
                }
                save_event_target_as = target_infidel
            }
        }
    }
   
    option = {
        name = "EVTOPTA75040" #Demand to liege that vassal should be burned at the stake
        liege = {
            character_event = {
                id = 75041
                days = 1
                random = 2
                tooltip = "EVTTOOLTIP75041"
            }
        }
    }
    option = {
        name = "EVTOPTB75040" #Demand to liege that X should be exiled.
        liege = {
            character_event = {
                id = 75042
                days = 1
                random = 2
                tooltip = "EVTTOOLTIP75042"
            }
        }
    }
}

#Liege burns infidel?
character_event = {
    id = 75041
    desc = "EVTDESC75041"
    picture = GFX_evt_heretic
   
    is_triggered_only = yes
   
    option = {
        name = "EVTOPTA75041"
        event_target:target_infidel = {
            any_courtier = {
                limit = {
                    religion = PREV
                    prisoner = no
                    NOT = {
                        character = ROOT
                    }
                    NOT = {
                        character = PREV
                    }               
                }
                opinion = {
                    modifier = opinion_burned_same_faith
                    who = ROOT
                    years = 5
                }
            }
            death = {
                death_reason = death_execution_burning
                killer = ROOT
            }
        }
        FROM = {
            opinion = {
                modifier = opinion_satisfied
                who = ROOT
                years = 2
            }
            hidden_tooltip = {
                character_event = {
                    id = 75043
                    days = 1
                    random = 2
                }
            }
        }
        ai_chance = { 
            factor = 50 
            modifier = {
                factor = 0
                OR = {
                    is_close_relative = ROOT
                    is_friend = ROOT
                    is_main_spouse = ROOT
                    is_consort = ROOT
                    is_lover = ROOT
                }
            }
            modifier = { factor = 0.25 dynasty = ROOT }
            modifier = { factor = 10 is_rival = ROOT }
            modifier = { 
                factor = 0.1
                OR = {
                    AND = {
                        event_target:target_heretic = { religion_group = christian }
                        trait = sympathy_christendom
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = muslim }
                        trait = sympathy_islam
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = pagan_group }
                        trait = sympathy_pagans
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = zoroastrian_group }
                        trait = sympathy_zoroastrianism
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = jewish_group }
                        trait = sympathy_judaism
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = indian_group }
                        trait = sympathy_indian
                    }
                }
            }
            modifier = { factor = 0.5 trait = cynical }
            modifier = { factor = 0.5 trait = just }
            modifier = { factor = 0.2 trait = trusting }
            modifier = { factor = 0.2 trait = kind }
            modifier = { factor = 2 trait = zealous }
            modifier = { factor = 2 trait = cruel }
            modifier = { factor = 2 trait = impaler }
        }
    }
    option = {
        name = "EVTOPTB75041"
        event_target:target_infidel = {
            opinion = {
                modifier = opinion_grateful
                who = ROOT
                years = 2
            }
        }
        any_courtier = {
            limit = {
                trait = zealous
                religion = ROOT
                NOT = {
                    character = ROOT
                }
                prisoner = no
            }
            opinion = {
                modifier = opinion_ignored_infidel
                who = ROOT
                years = 5
            }
        }
        FROM = {
            hidden_tooltip = {
                character_event = {
                    id = 75044
                    days = 1
                    random = 2
                }
            }
        }
        ai_chance = { 
            factor = 50 
            modifier = { 
                factor = 2
                NOT = { trait = zealous }
                OR = {
                    AND = {
                        event_target:target_heretic = { trait = sympathy_christendom }
                        religion_group = christian
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_islam }
                        religion_group = muslim
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_pagans }
                        religion_group = pagan_group
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_zoroastrianism }
                        religion_group = zoroastrian_group
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_judaism }
                        religion_group = jewish_group
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_indian }
                        religion_group = indian_group
                    }
                }
            }
            modifier = {
                factor = 2  # More likely to release if I like victim more than you
                likes_better_than = { who = event_target:target_heretic than = FROM }
            }
            modifier = {
                factor = 2  # More likely to release if I find her attractive
                event_target:target_heretic = { is_valid_attraction = ROOT trait = fair }
            }
        }
    }
}

#Liege banish infidel?
character_event = {
    id = 75042
    desc = "EVTDESC75042"
    picture = GFX_evt_heretic
   
    is_triggered_only = yes
   
    option = {
        name = "EVTOPTA75042"
        event_target:target_infidel = {
            banish = yes
            any_courtier = {
                limit = {
                    religion = PREV
                    NOT = {
                        character = ROOT
                    }
                    NOT = {
                        character = PREV
                    }
                    prisoner = no
                }
                opinion = {
                    modifier = opinion_banished_same_faith
                    who = ROOT
                    years = 5
                }
            }
        }
        FROM = {
            opinion = {
                modifier = opinion_satisfied
                who = ROOT
                years = 2
            }
            hidden_tooltip = {
                character_event = {
                    id = 75045
                    days = 1
                    random = 2
                }
            }
        }
        ai_chance = { 
            factor = 50 
            modifier = {
                factor = 0.2
                OR = {
                    is_close_relative = ROOT
                    is_friend = ROOT
                    is_lover = ROOT
                    is_consort = ROOT
                }
            }
            modifier = {
                factor = 0
                OR = {
                    is_child_of = ROOT
                    is_main_spouse = ROOT
                }
            }
            modifier = { factor = 0.8 dynasty = ROOT }
            modifier = { factor = 10 is_rival = ROOT }
            modifier = { 
                factor = 0.5
                OR = {
                    AND = {
                        event_target:target_heretic = { religion_group = christian }
                        trait = sympathy_christendom
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = muslim }
                        trait = sympathy_islam
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = pagan_group }
                        trait = sympathy_pagans
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = zoroastrian_group }
                        trait = sympathy_zoroastrianism
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = jewish_group }
                        trait = sympathy_judaism
                    }
                    AND = {
                        event_target:target_heretic = { religion_group = indian_group }
                        trait = sympathy_indian
                    }
                }
            }
            modifier = { factor = 0.5 trait = cynical }
            modifier = { factor = 0.5 trait = just }
            modifier = { factor = 0.2 trait = trusting }
            modifier = { factor = 2 trait = zealous }
        }
    }
    option = {
        name = "EVTOPTB75042"
        event_target:target_infidel = {
            opinion = {
                modifier = opinion_grateful
                who = ROOT
                years = 2
            }
        }
        any_courtier = {
            limit = {
                trait = zealous
                religion = ROOT
                prisoner = no
                NOT = {
                    character = ROOT
                }
            }
            opinion = {
                modifier = opinion_ignored_infidel
                who = ROOT
                years = 5
            }
        }
        FROM = {
            hidden_tooltip = {
                character_event = {
                    id = 75046
                    days = 1
                    random = 2
                }
            }
        }
        ai_chance = { 
            factor = 50 
            modifier = { 
                factor = 2
                NOT = { trait = zealous }
                OR = {
                    AND = {
                        event_target:target_heretic = { trait = sympathy_christendom }
                        religion_group = christian
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_islam }
                        religion_group = muslim
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_pagans }
                        religion_group = pagan_group
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_zoroastrianism }
                        religion_group = zoroastrian_group
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_judaism }
                        religion_group = jewish_group
                    }
                    AND = {
                        event_target:target_heretic = { trait = sympathy_indian }
                        religion_group = indian_group
                    }
                }
            }
            modifier = {
                factor = 2  # More likely to release if I like victim more than you
                likes_better_than = { who = event_target:target_heretic than = FROM }
            }
            modifier = {
                factor = 2  # More likely to release if I find her attractive
                event_target:target_heretic = { is_valid_attraction = ROOT trait = fair }
            }
        }
    }
}


Ah, I forgot to mod in the secret cult parts. Thanks for pointing out 75040 and 75050 to look at! I added ai_chance to 75040 and copied it over to 75050 directly. Things haven't broken yet but due to the nature of the mod (reducing the factor AI would choose to burn someone) it would be a while before I realize if I did anything wrong. Sharing what I did here both for other people's benefit and to solicit comment if there's anything I may be missing/did wrong.

Particularly, hopefully i got the syntax order for likes_better_than = { who = event_target:target_heretic than = FROM } correct. I've placed it under ignore chaplain option and my intent is to make it more likely the liege ignores the chaplain if he likes the accused better than the chaplain.