• 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.
I don't know how to do this off-hand (I would have to research and experiment), but my suggestion is you look at exactly how other all of the other holy orders are coded. (Because I don't think any of them exist in the earliest start dates, which sounds like exactly what you're looking for.)
Technically the Papal Guards (and my version for a custom religion) aren't holy orders, by game definitions. That said, I had already looked at how the holy orders are handled, and I couldn't find anything that suggested they didn't previously exist. There's one instance per holy order of activate_title, and that's in HF_alternate_start_events.txt. This suggests that they do previously exist in historical games but not in alternate start games. Still, I couldn't find anything that indicated how or why they were flagged to be inactive in an alternate start.
 
Technically the Papal Guards (and my version for a custom religion) aren't holy orders, by game definitions. That said, I had already looked at how the holy orders are handled, and I couldn't find anything that suggested they didn't previously exist. There's one instance per holy order of activate_title, and that's in HF_alternate_start_events.txt. This suggests that they do previously exist in historical games but not in alternate start games. Still, I couldn't find anything that indicated how or why they were flagged to be inactive in an alternate start.
Try history\titles\d_whatever.txt:
Code:
20.1.1={
    active = no
    law = revoke_title_law_2
    law = ze_administration_laws_1
    law = law_voting_power_0
    law = war_voting_power_0
    law = revoke_title_voting_power_0
    law = imprison_voting_power_0
    law = grant_title_voting_power_0
    law = banish_voting_power_0
    law = execution_voting_power_0
    law = succession_voting_power_0    
    law = centralization_3
}
 
  • 1
Reactions:
Try history\titles\d_whatever.txt:
Code:
20.1.1={
    active = no
    law = revoke_title_law_2
    law = ze_administration_laws_1
    law = law_voting_power_0
    law = war_voting_power_0
    law = revoke_title_voting_power_0
    law = imprison_voting_power_0
    law = grant_title_voting_power_0
    law = banish_voting_power_0
    law = execution_voting_power_0
    law = succession_voting_power_0   
    law = centralization_3
}
That must be it, thank you! I've never touched /history/ before.
 
Why can nomad vassals raid each other but tribal vassals can't? How can I make a tribal or even feudal government type where vassals of the same liege can raid each other?

Is there something besides
Code:
allow_looting = yes
that enables this?
 
Why can nomad vassals raid each other but tribal vassals can't? How can I make a tribal or even feudal government type where vassals of the same liege can raid each other?

Is there something besides
Code:
allow_looting = yes
that enables this?

The nomadic government is a hardcoded mess in many ways, and looting is (aside from the allow_looting = yes/no flag) pretty hardcoded, so chances are the answers are "Because their government is a nomadic government" and "You can't".
 
The nomadic government is a hardcoded mess in many ways, and looting is (aside from the allow_looting = yes/no flag) pretty hardcoded, so chances are the answers are "Because their government is a nomadic government" and "You can't".
I suspected as much when I didn't find any noticeable differences in the nomad and tribal government files. That's too bad, but thanks for confirming my suspicion.
 
