• 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.
That's what I was worried about. I was mainly wondering if those special attributes normally tied to religion, culture, or government type like max_consorts, allow_looting, or can_build_hospitals could be applied under other circumstances, like a scripted effect or flags. But from what I'm understanding, it's really not possible.

Would I be correct in assuming the only way I could modify such things (so they don't apply to everyone, but only when my desired condition or flag is met) would be to create custom governments, religions, or cultures which replaces the existing ones when conditions are met? Might not even be worth trying to do, considering I'd have to go over all the events and scripted effects to make sure they also apply to the new custom government/religion...
Yep, thats probably the only way you could do it
 
That's what I was worried about. I was mainly wondering if those special attributes normally tied to religion, culture, or government type like max_consorts, allow_looting, or can_build_hospitals could be applied under other circumstances, like a scripted effect or flags. But from what I'm understanding, it's really not possible.

Would I be correct in assuming the only way I could modify such things (so they don't apply to everyone, but only when my desired condition or flag is met) would be to create custom governments, religions, or cultures which replaces the existing ones when conditions are met? Might not even be worth trying to do, considering I'd have to go over all the events and scripted effects to make sure they also apply to the new custom government/religion...
It depends on which if these things you want to enable "dynamically", as certain things are easier than others.
For example, as @Omniscient already pointed out, you can dynamically enable crusades by setting a global flag that is checked in the "crusade" casus belli.
Similarly, since patch 2.8 we should be able to define additional restrictions for building holdings, and thus also for hospitals. (At some point that seemed broken though, so I am not sure if it has been fixed already.)
The main idea behind this approach is that you enable something in general, and in the next step forbid it unless a certain flag has been set.
This should work for can_build_hospitals, can_call_crusades and certain other things which can be influenced through dynamic scripting not directly at this point, but further down the road, e.g. in the CB or /common/00_holding_types.txt.
On the other hand, for max_consorts, allow_looting and also e.g. allow_rivermovement this would not work, because these things are only defined in hidden "hardcoded" code, and can only be dis- or enabled before gamestart. The only option here would indeed be a forced conversion, which for various reasons I would not recommend.
 
Hello again,

I wanted to create a character, that has a random religion:

Code:
            10 = { # Schlächter zufällige Kultur und Religion
                create_character = {
                    age = 16
                    religion = random
                    culture = random
                    race = random
                    dynasty = NONE
                    random_traits = yes
                    martial = 15
                    #trait = hunter
                    trait = robust
                    trait = stubborn
                    trait = strong
                    flag = is_court_executioner
                    flag = executioner_robust
                }
                new_character = {
                    set_character_flag = no_court_invites
                    save_event_target_as = recruited_executioner_target
                    character_event = { id = anus_executioner.1002 }
                }

Culture at random, no problem, but religion, always the same as my character... what can I do?
 
Culture accepts random as an option, but religion does not.

If the new_character section, you could add something like this:
Code:
random_list = {
   1 = {
      religion = catholic
   }
   1 = {
      religion = cathar
   }
   1 = {
      religion = fraticelli
   }
   # ... Repeat for everything
}

For pagan religions, you'll want to check the flag to pick the right version depending on whether or not they've reformed
If you're going to do this a lot, I'd make it a scripted effect to save typing and make it easier to modify if a new religion is added
 
For some reason these replacements do not happen
Code:
e_scandinavia;Nordic Empire;;;;;;;;;;;;;
e_scandinavia_adj;Nordic;;;;;;;;;;;;;
d_sjaelland;Denmark;;;;;;;;;;;;;
d_sjaelland_adj;Danish;;;;;;;;;;;;;
k_sapmi;Sápmi;;;;;;;;;;;;;
k_sapmi_adj;Samish;;;;;;;;;;;;;
k_mesopotamia;Assyria;;;;;;;;;;;;;
k_mesopotamia_adj;Assyrian;;;;;;;;;;;;;
d_norrland;Medelpad;;;;;;;;;;;;;
d_norrland_adj;Medelpadian;;;;;;;;;;;;;
c_lepiel;Lepel;Lepel;Lepel;;Lepel;;;;;;;;;
c_lepiel_adj;Lepelian;lepelienne;Lepel-;;Lepelian;;;;;;;;;

while the others do happen there seem to be no reason to which one works and which ones do not. They're from different files.

Please help me I have had this problem forever and it can't seem to fix it.
 

Attachments

  • aa_replacentfile.csv
    1,6 KB · Views: 6
Last edited:
you can enforce it through its history file under "misc" section :
Code:
# Misc
culture = arpitan
religion = catholic
terrain = hills
thanks a lot for providing an example, and sorry for such late reply, I've been having issues with my computer.
 
So I have two issues I'm trying to figure out. I'm trying to have it so a character has a certain capital at the start of the game.

The second thing is I'm trying to have it so a hospital and fort are already built in a province at the start of the game.
 
For the first one, in their history, add a date, then set the capital. For example:
Code:
1225.1.1 = {
   capital=c_marienburg
}
If you're trying to set the capital holding of a single province, you can so the same thing in the province history, but specifying the barony

Not sure about extra holding though, since the I don't think it's done in vanilla, so I don't have a reference.
 
For the first one, in their history, add a date, then set the capital. For example:
Code:
1225.1.1 = {
   capital=c_marienburg
}
If you're trying to set the capital holding of a single province, you can so the same thing in the province history, but specifying the barony

Not sure about extra holding though, since the I don't think it's done in vanilla, so I don't have a reference.
Pretty sure the capital of a title needs to be a province, unless the title is a country then I guess a barony would do.
 
Hello i'm making a small excommunicate attacker script but it isn't working as intended:

Code:
decisions = {
    excommunicate_war = {
        only_playable = yes
        only_independent = yes
        is_high_prio = yes
        potential = {
#            controls_religion = yes
            religion = catholic
        }
        allow = {
            religion_authority = 0.4
            war = yes
            ROOT = { is_primary_war_defender = yes }
            any_war = {
                attacker = {
                    religion = catholic
                    NOT = { trait = excommunicated }
                }
            }
        }
        effect = {
            ROOT = {
                any_war = {
                    attacker = {
                        add_trait = excommunicated
                        piety = -250
                    }
                }
            }
        }
        revoke_allowed = {
            always = no
        }
        ai_will_do = {
            factor = 1
        }
    }
}

The allow part works fine (i cannot use the decision if the attacking ruler isn't christian or is already excommunicated)
Unfortunately the effect part is applied to all existing rulers currently involved in a war :(
 
Hello i'm making a small excommunicate attacker script but it isn't working as intended:

Code:
decisions = {
    excommunicate_war = {
        only_playable = yes
        only_independent = yes
        is_high_prio = yes
        potential = {
#            controls_religion = yes
            religion = catholic
        }
        allow = {
            religion_authority = 0.4
            war = yes
            ROOT = { is_primary_war_defender = yes }
            any_war = {
                attacker = {
                    religion = catholic
                    NOT = { trait = excommunicated }
                }
            }
        }
        effect = {
            ROOT = {
                any_war = {
                    attacker = {
                        add_trait = excommunicated
                        piety = -250
                    }
                }
            }
        }
        revoke_allowed = {
            always = no
        }
        ai_will_do = {
            factor = 1
        }
    }
}

The allow part works fine (i cannot use the decision if the attacking ruler isn't christian or is already excommunicated)
Unfortunately the effect part is applied to all existing rulers currently involved in a war :(

Try this for the effect, sorry for wonky indents im using my phone :confused:.

Code:
effect = {
    any_current_enemy = {
          limit = {is_primary_war_attacker = yes}
          excommunicate = yes
          piety = -250
       }
}
 
Last edited:
Anyone know how to start differentiating between characters descended from a character? Using "targeted_decisions" to do it?

Let me get a screenshot.

CK2 Patrilineal and Maternal Mod Example1.png


Whenever I try to make Yuanyu or Changtu/whoever is higher up the tree as the founder of a new dynasty, Ruoxian or Cadet 1's three bastard children always make a fuss. I'm not that keen on modding/coding, but I still can't figure out how to make those three part of the new dynasty. Well, I could make all of them part of the new dynasty, but I want to differentiate between the three as they have three different bastard statuses.

The firstborn, Hanyue (female Han child), has the same father as the other two bastards, but she wasn't acknowledged. Her dynasty was made solely for her (by the game's mechanics).She has no descendants.

The secondborn, Wei (male Han adult), was acknowledged as Ruoxian's child. Let me clarify that the father of the three bastards is some lowborn (no dynasty) mayor and that they all held "bastard", not "legit_bastard". So I think it automatically forces them three to be part of House de Cantabria if acknowledged? Anyway, Wei had some children and he became the founder of a new dynasty.

The thirdborn and namesake of his maternal grandfather, Yuanyu (male Han adult, bald and with eyepatch), is as shown in the screenshot: a bastard of de Cantabria. He has no descendants.

For Hanyue, I want her to remain in her own dynasty. For Wei, I want him and his descendants to remain in his particular dynasty. And for Yuanyu, I want him to become a bastard of what would be Ruoxian's new dynasty by virtue of descent from Yuanyu/Changtu/whoever's the new founder.

I think those are what the game should do if I set somebody higher than Ruoxian as the new dynasty founder. Whenever I tried to mod it, those three always end up as still part of de Cantabria. Or if I include them in the new dynasty, they are all part (bastards) of that new dynasty instead of just Yuanyu.

Also, the father of the two legitimate children of Ruoxian is Ruoxian's paternal fourth cousin (their common ancestor is five generations away), meaning he's also from de Cantabria. The problem is, I've only made Ruoxian's grandfather or great grandfather as the founder of the new dynasty, meaning her paternal fourth cousin isn't included in the new dynasty. But those two legitimate children both end up in the new dynasty even though I want them to stay in de Cantabria. Like if they stay in the de Cantabria, will that make the dynasty tree unusable due to incorrect parentages?

That's my whole problem, the dynasty tree becomes muddle (unusable) cuz I've incorrect scopes and such. Or forcing scopes that go against the dynasty tree's way.

For the second cadet line, we have the matrilineal situation.

Changtu, Chujun, Lin, or Jifu should be the founder of a new dynasty.

Jifu has three children. The first (Lin) is from his first (fruitful) marriage and is not matrilineal. The second (Sansi) and third (Zhuozhen) are from his marriage after the previous one, with the marriage being matrilineal.

Lin, namesake of his paternal grandfather, works well with his three kids. They all become part of the new dynasty.

Sansi and Zhuozhen also become part of the new dynasty. But I want them to remain in their mother's dynasty. I think I actually got these two to work right, but I've been so stumped with the handling of Ruoxian's bastards that I've just completely lost all rational thoughts.

I want children that are the product of a matrilineal marriage to stay in their mother's dynasty when their father's paternal ancestors are made founders of a new dynasty.

For (bastard) children, if the father is de Cantabria and is directly (patrilineally) under the new (male) dynasty founder's tree, I want them to follow into the new dynasty.

If the bastard children's mother is the daughter of a male that's been selected for a new dynasty, I want them to remind in their previous dynasty unless their father is a male that's been selected for the previously said new dynasty.

Sigh, I feel really lost. Like, if there was only a scope that's like:

Code:
ROOT = {
            dynasty = father_bastard/mother_bastard/new_dynasty
            any_direct_patrilineal_descendant = {
                limit = {
                    NOT = {
                        was_conceived_a_bastard = yes/trait = bastard/is_bastard
                        insertmaybe"is_married_matrilineally = yes"here
                    }
                }
                dynasty = ROOT
            }
}

It'd be really great. Like I don't know if I'm missing stuff since it's not in the ck2paradoxwiki site. My scripting/syntax is so horrid since I'm frustated/lost. Sigh.

I know there are cadet mods out there, but they don't really do what I want.

Here's why I want this type of cadet tool:

1. I like to install my dynasty into different thrones.
2. They breed too fast for manual culling (haven't tried autoculling).
3. My dynasty tree becomes very slow, sometimes to the point where it crashes. This has been a bug (limitation) with huge dynasties since launch day, I think.
4. I want to name them by descent. Exempli gratia: if it is through direct paternal descent, "Direct Paternal Descent OriginalDynastyName DistinctivePlaceName" would do fine.
5. Easier tracking of (descendants of) characters who weave in and out of senior, junior, et cetera lines. Using (congenital) traits for this takes too long, I'd rather right-click then form new dynasty to mark the character.

Since dead characters can't be right-clicked on, I have to open up the save file and form the new dynasty while paused/character is immortal. That's the top-down approach. I tried ROOT and any_character/whatever = { is_ancestor_of = ROOT } and then I have to scope to the legitimate and illegitimate siblings and so on for like several generations to make sure the dynasty tree isn't messed up.

Like if somebody could help me out here, it'd be really great. I don't know if it's cuz my mind got overloaded from whatever bug/missing feature. I just don't see a non-recursive way of doing this for version 2.8.1. Like I tried father_even_if_dead nested within father_even_if_dead nested within father_even_if_dead and so on. Like any_dynasty_member_even_if_dead doesn't work or something. I don't even know, man. I'm just lost.

Maybe if I had more background in programming. Sigh.
 
So there's an event causing a blank event window to show up in my game. So I saved the game with the window still open, and opened the save in a text editor.

I read that CK2 saves used to use a player_event section to list open event windows. But I guess they no longer use them, because my save doesn't have one.

How can I tell what event windows are open for the player from a save?
 
For the first one, in their history, add a date, then set the capital. For example:
Code:
1225.1.1 = {
   capital=c_marienburg
}
If you're trying to set the capital holding of a single province, you can so the same thing in the province history, but specifying the barony

Not sure about extra holding though, since the I don't think it's done in vanilla, so I don't have a reference.

Thanks I was thinking this was an edit in the character files. I don't know why I didn't think to try the titles I knew how to change the capital barony of a province.

For the hospitals I've tried a ton of different things mostly in provinces, but I've also tried code in characters and titles. I've even looked at the save files to see if I've missed anything. You would think it would work similar to trade posts.
 
So there's an event causing a blank event window to show up in my game. So I saved the game with the window still open, and opened the save in a text editor.

I read that CK2 saves used to use a player_event section to list open event windows. But I guess they no longer use them, because my save doesn't have one.

How can I tell what event windows are open for the player from a save?

Find your character ID either in the save, or ingame using the "charinfo" console command and hovering over your portrait. Then search the save using the ID till you get to the events part.

Alternatively you can also use "charinfo" and hover over the event ingame and it will give you the event ID, this was just recently added.