• 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.
On the Scopes wiki page, any_trade_route_province is listed as being from a province scope. This confused me (how do you scope to a province on a trade route from another province), so I checked for vanilla instances of it. It's used once in events, in jd_chinese_diplomacy_events.txt, where it's used from a Character scope.

Is this an error on the wiki maybe, or have I misunderstood something?

Assuming that it does work from Character scope, as in that events file, does it find only trade route provinces in one's demesne, or everywhere in your realm?
Unfortunately, the only base game usage (JD.40000, the event you found) is actually commented-out in on_actions, so it will never fire, so it was probably never fully tested. It's dead code.

My best guess, with the ginormous unjustified assumption that the event is coded properly is:
  • any_trade_route_province finds every province in the world that is in a trade route
    • Because JD.40000 is intended to fire with ROOT as the WP governor, who may be unlanded.
    • And because the only usage contains a condition limiting the scope to the SR, which implies it could find Saharan trade provinces for the WP governor, and it's effectively impossible he will ever conquer that far (I think it would need a player to do a half-WC as a WP vassal).
  • You can use any_trade_route_province from any scope
    • See previous - it seems more like any_province than any_realm_province.
However, the only way to be sure is to test it. Eg:
Add the below to a mod. Trigger ATRPTest.1 on a character via the console. Observe which provinces are notified to the player: if it's provinces all over the world then my speculation is correct. If you think the random_list is filtering out too much, change the weights!
Code:
namespace = ATRPTest

character_event = {
   id = ATRPTest.1
   is_triggered_only = yes
   hide_window = yes
   immediate = {
      any_trade_route_province = {
         province_event = { id = ATRPTest.2 }
      }
   }
}