What is the scope in an ai_chance block, for an option in a province_event?
  • I can't find any vanilla province_events that have options with ai_chance.
    • If anyone is aware of such an event, this would be very helpful!
    • (There are a LOT of province_events; I checked a few; none had ai_chance; and this seems consistent with my impression of Pdx's coding style, ie. "generally not including ai weights because equal weight is good enough".)
  • I think the ai_chance scope is probably the province owner. I coded an event this way, and I think the AI are acting accordingly, but it's really hard to be sure.
    • If the ai_chance block was invalid, it would probably be disregarded by the game engine, ie. reverting back to the default "equal weight" behaviour.
  • The Validator thinks the ai_chance scope is the province. This doesn't make much sense to me, but perhaps there's something I don't know?
    • "At <mod>\events\emb_cultural_unity_events.txt [province_event\option\ai_chance\modifier\NOT\trait] (Line 831, column 13):
      Invalid node "trait" in scope ProvTrigger (value is: cynical)"
Code:
# Offer the province owner the opportunity to convert the province culture to their own - for a price...
# Based on RIP.11706
province_event = {
    id = EMBCulturalUnity.1400
    title = PROSPERITY_TITLE
    desc = RIP.11706.d
    picture = "GFX_evt_culture_change"
    border = GFX_event_normal_frame_economy
 
    is_triggered_only = yes
 
    immediate = {
...
    }
 
    option = {
        name = RIP.11706.a
...
        ai_chance = {
            factor = 50
         
            # AI will never pay if their wealth afterwards will be less than 100
            modifier = {
                factor = 0
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value <= 100
                }
            }
         
            # AI is more likely to pay depending on their wealth afterwards
            modifier = {
                factor = 1.5
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 1
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 100
                }
            }
            modifier = {
                factor = 1.5
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 2
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 200
                }
            }
            modifier = {
                factor = 2
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 3
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 300
                }
            }
            modifier = {
                factor = 2
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 4
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 400
                }
            }
            modifier = {
                factor = 5
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 5
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 500
                }
            }
         
            # (Non-cynical) AI is more likely to pay if province religion doesn't match theirs (since this includes a free religious conversion)
            modifier = {
                factor = 1.5
                NOT = { religion = ROOT }
                NOT = { trait = cynical }
            }
            modifier = {
                factor = 1.5
                NOT = { religion = ROOT }
                NOT = { trait = cynical }
                trait = zealous
            }
         
        }
     
    }
...
}
 
Last edited:
What is the scope in an ai_chance block, for an option in a province_event?
  • I can't find any vanilla province_events that have options with ai_chance.
    • If anyone is aware of such an event, this would be very helpful!
    • (There are a LOT of province_events; I checked a few; none had ai_chance; and this seems consistent with my impression of Pdx's coding style, ie. "generally not including ai weights because equal weight is good enough".)
  • I think the ai_chance scope is probably the province owner. I coded an event this way, and I thinkthe AI are acting accordingly, but it's really hard to be sure.
    • If the ai_chance block was invalid, it would probably be disregarded by the game engine, ie. reverting back to the default "equal weight" behaviour.
  • The Validator thinks the ai_chance scope is the province. This doesn't make much sense to me, but perhaps there's something I don't know?
    • "At <mod>\events\emb_cultural_unity_events.txt [province_event\option\ai_chance\modifier\NOT\trait] (Line 831, column 13):
      Invalid node "trait" in scope ProvTrigger (value is: cynical)"
Code:
# Offer the province owner the opportunity to convert the province culture to their own - for a price...
# Based on RIP.11706
province_event = {
    id = EMBCulturalUnity.1400
    title = PROSPERITY_TITLE
    desc = RIP.11706.d
    picture = "GFX_evt_culture_change"
    border = GFX_event_normal_frame_economy
 
    is_triggered_only = yes
 
    immediate = {
...
    }
 
    option = {
        name = RIP.11706.a
...
        ai_chance = {
            factor = 50
        
            # AI will never pay if their wealth afterwards will be less than 100
            modifier = {
                factor = 0
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value <= 100
                }
            }
        
            # AI is more likely to pay depending on their wealth afterwards
            modifier = {
                factor = 1.5
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 1
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 100
                }
            }
            modifier = {
                factor = 1.5
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 2
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 200
                }
            }
            modifier = {
                factor = 2
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 3
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 300
                }
            }
            modifier = {
                factor = 2
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 4
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 400
                }
            }
            modifier = {
                factor = 5
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth_as_frac_of_scaled_wealth
                    value > 5
                }
                check_variable = {
                    which = emb_cultural_unity_culture_conversion_remaining_wealth
                    value > 500
                }
            }
        
            # (Non-cynical) AI is more likely to pay if province religion doesn't match theirs (since this includes a free religious conversion)
            modifier = {
                factor = 1.5
                NOT = { religion = ROOT }
                NOT = { trait = cynical }
            }
            modifier = {
                factor = 1.5
                NOT = { religion = ROOT }
                NOT = { trait = cynical }
                trait = zealous
            }
        
        }
    
    }
