Here's a somewhat messy government problem I'd like some help with:
I have three different government types that essentially have the same potential blocks, with the relevant difference being whether a law is set to A, B, or C, with A being the default. The desirable behaviour is that you only get the government type that matches your law. However, some weird things sometimes happen.
- If I start as a character who has the law for their primary title set as B or C in the title history file, the relevant government type is applied. This works as expected.
- If I change the law, a convoluted workaround using set_government_type is necessary to get any government type that isn't A (at least if my primary title is a viceroyalty), even if I change the law to B or C. This is an annoyance I can live with.
- If I lose a random county (tested with the console), the government type doesn't change. This works as expected.
- If my liege changes, I get to keep my government type. This works as expected.
- If I lose my primary title while still alive, the government type and law change to A, at least if my new primary has a lower tier. This is something of a problem.
- If I'm granted a viceroyalty that's a higher tier than my current title, I get the law and the government type the viceroyalty had when held by the last holder that isn't my liege (the liege in question doesn't use the relevant laws or governments, so it shouldn't depend on his laws). This is undesirable.
- If I die as a viceroy, my government type and law change to whatever it was before I got the viceroyalty (A if I started from a save or fresh campaign with the law set on the viceroyalty). This is a bit of a problem.
- If I inherit a title, I get to keep my government type. This works as expected.
- If I create or conquer a title as a viceroy, the government type (but not the law) changes to A. This is a rather big problem.
- If I save the game with the law set to B or C and reload, I get government B or C in accordance with the law, even if the government changed to A (as in the above scenario) before the save. This isn't a problem, but it is rather weird.
- If I'm granted a viceroyalty (at least when not having one), my government becomes whatever the government of the viceroyalty was before it was inherited by my liege.
My questions:
- Any idea how I can avoid having the government type change if I create or conquer a title as a viceroy?
- Any idea how I can avoid having the government type and law change if I lose my last primary tier title?
Edit: I did not manage to get it to work with laws, but I figured out a way to make it work using traits, with some maintenance events to ensure that the trait is correctly inherited and that gaining/losing a title doesn't cause issues (at least not as far as I've been able to determine, using roughly the same tests as before).