province_event = {
   id = ATRPTest.2
   is_triggered_only = yes
   hide_window = yes
   immediate = {
      # Discard 90% of the returned provinces, to avoid swamping the player
      random_list = {
         10 = { any_player = { character_event = { ATRPTest.3 } } }
         90 = { #Nothing }
      }
   }
}

character_event = {
   id = ATRPTest.3
   is_triggered_only = yes
   desc = "[From.GetName]" # May need to put this in a real localisation file
   picture = GFX_evt_battle
   option = { name = OK }
}

Be sure to let us know if you find anything! (And/or update the wiki.)
 
Last edited:
  • 1
Reactions:
On the Scopes wiki page, any_trade_route_province is listed as being from a province scope. This confused me (how do you scope to a province on a trade route from another province), so I checked for vanilla instances of it. It's used once in events, in jd_chinese_diplomacy_events.txt, where it's used from a Character scope.

Is this an error on the wiki maybe, or have I misunderstood something?

Assuming that it does work from Character scope, as in that events file, does it find only trade route provinces in one's demesne, or everywhere in your realm?

It appears to have been added way back, after the 2.4 update, so if it wasn't used back then, some of the documentation may have been a guess, or its functionality could have changed since. There are probably more errors on that scopes page, since I mostly filled in missing information, but didn't check all that was already there.

I can run some quick tests and then update the wiki page for this scope.
Edit: Preliminary testing shows this one always scopes to all trade route provinces, so it's global and runs from any scope.
 
  • 2
Reactions:
Other than editing the can_join_society and potential blocks individually for each society in \common\societies\00_societies.txt, is there a way to exclude people with a certain trait from joining any societies, period? I didn't find a scripted trigger for it, so I'm guessing there's not, but if anyone knows of a way, I'd appreciate it.
 
Other than editing the can_join_society and potential blocks individually for each society in \common\societies\00_societies.txt, is there a way to exclude people with a certain trait from joining any societies, period? I didn't find a scripted trigger for it, so I'm guessing there's not, but if anyone knows of a way, I'd appreciate it.

There's no such flag available to add to trait definitions, so you'll have to edit the aforementioned blocks instead.
 
Other than editing the can_join_society and potential blocks individually for each society in \common\societies\00_societies.txt, is there a way to exclude people with a certain trait from joining any societies, period? I didn't find a scripted trigger for it, so I'm guessing there's not, but if anyone knows of a way, I'd appreciate it.

Not really... though if you see yourself doing it a lot, maybe create a can_join_any_society_trigger scripted_trigger, hook that into all societies, and update that as needed.
 
  • 1
Reactions:
Does anyone know how I could replace the middle age byzantine headgear with the one from early eastern clothing? Specifically, I want that chainmail silver replaced with the blacker helmet and red cloth. I know the basics of modding, but any help would be appreciated as portraits are a whole other thing for me!
 
Does anyone know how I could replace the middle age byzantine headgear with the one from early eastern clothing? Specifically, I want that chainmail silver replaced with the blacker helmet and red cloth. I know the basics of modding, but any help would be appreciated as portraits are a whole other thing for me!
The simplest method would be to check and edit \common\cultures\00_cultures.txt. See what graphical culture the early eastern culture in question uses, then edit the Byzantine culture's graphical culture to that one. This has the advantage of being quick and easy. However, it will change everything about Byzantine appearance (from skin tone to clothing) to early eastern, not only the one headgear.

If you don't want that, then your options are to edit the graphical culture itself (which one Byzantine cultures use (which would affect every culture that uses that graphical culture)), or to create a new graphical culture, one that is identical to the one Byzantine cultures already use, except with that one headgear replaced by whatever the early eastern culture uses, and then to edit 00_cultures.txt so Byzantine culture uses that graphical culture.

I don't know a lot about portraits and stuff, so I can't give you details beyond that, but here are a couple of links that may help.



What I can tell you, if you go that route, is that you'll need to define a new graphical culture in \common\graphicalculturetypes\, but that is only for "declaring" the graphical culture (so the game recognizes it) and for setting the skin tone. The clothing and other things are set elsewhere.

You can also find some of the images used for graphical cultures in \gfx\characters\ and its subfolders, such as \western_male\, where the naming scheme may play some rule in telling the game what images go with what graphical culture. It's also probable that there is an interface file in \interface\ or one of its subfolders that defines what images from \gfx\ that graphical cultures should use.

I know that's more leads and suggestions than answers, and I apologize for that, because I'm not well versed in the subject.
 
The simplest method would be to check and edit \common\cultures\00_cultures.txt. See what graphical culture the early eastern culture in question uses, then edit the Byzantine culture's graphical culture to that one. This has the advantage of being quick and easy. However, it will change everything about Byzantine appearance (from skin tone to clothing) to early eastern, not only the one headgear.

If you don't want that, then your options are to edit the graphical culture itself (which one Byzantine cultures use (which would affect every culture that uses that graphical culture)), or to create a new graphical culture, one that is identical to the one Byzantine cultures already use, except with that one headgear replaced by whatever the early eastern culture uses, and then to edit 00_cultures.txt so Byzantine culture uses that graphical culture.

I don't know a lot about portraits and stuff, so I can't give you details beyond that, but here are a couple of links that may help.



What I can tell you, if you go that route, is that you'll need to define a new graphical culture in \common\graphicalculturetypes\, but that is only for "declaring" the graphical culture (so the game recognizes it) and for setting the skin tone. The clothing and other things are set elsewhere.

You can also find some of the images used for graphical cultures in \gfx\characters\ and its subfolders, such as \western_male\, where the naming scheme may play some rule in telling the game what images go with what graphical culture. It's also probable that there is an interface file in \interface\ or one of its subfolders that defines what images from \gfx\ that graphical cultures should use.

I know that's more leads and suggestions than answers, and I apologize for that, because I'm not well versed in the subject.
Thanks, I'll definitely check out those links.

If it helps, both armors are from the byzantine cultures.

The one I want is from early eastern clothing, the headgear for byzantine culture. The one I wish to replace is the byzantine headgear from the Mediterranean pack. Both of them are accessible via the dlc packs, so could I just make a mod switching them?
 
Is there a way to change the order of which holding gets besieged first in a province? Or is it hardcoded to always be the capital?

I'm asking because I want to create a mod where each province represents a single city, with each holding representing a district, temple, tower or other important building within the city. The province capital would then be the citadel of the city, held by the playable ruler character. But this wouldn't really work if the province capital (citadel) is always besieged first, as historically the exact opposite was more common, with the city being sacked first and the citadel being the last place to hold out.

According to the wiki, forts are always besieged first in a province, so they would be ideal to represent walls that have to be breached before an army can enter the city. I read somewhere that hospitals and trade posts are always besieged last, so maybe I could turn one of them into citadels? But then there's also the problem of ruling characters getting captured when the province capital falls, while in reality they should be hiding inside the citadel.

Maybe this whole idea of representing provinces as single cities just doesn't work within the systems of CK2. Or am I missing something?
 
Is there a way to change the order of which holding gets besieged first in a province? Or is it hardcoded to always be the capital?

I'm asking because I want to create a mod where each province represents a single city, with each holding representing a district, temple, tower or other important building within the city. The province capital would then be the citadel of the city, held by the playable ruler character. But this wouldn't really work if the province capital (citadel) is always besieged first, as historically the exact opposite was more common, with the city being sacked first and the citadel being the last place to hold out.

According to the wiki, forts are always besieged first in a province, so they would be ideal to represent walls that have to be breached before an army can enter the city. I read somewhere that hospitals and trade posts are always besieged last, so maybe I could turn one of them into citadels? But then there's also the problem of ruling characters getting captured when the province capital falls, while in reality they should be hiding inside the citadel.

Maybe this whole idea of representing provinces as single cities just doesn't work within the systems of CK2. Or am I missing something?

I'm reasonably sure it is hardcoded, and forts, hospitals, and trade posts are all a bit odd functionality-wise, don't count as true holdings for various things, are tied to specific systems, and aren't something the AI would understand to build (or perhaps to siege) in a different fashion, so using those would be messy at best.
 
  • 1
Reactions:
Is there a way to change the order of which holding gets besieged first in a province? Or is it hardcoded to always be the capital?

I'm asking because I want to create a mod where each province represents a single city, with each holding representing a district, temple, tower or other important building within the city. The province capital would then be the citadel of the city, held by the playable ruler character. But this wouldn't really work if the province capital (citadel) is always besieged first, as historically the exact opposite was more common, with the city being sacked first and the citadel being the last place to hold out.

According to the wiki, forts are always besieged first in a province, so they would be ideal to represent walls that have to be breached before an army can enter the city. I read somewhere that hospitals and trade posts are always besieged last, so maybe I could turn one of them into citadels? But then there's also the problem of ruling characters getting captured when the province capital falls, while in reality they should be hiding inside the citadel.

Maybe this whole idea of representing provinces as single cities just doesn't work within the systems of CK2. Or am I missing something?
There are some situations (usually involving a war with 3 or more sides, eg. a simultaneous holy war and civil war) where the county capital is not besieged first. I notice this maybe once or twice per run.

Trade posts are either besieged last or are destroyed when any holding in the province is fully sieged, depending on the type of trade post (merchant republic vs silk road) and the type of siege (raid vs normal). However, I don't know how this interacts with forts - I don't often see forts in the same province as normal holdings.

I have never seen hospitals be affected by a siege in any way. I suspect they can't be besieged at all, but equally it's possible that this is a feature you can turn on and off.

It doesn't make much sense IMO for the sequence of damage to be walls -> citadel -> city. In a real-life siege, you would expect a wall breach to be followed by sacking and occupation of the city, followed by sieging and taking the citadel. But I can't think of a good way to model this in CK2.

But, overall, I think it's theoretically possible. However, as @Silversweeeper noted above, it's probably going to be a bit messy to implement in practice, as you're trying to work around the expected logic of the game engine.
 
  • 1
Reactions:
I feel like I've seen this answered on the wiki before, but I can't find it.

When adding random days to an event, like so: character_event = { id = [event ID here] days = x random = y }

Does that mean the event will happen after a number of days between x and x+y? Or does that mean the event can happen any time from y days before x up until y days after x?

A more concrete example. If I use days = 10 random = 3, does that mean the event will happen in 10 to 13 days, or does it mean it'll happen in 7 to 13 days?
 
I feel like I've seen this answered on the wiki before, but I can't find it.

When adding random days to an event, like so: character_event = { id = [event ID here] days = x random = y }

Does that mean the event will happen after a number of days between x and x+y? Or does that mean the event can happen any time from y days before x up until y days after x?

A more concrete example. If I use days = 10 random = 3, does that mean the event will happen in 10 to 13 days, or does it mean it'll happen in 7 to 13 days?

To respond to the concrete example, it will fire in 10 to 13 days.
 
  • 3
Reactions:
Is there some special alchemy needed to make crown laws work?
  • I am trying to create a "regulated inheritance" law for tribal nations. (With difficult preconditions.)
  • As a secondary objective, I'm trying to not overwrite any base game files. (Which should be trivial, since tribals don't get this law in the base game, right? Wrong!)
  • I feel like I almost completely copied the existing crown laws (ze_crown_laws.txt), so I don't understand why those work but mine don't.
  • No errors in Validator (v1.37.7).