...
}

I believe it is the province and that you need to wrap traits/etc. in
Code:
owner
, though as you say its a rare setup. The easiest test would probably be to have a test case using options with e.g.
Code:
is_female = yes/no
and some indicator of what was picked (e.g. a character flag).
 
What is the scope in an ai_chance block, for an option in a province_event?
  • I can't find any vanilla province_events that have options with ai_chance.
    • If anyone is aware of such an event, this would be very helpful!
    • (There are a LOT of province_events; I checked a few; none had ai_chance; and this seems consistent with my impression of Pdx's coding style, ie. "generally not including ai weights because equal weight is good enough".)
  • I think the ai_chance scope is probably the province owner. I coded an event this way, and I think the AI are acting accordingly, but it's really hard to be sure.
    • If the ai_chance block was invalid, it would probably be disregarded by the game engine, ie. reverting back to the default "equal weight" behaviour.
  • The Validator thinks the ai_chance scope is the province. This doesn't make much sense to me, but perhaps there's something I don't know?
    • "At <mod>\events\emb_cultural_unity_events.txt [province_event\option\ai_chance\modifier\NOT\trait] (Line 831, column 13):
      Invalid node "trait" in scope ProvTrigger (value is: cynical)"

It's quite likely the province, since that's also the opening scope in province events' trigger, immediate and option blocks. Paradox has been known to be inconsistent at times, but this is unlikely to be one of those cases. In any case, using character checks that don't apply to provinces will send error.log filling up very quickly if you have logging enabled.
 
I believe it is the province and that you need to wrap traits/etc. in
Code:
owner
, though as you say its a rare setup. The easiest test would probably be to have a test case using options with e.g.
Code:
is_female = yes/no
and some indicator of what was picked (e.g. a character flag).
It's quite likely the province, since that's also the opening scope in province events' trigger, immediate and option blocks. Paradox has been known to be inconsistent at times, but this is unlikely to be one of those cases. In any case, using character checks that don't apply to provinces will send error.log filling up very quickly if you have logging enabled.
Thanks for your ideas! I went away and tested it, and the results were unexpected to say the least...

Code:
namespace = EMBTest

character_event = {
    id = EMBTest.101
    hide_window = yes
    is_triggered_only = yes
    immediate = {
        random_owned_province = {
            province_event = { id = EMBTest.102 }
        }
    }
}

province_event = {
    id = EMBTest.102
    is_triggered_only = yes
    name = "EMBTest102: Pick an option"
    desc = "EMBTest102: Pick an option"
    option = {
        name = OK
        FROM = { any_player = { character_event = { id = EMBTest.103 } } }
        ai_chance = {
            factor = 50
            modifier = { # 0 chance if female => only male AI can pick this
                factor = 0
                is_female = yes
            }
        }
    }
    option = {
        name = OK
        FROM = { any_player = { character_event = { id = EMBTest.104 } } }
        ai_chance = {
            factor = 50
            modifier = { # 0 chance if male => only female AI can pick this
                factor = 0
                is_female = no
            }
        }
    }
}

character_event = {
    id = EMBTest.103
    is_triggered_only = yes
    name = "EMBTest103: I Am Male"
    desc = "EMBTest103: I Am Male"
    option = { name = OK }
}

character_event = {
    id = EMBTest.104
    is_triggered_only = yes
    name = "EMBTest104: I Am Female"
    desc = "EMBTest104: I Am Female"
    option = { name = OK }
}

############################################################

character_event = {
    id = EMBTest.201
    hide_window = yes
    is_triggered_only = yes
    immediate = {
        random_owned_province = {
            province_event = { id = EMBTest.202 }
        }
    }
}

province_event = {
    id = EMBTest.202
    is_triggered_only = yes
    name = "EMBTest202: Pick an option"
    desc = "EMBTest202: Pick an option"
    option = {
        name = OK
        FROM = { any_player = { character_event = { id = EMBTest.203 } } }
        ai_chance = {
            factor = 50
            modifier = { # 0 chance if female => only male AI can pick this
                factor = 0
                owner = { is_female = yes }
            }
        }
    }
    option = {
        name = OK
        FROM = { any_player = { character_event = { id = EMBTest.204 } } }
        ai_chance = {
            factor = 50
            modifier = { # 0 chance if male => only female AI can pick this
                factor = 0
                owner = { is_female = no }
            }
        }
    }
}

character_event = {
    id = EMBTest.203
    is_triggered_only = yes
    name = "EMBTest203: I Am Male"
    desc = "EMBTest203: I Am Male"
    option = { name = OK }
}

character_event = {
    id = EMBTest.204
    is_triggered_only = yes
    name = "EMBTest204: I Am Female"
    desc = "EMBTest204: I Am Female"
    option = { name = OK }
}

############################################################

character_event = {
    id = EMBTest.301
    is_triggered_only = yes
    hide_window = yes
    immediate = {
        random_owned_province = {
            province_event = { id = EMBTest.302 }
        }
    }
}

province_event = {
    id = EMBTest.302
    is_triggered_only = yes
    name = "EMBTest302: Pick an option"
    desc = "EMBTest302: Pick an option"
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.310 } }
        ai_chance = { # This is only non-zero for non-prosperous and depopulated provinces
            factor = 50
            modifier = {
                factor = 0
                OR = {
                    has_province_modifier = prosperity_modifier_1
                    has_province_modifier = prosperity_modifier_2
                    has_province_modifier = prosperity_modifier_3
                }
            }
        }
    }
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.311 } }
        ai_chance = { # This is only non-zero for prosperity-1 provinces
            factor = 50
            modifier = {
                factor = 0
                NOT = { has_province_modifier = prosperity_modifier_1 }
            }
        }
    }
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.312 } }
        ai_chance = { # This is only non-zero for prosperity-2 provinces
            factor = 50
            modifier = {
                factor = 0
                NOT = { has_province_modifier = prosperity_modifier_2 }
            }
        }
    }
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.313 } }
        ai_chance = { # This is only non-zero for prosperity-3 provinces
            factor = 50
            modifier = {
                factor = 0
                NOT = { has_province_modifier = prosperity_modifier_3 }
            }
        }
    }
}

character_event = {
    id = EMBTest.310
    is_triggered_only = yes
    show_from_from = yes
    name = "EMBTest310: [From.GetName] is not prosperous"
    desc = "EMBTest310: [From.GetName] is not prosperous"
    option = { name = OK }
}

character_event = {
    id = EMBTest.311
    is_triggered_only = yes
    show_from_from = yes
    name = "EMBTest311: [From.GetName] has prosperity 1"
    desc = "EMBTest311: [From.GetName] has prosperity 1"
    option = { name = OK }
}

character_event = {
    id = EMBTest.312
    is_triggered_only = yes
    show_from_from = yes
    name = "EMBTest312: [From.GetName] has prosperity 2"
    desc = "EMBTest312: [From.GetName] has prosperity 2"
    option = { name = OK }
}

character_event = {
    id = EMBTest.313
    is_triggered_only = yes
    show_from_from = yes
    name = "EMBTest313: [From.GetName] has prosperity 3"
    desc = "EMBTest313: [From.GetName] has prosperity 3"
    option = { name = OK }
}

Male character with only one prosperous province:
20240214153708_1.jpg

Female character with only one non-prosperous province:
20240214153831_1.jpg

Female character with only one prosperous province:
20240214154007_1.jpg

All characters responded correctly for their sex, but did not respond correctly for province prosperity. (You can see a province's prosperity by looking for the relevant 3D thingamajig on the main map.)

I had no errors in error.log, except for the missing event pictures.

Not pictured:
  • Repeating the same tests for the same character several times to see if they were choosing randomly (they weren't).
  • Earlier more-limited tests, for 3-4 other characters, with the same results.
  • Tests for characters with more than one province
    • Because, although you can hardcode localisation text into events, apparently scopes don't work in that localisation text, so the output event text is not very helpful for characters with >1 province.

Tentative conclusion:

In modifier blocks, inside ai_chance blocks, inside option blocks, inside province_events:
  • You CAN use the province owner's properties directly
    • Eg: is_female = no
  • You CAN use the province owner's properties indirectly, via owner = { ... }
    • Eg: owner = { is_female = no }
  • You can NOT use the province's properties
    • Eg: has_province_modifier = prosperity_modifier_1
    • Eg2: ROOT = { has_province_modifier = prosperity_modifier_1 } (see below)
---

Thoughts?

Can you spot any mistakes or overlooked possibilities?
 
Last edited:
Thanks for your ideas! I went away and tested it, and the results were unexpected to say the least...

Tentative conclusion:

In modifier blocks, inside ai_chance blocks, inside option blocks, inside province_events:
  • You CAN use the province owner's properties directly
    • Eg: is_female = no
  • You CAN use the province owner's properties indirectly, via owner = { ... }
    • Eg: owner = { is_female = no }
  • You can NOT use the province's properties
    • Eg: has_province_modifier = prosperity_modifier_1
---

Thoughts?

Can you spot any mistakes or overlooked possibilities?

Interesting findings. What if you scope explicitly to ROOT inside ai_chance, and then check for the prosperity modifiers?

Also, you can use trigger = {} in ai_chance, so you need not invert your logic. Additionally, scoping to FROM before opening any_player doesn't do anything.
 
Also, you can use trigger = {} in ai_chance, so you need not invert your logic.

Can you provide a quick sample of correct usage? I haven't seen that before, and it's not on the wiki.

Additionally, scoping to FROM before opening any_player doesn't do anything.

This was misguided laziness - I wanted the event portrait to be set correctly, so I could check that the event had fired for the correct person and that they were of the sex they claimed, but I couldn't be bothered to trace back the correct number of FROMs. (Eg: show_from_from = yes.) Then, later, I had to do so anyway. It's test code, I don't hold it to my usual standards ;-)

Interesting findings. What if you scope explicitly to ROOT inside ai_chance, and then check for the prosperity modifiers?

Good idea, but this also doesn't work.

20240214200006_1.jpg

Code:
province_event = {
    id = EMBTest.302
    is_triggered_only = yes
    name = "EMBTest302: Pick an option"
    desc = "EMBTest302: Pick an option"
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.310 } }
        ai_chance = { # This is only non-zero for non-prosperous and depopulated provinces
            factor = 50
            modifier = {
                factor = 0
                ROOT = {
                    OR = {
                        has_province_modifier = prosperity_modifier_1
                        has_province_modifier = prosperity_modifier_2
                        has_province_modifier = prosperity_modifier_3
                    }
                }
            }
        }
    }
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.311 } }
        ai_chance = { # This is only non-zero for prosperity-1 provinces
            factor = 50
            modifier = {
                factor = 0
                ROOT = { NOT = { has_province_modifier = prosperity_modifier_1 } }
            }
        }
    }
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.312 } }
        ai_chance = { # This is only non-zero for prosperity-2 provinces
            factor = 50
            modifier = {
                factor = 0
                ROOT = { NOT = { has_province_modifier = prosperity_modifier_2 } }
            }
        }
    }
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.313 } }
        ai_chance = { # This is only non-zero for prosperity-3 provinces
            factor = 50
            modifier = {
                factor = 0
                ROOT = { NOT = { has_province_modifier = prosperity_modifier_3 } }
            }
        }
    }
}
 
