• 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.

hwate29

Recruit
Sep 9, 2020
6
0
Hello all,

I'm currently trying to mod ck2 and I'm up to creating custom governments. I've created them but I'm having trouble getting them to my game since I don't know which file or code to edit.

Kind Regards,
hwate29
 
A character will get the first government they're eligible for -- unless you override it with a set_government_type (in which case they'll get whatever you set them as until the next time their government is validated) --, so you need to make sure they're not eligible for any governments defined before the government you want and that they're eligible for the government you want, and also that they won't gain/lose eligibility when they're not supposed to (e.g. if you check for a title flag on their primary title and they change their primary title (which the AI might do in a situation where the player wouldn't) then their government type will change unless the new title has that flag).
 
  • 1Like
Reactions:
A character will get the first government they're eligible for -- unless you override it with a set_government_type (in which case they'll get whatever you set them as until the next time their government is validated) --, so you need to make sure they're not eligible for any governments defined before the government you want and that they're eligible for the government you want, and also that they won't gain/lose eligibility when they're not supposed to (e.g. if you check for a title flag on their primary title and they change their primary title (which the AI might do in a situation where the player wouldn't) then their government type will change unless the new title has that flag).
Okay I think I understand what you mean friend but I've got a question or two if you don't mind answering :)
When you said over-ride with a set_government_type, where would I put that in? (Eg. The character folder, goverment folder, etc) Also just a quick question where is the character folder? I've been looking for the last 15 mins and have jad no luck. Thank you so much for all your help friend, its almost impossible find information about modding on the internet except here.
 
Okay I think I understand what you mean friend but I've got a question or two if you don't mind answering :)
When you said over-ride with a set_government_type, where would I put that in? (Eg. The character folder, goverment folder, etc) Also just a quick question where is the character folder? I've been looking for the last 15 mins and have jad no luck. Thank you so much for all your help friend, its almost impossible find information about modding on the internet except here.

Ideally you shouldn't use set_government_type unless you must use it since that breaks on government validation (which happens relatively frequently; for example, any time a title changes hands the government for both the previous and the new holder is validated, and you don't want to use set_government_type every time that happens). set_government_type is mainly something you want to use if you want to make someone's government type change without waiting for normal validation or for debugging purposes.

As for the "character" folder, historical (pre-defined) characters are stored in \history\characters, but it's pretty unlikely that you'll need to go there to set up the government type (though depending on the implementation you might need to do work there).


What you probably (without knowing the specifics I can't say for sure) should be doing is the following:

- Add your new government last (if you've got multiple new ones, add them one after the other) in the relevant x_governments.txt file (e.g. feudal_governments.txt; which file it goes into affects checks such as "is_feudal = yes/no") in your mod's \common}governments folder.

- Update all (relevant) accepts_liege_government blocks to account for the new government.

- Update the potential block of all preceding government types in that file (and possibly also other files if that turns out to be necessary) that aren't supposed to override your government type(s) to no longer be valid if your new government type is valid.

- Update anything using set_goverment_type to account for the new government and its conditions, if relevant.

- If you can become (in)eligible for your new government type in a way that doesn't cause validation (e.g. gaining/losing a trait), add a set_government_type (or several in if-blocks, if necessary) where relevant to force the government change.
 
  • 1
Reactions:
Okay I'm pretty sure I understand what to do now but if I don't ill make sure to ask you again :) Thank you again so much for the help and ill re-read all of this when im online next