Problems:
  • If I set potential = { is_tribal = yes } then all of my de jure and de facto duke+ vassals get access to their own version of the law.
    • This is contrary to base game behaviour, where crown laws are only available to kings and emperors, and follow the complicated rules about whose crown law is controlling.
    • The code here is a simplification: I'm actually setting potential = { expd_at_this_title_should_have_tribal_laws = yes }.

  • If I set potential = { is_tribal = yes tier = EMPEROR } then my duke+ vassals don't get access to the law, but they also aren't bound by it (which you can see in the tooltips in de jure kingdom/empire mapmode).
    • The code here is a simplification: I'm actually adding or removing expd_at_this_title_should_have_crown_laws = yes from the potential block.

  • I can see in de jure kingdom/empire mapmode that the base game's "free inheritance" and "unrestricted vassal wars" crown laws are in effect in my demesne, despite the fact that I'm tribal so I can't see them.
    • This is in addition to the new tribal crown law added by this mod.
    • At the moment, I only really trust the tooltip in my demesne, due to the problems noted above.
    • These hidden crown laws will probably cause problems further down the road, as the base game's "free inheritance" probably clashes with "mymod tribal regulated inheritance".

Screenshots:
  • Base game crown laws shown in de jure mapmode, despite being hidden
    20240510110633_1.jpg

  • Crown laws do not apply to de jure vassals
    20240510110716_1.jpg

Code (for reference):
Code:
# Audax Validator EnableCommentMetadata
# revoke_allowed, ai_will_do and ai_will_revoke are required blocks, but the Validator flags them as errors

law_groups = {
    expd_at_out_of_realm_inheritance_laws = {
        law_type = realm
        allowed_for_councillors = yes
    }
    expd_at_imperial_administration_laws = { ####### Not relevant to this question, except to say that it's a very custom realm law which works exactly as intended.
        law_type = realm
        allowed_for_councillors = yes
    }
}




############################
# Out of realm inheritance #
############################

de_jure_laws = { # Crown law
 
    # Default (free inheritance)
    expd_at_out_of_realm_inheritance_law_0 = {
        group = expd_at_out_of_realm_inheritance_laws
        default = yes
        potential = {
            expd_at_this_title_should_have_tribal_laws = yes
            expd_at_this_title_should_have_crown_laws = yes
        }
        allow = {
            always = yes
        }
        # Audax Validator "." Ignore_NEXT
        revoke_allowed = { always = no }
        # Audax Validator "." Ignore_NEXT
        ai_will_do = { factor = 0 }
        # Audax Validator "." Ignore_NEXT
        ai_will_revoke = { factor = 0 }
        effect = {
            hidden_tooltip = { revoke_law = expd_at_out_of_realm_inheritance_law_1 }
            set_protected_inheritance = no
        }
    }
 
    # Restricted inheritance (restricted inheritance & -20 opinion)
    expd_at_out_of_realm_inheritance_law_1 = {
        group = expd_at_out_of_realm_inheritance_laws
        default = no
        potential = {
            expd_at_this_title_should_have_tribal_laws = yes
            expd_at_this_title_should_have_crown_laws = yes
        }
        allow = {
            expd_at_this_title_is_a_highly_organised_tribe = yes
        }
        # Audax Validator "." Ignore_NEXT
        revoke_allowed = { always = no }
        # Audax Validator "." Ignore_NEXT
        ai_will_do = { factor = 1 }
        # Audax Validator "." Ignore_NEXT
        ai_will_revoke = { factor = 0 }
        effect = {
            hidden_tooltip = { revoke_law = expd_at_out_of_realm_inheritance_law_0 }
            set_protected_inheritance = yes
        }
        # If you use vassal_opinion here, the opinion modifier applies to everyone everywhere in the world - base game bug?
        city_opinion   = -20
        castle_opinion = -20
        temple_opinion = -20
        tribal_opinion = -20
    }
 
}

Code:
expd_at_this_title_should_have_tribal_laws = {
    has_dlc = "Zeus"
    holder_scope = {
        is_tribal = yes
        is_feudal = no
        is_nomadic = no
        is_republic = no
        is_theocracy = no
    }
}

expd_at_this_title_should_have_crown_laws = {
 
    OR = {
   
        # Empires always get crown laws
        tier = EMPEROR
   
        AND = {
            tier = KING
            OR = {
           
                # This kingdom doesn't belong to a de jure empire
                NOT = { any_de_jure_liege_title = { tier = EMPEROR } }
           
                # This kingdom's de jure liege title has no holder
                any_de_jure_liege_title = {
                    tier = EMPEROR
                    NOT = { holder_scope = { always = yes } }
                }
           
            }
        }
    }
 
}

expd_at_this_title_is_a_highly_organised_tribe = {
    holder_scope = {
        show_scope_change = no
        primary_title = {
            show_scope_change = no
       
            # Must have maximum tribal organization
            has_law = tribal_organization_4
       
            # Must have revoked all council powers
            has_law = law_voting_power_0
            has_law = war_voting_power_0
            has_law = revoke_title_voting_power_0
            has_law = imprison_voting_power_0
            has_law = grant_title_voting_power_0
            has_law = banish_voting_power_0
            has_law = execution_voting_power_0
       
            # Must have religious title revocation. Or, if tolerant, must have normal title revocation.
            trigger_if = {
                limit = { holder_scope = { has_religion_feature = religion_cosmopolitan } }
                has_law = revoke_title_law_1
            }
            trigger_else = {
                has_law = revoke_title_law_2
            }
       
        }
    }
}
 
Last edited:
Is there some special alchemy needed to make crown laws work?
  • I am trying to create a "regulated inheritance" law for tribal nations. (With difficult preconditions.)
  • As a secondary objective, I'm trying to not overwrite any base game files. (Which should be trivial, since tribals don't get this law in the base game, right? Wrong!)
  • I feel like I almost completely copied the existing crown laws (ze_crown_laws.txt), so I don't understand why those work but mine don't.
  • No errors in Validator (v1.37.7).
Problems:
  • If I set potential = { is_tribal = yes } then all of my de jure and de facto duke+ vassals get access to their own version of the law.
    • This is contrary to base game behaviour, where crown laws are only available to kings and emperors, and follow the complicated rules about whose crown law is controlling.
    • The code here is a simplification: I'm actually setting potential = { expd_at_this_title_should_have_tribal_laws = yes }.
  • If I set potential = { is_tribal = yes tier = EMPEROR } then my duke+ vassals don't get access to the law, but they also aren't bound by it (which you can see in the tooltips in de jure kingdom/empire mapmode).
    • The code here is a simplification: I'm actually adding or removing expd_at_this_title_should_have_crown_laws = yes from the potential block.
  • I can see in de jure kingdom/empire mapmode that the base game's "free inheritance" and "unrestricted vassal wars" crown laws are in effect in my demesne, despite the fact that I'm tribal so I can't see them.
    • This is in addition to the new tribal crown law added by this mod.
    • At the moment, I only really trust the tooltip in my demesne, due to the problems noted above.
    • These hidden crown laws will probably cause problems further down the road, as the base game's "free inheritance" probably clashes with "mymod tribal regulated inheritance".
Screenshots:

Code (for reference):
Code:
# Audax Validator EnableCommentMetadata
# revoke_allowed, ai_will_do and ai_will_revoke are required blocks, but the Validator flags them as errors

law_groups = {
    expd_at_out_of_realm_inheritance_laws = {
        law_type = realm
        allowed_for_councillors = yes
    }
    expd_at_imperial_administration_laws = { ####### Not relevant to this question, except to say that it's a very custom realm law which works exactly as intended.
        law_type = realm
        allowed_for_councillors = yes
    }
}




############################
# Out of realm inheritance #
############################

de_jure_laws = { # Crown law
 
    # Default (free inheritance)
    expd_at_out_of_realm_inheritance_law_0 = {
        group = expd_at_out_of_realm_inheritance_laws
        default = yes
        potential = {
            expd_at_this_title_should_have_tribal_laws = yes
            expd_at_this_title_should_have_crown_laws = yes
        }
        allow = {
            always = yes
        }
        # Audax Validator "." Ignore_NEXT
        revoke_allowed = { always = no }
        # Audax Validator "." Ignore_NEXT
        ai_will_do = { factor = 0 }
        # Audax Validator "." Ignore_NEXT
        ai_will_revoke = { factor = 0 }
        effect = {
            hidden_tooltip = { revoke_law = expd_at_out_of_realm_inheritance_law_1 }
            set_protected_inheritance = no
        }
    }
 
    # Restricted inheritance (restricted inheritance & -20 opinion)
    expd_at_out_of_realm_inheritance_law_1 = {
        group = expd_at_out_of_realm_inheritance_laws
        default = no
        potential = {
            expd_at_this_title_should_have_tribal_laws = yes
            expd_at_this_title_should_have_crown_laws = yes
        }
        allow = {
            expd_at_this_title_is_a_highly_organised_tribe = yes
        }
        # Audax Validator "." Ignore_NEXT
        revoke_allowed = { always = no }
        # Audax Validator "." Ignore_NEXT
        ai_will_do = { factor = 1 }
        # Audax Validator "." Ignore_NEXT
        ai_will_revoke = { factor = 0 }
        effect = {
            hidden_tooltip = { revoke_law = expd_at_out_of_realm_inheritance_law_0 }
            set_protected_inheritance = yes
        }
        # If you use vassal_opinion here, the opinion modifier applies to everyone everywhere in the world - base game bug?
        city_opinion   = -20
        castle_opinion = -20
        temple_opinion = -20
        tribal_opinion = -20
    }
 
}

Code:
expd_at_this_title_should_have_tribal_laws = {
    has_dlc = "Zeus"
    holder_scope = {
        is_tribal = yes
        is_feudal = no
        is_nomadic = no
        is_republic = no
        is_theocracy = no
    }
}

expd_at_this_title_should_have_crown_laws = {
 
    OR = {
 
        # Empires always get crown laws
        tier = EMPEROR
 
        AND = {
            tier = KING
            OR = {
       
                # This kingdom doesn't belong to a de jure empire
                NOT = { any_de_jure_liege_title = { tier = EMPEROR } }
       
                # This kingdom's de jure liege title has no holder
                any_de_jure_liege_title = {
                    tier = EMPEROR
                    NOT = { holder_scope = { always = yes } }
                }
       
            }
        }
    }
 
}

expd_at_this_title_is_a_highly_organised_tribe = {
    holder_scope = {
        show_scope_change = no
        primary_title = {
            show_scope_change = no
   
            # Must have maximum tribal organization
            has_law = tribal_organization_4
   
            # Must have revoked all council powers
            has_law = law_voting_power_0
            has_law = war_voting_power_0
            has_law = revoke_title_voting_power_0
            has_law = imprison_voting_power_0
            has_law = grant_title_voting_power_0
            has_law = banish_voting_power_0
            has_law = execution_voting_power_0
   
            # Must have religious title revocation. Or, if tolerant, must have normal title revocation.
            trigger_if = {
                limit = { holder_scope = { has_religion_feature = religion_cosmopolitan } }
                has_law = revoke_title_law_1
            }
            trigger_else = {
                has_law = revoke_title_law_2
            }
   
        }
    }
}
So I'm scratching my head at this too. At first I wondered if it was because you were duplicating a law, and having clashing laws, but I don't think this should be an issue (key word should, since we all know how wonky Paradox coding can be), as the button that sets a law is a one-time command in the effect that sets the protected inheritance on or off. On the other hand, it does show both the base-game's law and your own tribal law in that de jure view as you showed. Curious that it doesn't show either in your de jure vassal, you'd think it'd show at least one.