Can you provide a quick sample of correct usage? I haven't seen that before, and it's not on the wiki.

Here you go:

Code:
province_event = {
    id = EMBTest.302
    is_triggered_only = yes
    name = "EMBTest302: Pick an option"
    desc = "EMBTest302: Pick an option"
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.310 } }
        ai_chance = { # This is only non-zero for non-prosperous and depopulated provinces
            factor = 50
            trigger = {
                ROOT = {
                    NOR = {
                        has_province_modifier = prosperity_modifier_1
                        has_province_modifier = prosperity_modifier_2
                        has_province_modifier = prosperity_modifier_3
                    }
                }
            }
        }
    }
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.311 } }
        ai_chance = { # This is only non-zero for prosperity-1 provinces
            factor = 50
            trigger = {
                ROOT = { has_province_modifier = prosperity_modifier_1 }
            }
        }
    }
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.312 } }
        ai_chance = { # This is only non-zero for prosperity-2 provinces
            factor = 50
            trigger = {
                ROOT = { has_province_modifier = prosperity_modifier_2 }
            }
        }
    }
    option = {
        name = OK
        any_player = { character_event = { id = EMBTest.313 } }
        ai_chance = { # This is only non-zero for prosperity-3 provinces
            factor = 50
            trigger = {
                ROOT = { has_province_modifier = prosperity_modifier_3 }
            }
        }
    }
}

This was misguided laziness - I wanted the event portrait to be set correctly, so I could check that the event had fired for the correct person and that they were of the sex they claimed, but I couldn't be bothered to trace back the correct number of FROMs. (Eg: show_from_from = yes.) Then, later, I had to do so anyway. It's test code, I don't hold it to my usual standards ;-)

You can always use portrait = some_scope in the follow-up event (see this).

Good idea, but this also doesn't work.

Unfortunate. Seems like Paradox certainly made things confusing, as they were especially wont to do early in CK2's lifetime.
 
Is there an easy way to see how many de jure counties a duchy title has? I don't see a condition for it, and while there's probably a roundabout way to check, if it's too roundabout and complex I'll not bother with it. Just wondering if there's an easy way to check (for an event) that I missed.
 
Is there an easy way to see how many de jure counties a duchy title has? I don't see a condition for it, and while there's probably a roundabout way to check, if it's too roundabout and complex I'll not bother with it. Just wondering if there's an easy way to check (for an event) that I missed.
Something like this?
Code:
# Imagine this is a scripted_trigger
this_duchy_has_at_least_4_counties = {
    any_de_jure_vassal_title = {
        tier = COUNT
        count >= 4
    }
}
Relevant wiki documentation.
 
  • 1
Reactions:
Is there a good way for something to trigger when a regency begins or ends? The only method I'm seeing is a triggered modifier with has_regent = yes/no, but even assuming that would work, I'm a bit reluctant because the wiki says that's resource-intensive. Though I would also have an ai = no clause in there too, I'm not sure if that would suffice for lowering resource intensity.

Not to mention that only lets me attach a modifier to the specific person, not fire an event.
 
Last edited:
Is there a good way for something to trigger when a regency begins or ends? The only method I'm seeing is a triggered modifier with has_regent = yes/no, but even assuming that would work, I'm a bit reluctant because the wiki says that's resource-intensive. Though I would also have an ai = no clause in there too, I'm not sure if that would suffice for lowering resource intensity.

Not to mention that only lets me attach a modifier to the specific person, not fire an event.
How immediately do you need to trigger it? I don't think there's a direct way to fire an event on start/end of regency, but you could run a pulse event which checks for a regent and then performs other actions (eg. triggering a later event that checks for lack of regent and does something else). Unfortunately, this approach would require that you handle all possible situations yourself (eg. change of regent, death of regent, death of ruler), and it probably won't detect momentary regency (eg. seclusion from theology focus).
 
Is there a good way for something to trigger when a regency begins or ends? The only method I'm seeing is a triggered modifier with has_regent = yes/no, but even assuming that would work, I'm a bit reluctant because the wiki says that's resource-intensive. Though I would also have an ai = no clause in there too, I'm not sure if that would suffice for lowering resource intensity.

Not to mention that only lets me attach a modifier to the specific person, not fire an event.

Fire an event for the liege when a character gains the title_regent minor title (happens one day after whatever made the regency start) checking if the liege has some regency_setup_done flag and otherwise doing whatever you want to do, and fire another event for the liege when a character loses the same minor title that cleans things up. There might be some edge cases when a regent dies or otherwise loses the title without the regency ending, however, so you might want to check for all possible causes for a regency (imprisoned, underage, incapable, on a pilgrimage, etc.) not being a thing before doing the cleanup.
 
  • 2
  • 1
Reactions: