Government modding

From Crusader Kings II Wiki
Jump to: navigation, search
Governments were introduced in patch 2.4 and are associated to characters.

They allow to dissociate the type of the capital holding from the actual government, which was problematic before patch 2.4.

For performance reasons governments are only validated when a title is gained/removed, liege relationship changes and religion changes.[1]

Government group[edit]

Government groups are hardcoded. There are 5 groups:

  • feudal_governments, for which is_feudal = yes
  • republic_governments, for which is_republic = yes
  • theocracy_governments, for which is_theocracy = yes
  • tribal_governments, for which is_tribal = yes
  • nomadic_governments, for which is_nomadic = yes


Here is the list of flags available for governments[2]:

Name Type Description Example
color rgb Color for the government type on the government map mode
title_prefix string Prefix for title localisation (for instance temple_count). title_prefix = "temple_"
frame_suffix string Suffix for the sprite gfx name of the character frame borders to use. frame_suffix = "_tribal"
potential character triggers Conditions for a character to select this government type. At game start, in case multiple governments are eligible, the first eligible one will be taken (Note: feudal seem to be evaluated first)
potential = {
	NOT = {	religion_group = muslim	}
	is_patrician = no
merchant_republic bool Enables merchant republic mechanics: generating family palaces and patricians. It will also unlock the possibility to build coastal trade posts. merchant_republic = yes
uses_decadence bool If scripted in the government AND the religion of a character, that character will use decadence mechanics. uses_decadence = yes
uses_jizya_tax bool uses_jizya_tax = yes
uses_piety_for_law_change bool
uses_prestige_for_law_change bool
allows_matrilineal_marriage bool
allow_title_revokation bool
allow_looting bool
can_imprison_without_reason bool
can_revoke_without_reason bool
ignores_de_jure_laws bool
dukes_called_kings bool
barons_need_dynasty bool If yes, barons will get a random dynasty whenever they get landed barons_need_dynasty = yes
can_create_kingdoms bool can_create_kingdoms = no
can_usurp_kingdoms_and_empires bool
have_gender_laws bool Set for governments that only have one allowed gender laws in the gender laws script. Affects the interface and also government tooltips. have_gender_laws = no
can_build_holdings bool
can_build_forts bool
can_build_castle bool
can_build_city bool
can_build_temple bool
can_build_tribal bool
can_grant_kingdoms_and_empires_to_other_government bool
can_be_granted_kingdoms_and_empires_by_other_government bool
free_retract_vassalage bool
free_levies_in_offensive_war bool Raise levies without pissing off vassals if in an offensive war free_levies_in_offensive_war = yes
max_consorts int
max_liege_levy Used instead of crown laws
max_liege_tax Used instead of crown laws
aggression Works like in religion modding
unit_modifier modifiers Works like in religion modding
unit_home_modifier modifiers Works like in religion modding
character_modifier modifiers Works like in religion modding
preferred_holdings List<holding>


List<holding> Will not get the wrong government type penalty
 # Will not get the wrong government type penalty for tribes of the same culture
allowed_holdings_culture = {
builds_with_prestige List<holding> Whether new settlements are built with prestige or gold costs. builds_with_prestige = yes
builds_with_piety List<holding> Whether new settlements are built with piety or gold costs. builds_with_piety = yes


# Gets the wrong religion modifier instead
accepts_liege_governments = { 


List<government> Liege gets free revocation on vassals with specified governments
# Tribal vassals of other religions can have their titles revoked for free
free_revoke_on_governments_religion = { 


List<tier> Vassal tier for which revoking title won't trigger any negative opinion modifiers
free_revoke_on_tiers = { count duke }
ignore_in_vassal_limit_calculation List<government> Vassals with specified governments will not count toward the vassal limit.
ignore_in_vassal_limit_calculation = {
vassal_call_to_arms List<government>
no_vassal_tax List<government>
forced_contract List<government> Vassals with specified governments will give max taxes and max liege levies regardless of opinion. Tyranny actions against these vassals can be made without objections from vassals of other governments
can_change_to_nomad_on_start bool Tribal rulers under a nomadic liege (of the same culture) will become nomadic rulers, unless something else is specified for that character or the titles of that character. It is only for evaluating governments before the game has started.


In order to add custom graphics for a government, some interface modding is required. Create a .gfx file in the interface folder. Inside, you can add a spriteType block for the government icon, as well as five sprites for the five character frame images. All six spriteTypes need to be inside a spriteTypes block, and the names of all these spriteTypes need to end with whatever you put in the government txt file for frame_suffix.

The actual graphical files (.dds files) are placed inside the gfx\interface folder

For example, if you want to add custom graphics for a secular government, with frame_suffix = _secular :

spriteTypes = {
	### character stuff
	spriteType = {
		name = "GFX_charframe_150_secular"
		texturefile = "gfx\\interface\\charframe_150_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	spriteType = {
		name = "GFX_charframe_100_secular"
		texturefile = "gfx\\interface\\charframe_100_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	spriteType = {
		name = "GFX_charframe_75_secular"
		texturefile = "gfx\\interface\\charframe_75_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	spriteType = {
		name = "GFX_charframe_50_secular"
		texturefile = "gfx\\interface\\charframe_50_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	spriteType = {
		name = "GFX_charframe_34_secular"
		texturefile = "gfx\\interface\\charframe_34_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	### government icons
	spriteType = {
		name = "GFX_icon_secular_government"
		texturefile = "gfx\\interface\\"



Do not forget to localise your new government. It works similarly to other localisation:

secular_government_desc;No religions allowed!;;;;;;;;;;;;;x

Note that the list of features for a government (such as "Can hold Castle, Temple & Fort Holdings without penalties") are automatically generated (based on what you put in the txt file) and placed underneath whatever is in your _government_desc . This means you could leave the _government_desc blank if you do not want to explain what the government form entails.


  2. forum:869138
DefinesGame rulesReligionCultureTraitsTechnologyLawsBuildingsCasus BelliUnitsObjectivesGovernmentsDiseaseDeathMinor titlesSocietiesArtifacts