All I can suggest is to try different things to test, in an attempt to narrow down the issue. For instance, if you set your version of the law back to Free (to match the hidden base-game's version), does it then appear on your de jure vassal's active laws? If you make a copy of the ze_crown_laws.text file for your mod (just long enough to test, you can delete afterwards), and allow tribals to use the base-game's law (while temporarily removing your law.txt file from the mod for testing), does it work then?

Hmm, what if, in the effect clause of your law, you also have it revoke the relevant base game law? If there is some clashing going on, maybe if your version also revokes out_of_realm_inheritance_law_0 as well as expd_at_out_of_realm_inheritance_law_0, it might work? On the one hand, this may only affect what's displayed on de jure map mode (i.e. the screenshot seems to be displaying which law "button" is active for the hidden base-game law, rather than the law effect of set_protected_inheritance that goes into effect on setting the law/pressing the button), but on the other hand, maybe the game's logic for how crown laws take precedence is going by the active law button (what is labeled "Free" or "Regulated/Illegal") rather than the active law effect (of set_protected_inheritance = yes/no).
 
Last edited:
So I'm scratching my head at this too. At first I wondered if it was because you were duplicating a law, and having clashing laws, but I don't think this should be an issue (key word should, since we all know how wonky Paradox coding can be), as the button that sets a law is a one-time command in the effect that sets the protected inheritance on or off. On the other hand, it does show both the base-game's law and your own tribal law in that de jure view as you showed. Curious that it doesn't show either in your de jure vassal, you'd think it'd show at least one.

Thanks for the suggestions! And, yes, it is very odd that nothing is visible for my vassals, which is why I mentioned it!

I tested all of your ideas, and recorded them as I went along. Short answer is none of it works. (Long answer in a spoiler in case you're interested.)

All I can suggest is to try different things to test, in an attempt to narrow down the issue. For instance, if you set your version of the law back to Free (to match the hidden base-game's version), does it then appear on your de jure vassal's active laws?

Using allow_laws to switch back and forth between my mod's versions of free/illegal has no effect on what's displayed in the de jure mapmode for my de jure vassals.

20240510183744_1.jpg20240510183703_1.jpg

If you make a copy of the ze_crown_laws.text file for your mod (just long enough to test, you can delete afterwards), and allow tribals to use the base-game's law (while temporarily removing your law.txt file from the mod for testing), does it work then?

Also doesn't work.

"Proof" that these screenshots are using modified base game laws:
20240510184541_1.jpg

De jure empire mapmode tooltips for myself and a vassal:
20240510184624_1.jpg20240510184637_1.jpg

Hmm, what if, in the effect clause of your law, you also have it revoke the relevant base game law? If there is some clashing going on, maybe if your version also revokes out_of_realm_inheritance_law_0 as well as expd_at_out_of_realm_inheritance_law_0, it might work? On the one hand, this may only affect what's displayed on de jure map mode (i.e. the screenshot seems to be displaying which law "button" is active for the hidden base-game law, rather than the law effect of set_protected_inheritance that goes into effect on setting the law/pressing the button), but on the other hand, maybe the game's logic for how crown laws take precedence is going by the active law button (what is labeled "Free" or "Regulated/Illegal") rather than the active law effect (of set_protected_inheritance = yes/no).

As expected, this removed the base game crown law from the tooltip on my demesne. However, it had no impact on my vassal.

20240510190651_1.jpg20240510190707_1.jpg

However, while browsing around the map to do a sense check (ie. ensure that crown laws are in fact applying to other characters), I noticed some interesting things:
  • My tribal crown laws are applied to my theocratic, republic and feudal vassals.
    • (I have a few of each, scattered around, some deliberate some accidental. The overwhelming majority of my territory is tribal, which is probably why I didn't notice previously.)
    • (For clarity: My tribal crown laws are not applied to my tribal vassals.)

  • Tribal vassals of feudal kings are subject to their liege's crown laws.

  • In every test, including my previous post, the tooltip for my tribal vassals says they are subject to the crown law of the duchy!
    • Even the provinces of king-tier tribal vassals are subject to the crown laws of the local duchy.
---

Are tribal kings/emperors locked out of crown laws by some undocumented feature of the game engine? (IE: The reason for the existence of the is_tribal = no condition is so that characters can't see a feature that doesn't work.)

Alternatively: Is anyone aware of a counterexample, ie. a mod which adds working crown laws for tribals?

(For what it's worth, even the Papal/Free Investiture crown law is blocked in code for tribals. Eg: 867 king of Scotland can't see any crown laws.)
 
Are tribal kings/emperors locked out of crown laws by some undocumented feature of the game engine? (IE: The reason for the existence of the is_tribal = no condition is so that characters can't see a feature that doesn't work.)

Alternatively: Is anyone aware of a counterexample, ie. a mod which adds working crown laws for tribals?

(For what it's worth, even the Papal/Free Investiture crown law is blocked in code for tribals. Eg: 867 king of Scotland can't see any crown laws.)
Sorry my suggestions didn't pan out. I'm wondering if there is in fact some undocumented feature like you posit.

By the way, the investiture laws also specify that the year must be 1000, so no one in 867 would be able to see it, tribal or otherwise, if I read the code right.

The duchy thing is quite odd, both the fact that, unless you specifically remove their candidacy for the law in potential, they get access to the crown law, and the fact that, in all the tests, your tribal vassals are bound by duchy crown laws. This makes me think it could be some other undocumented feature, given that the base-game version doesn't specify kings/emperors only.

A potential workaround might be to allow tribal dukes to have access to your crown law in potential, but not allow them to actually use it (i.e. allow = { higher_real_tier_than = DUKE } }, and then make it so that a tribal king or emperor activating the crown law also sets the relevant laws in de jure duchies?
 
By the way, the investiture laws also specify that the year must be 1000, so no one in 867 would be able to see it, tribal or otherwise, if I read the code right.

I hadn't noticed that!

It doesn't really matter in this context but, if I'm reading it correctly, Papal Investiture is allowed (not potential) from year 1000. And Free Investiture has no time restriction. So, in theory, a feudal start should be able to see both laws in all start dates, but should be locked into Free Investiture until year 1000.

EDIT: Tested for Charlemagne at 769 start. Both are visible, he's set to Papal Investiture at the start of the game (probably either via history files or because Papal has default = yes). However, if he switches to Free then he cannot choose to switch back until 1000. But maybe the Pope could force him to switch back as a coronation request, bypassing the allow clause?

Sorry my suggestions didn't pan out. I'm wondering if there is in fact some undocumented feature like you posit.

The duchy thing is quite odd, both the fact that, unless you specifically remove their candidacy for the law in potential, they get access to the crown law, and the fact that, in all the tests, your tribal vassals are bound by duchy crown laws. This makes me think it could be some other undocumented feature, given that the base-game version doesn't specify kings/emperors only.

A potential workaround might be to allow tribal dukes to have access to your crown law in potential, but not allow them to actually use it (i.e. allow = { higher_real_tier_than = DUKE } }, and then make it so that a tribal king or emperor activating the crown law also sets the relevant laws in de jure duchies?

That workaround is unfortunately kinda messy, because you would also need to handle both realm expansion and realm contraction. (If you only set the law on vassal duchies at the time you pass it, it won't be set for any future conquests, and it will remain set if a duchy passes out of your realm for whatever reason.)

Unfortunately, there's a much bigger problem: this probably wouldn't have the intended effect.

It's obviously hard to test with weird-and-dysfunctional tribal laws, but I think I've found a decent analogy: king of Italy under the HRE in 1066. (Italy has its own crown laws in this situation, which is why forming Italy is a common player strategy.) If both Italy and the HRE have their own separate regulated inheritance crown laws, I believe this is analogous to both {tribal king/emperor} and {tribal duke/king} having their own separate regulated inheritance crown laws. Unfortunately, in this situation, Italy can be inherited by an outsider (see screenshots below) - probably because the crown isn't governed by their own crown laws.

20240510205754_1.jpg20240510205812_1.jpg20240510205832_1.jpg20240510205903_1.jpg20240510205925_1.jpg

The analogy to my situation is that, even if I forced regulated inheritance on all of my dukes, the game will probably treat those laws as if they were the duke's crown law (not mine), so the dukes will be free to ignore it, ie. duchies will continue to pass outside my realm.

Unless my test is flawed somehow?

Anyway, it was a good thought, and very much worth testing - thanks!
 
Last edited:
Is there a consensus among modders as to which aspects of the game the AI is particularly good at? I'm in the process of creating a fantasy world from scratch and would like to design it with the game's strengths in mind, rather than trying to make unsuitable concepts work through messy workarounds. I realize the question is a bit broad, but perhaps the AI is known to be more competent at certain mechanics (diplomacy, warfare, building) or play styles (different governments, religions, etc) than others.
 
Is there a consensus among modders as to which aspects of the game the AI is particularly good at? I'm in the process of creating a fantasy world from scratch and would like to design it with the game's strengths in mind, rather than trying to make unsuitable concepts work through messy workarounds. I realize the question is a bit broad, but perhaps the AI is known to be more competent at certain mechanics (diplomacy, warfare, building) or play styles (different governments, religions, etc) than others.
One person does not make a consensus, but here are a few things off the top of my head:
  • AI is bad at naval invasions (both defence and offence) onto large islands that are not connected by land. Eg: British Isles is bad, Malta is fine.
  • AI is better at reacting to attrition management than the player (because it notices instantly), but it's worse at planning for it (eg. knowing that supply will go down to 1k in the winter, so you either get a Winter Soldier or don't go there).
  • The AI seems to use a completely different strategy for marriages than the player. Players try to use strategic marriages to forge alliances with people who can actually help them in a war (independent or vassal of same liege), or they breed for good traits/bloodlines, or to put their dynasty on a foreign throne, or whatever. The AI can sometimes do all of those things, but only by chance - it's very much a scattergun approach. Relating this back to your question: If you want to have epic marriage alliances, you'll need to script them.
  • Following on from the previous point, everything the AI does is weighted random. IE: It very rarely makes the best possible choice, whereas an experienced player will probably always make a good choice. If you increase the power level too much (too many large stacking buffs) then the randomness of the AI's choices may lead to some crazy results. On the other hand, you could make it so only players are likely to stack those buffs (eg. going on a tour of warrior lodges for 5-6 special commander traits), which might give players a fun feeling of being powerful.
 
  • 1
Reactions: