Law modding

From Crusader Kings II Wiki
Jump to: navigation, search


Demesne laws[edit]

The demesne law screen

Demesne laws are declared inside a block laws = { } and shown in the Laws view.

Structure[edit]

law_name = {
  group = feudal_contract
  default = yes #If default, used on game start
  potential = {
    #Conditions for the law to appear
  }
  allow = {
    #Conditions for the law to be enabled
  }
  effect = {
    #Commands executed when law is enacted
  }
  pass_effect = {
    #Commands executed when law is enacted, takes place before effect = { } and is only triggered when the law is passed in game (not via history or event)
  }
  revoke_allowed = {
    always = no
  }
  ai_will_do = {
    #Factors for an AI character to enable the law (1 = 100% chance)
  }
  ai_will_revoke = {
    factor = 0
  }
  # Character modifiers: demesne_size, vassal_limit, castle_vassal_tax_modifier, city_vassal_max_levy, ...
}

Localization[edit]

  • law_name: name of the law
  • law_name_option: short name of the law displayed on laws screen buttons
  • law_name_desc: tooltip for law selection button
  • group_name: label for the laws group
  • group_name_desc: tooltip for the laws group

De jure laws[edit]

The crown law screen

De jure laws (or crown laws) are declared inside a block de_jure_laws = { } and shown in the Laws view.

Structure[edit]

law_name = {
  show_as_title = yes
  group = group_name
  default = yes #If default, used on game start
  potential = {
    #Conditions for the law to appear
  }
  allow = {
    #Conditions for the law to be enabled
  }
  effect = {
    #Commands executed when law is enacted
  }
  pass_effect = {
    #Commands executed when law is enacted, takes place before effect = { } and is only triggered when the law is passed in game (not via history or event)
  }
  revoke_allowed = {
    always = no
  }
  ai_will_do = {
    #Factors for an AI character to enable the law (1 = 100% chance)
  }
  ai_will_revoke = {
    factor = 0
  }
  # Character modifiers: feudal_opinion, castle_vassal_min_levy, ...
}

Localization[edit]

  • law_name: name of the law
  • law_name_option: short name of the law displayed on laws screen buttons
  • law_name_desc: tooltip for law selection button
  • group_name: label for the laws group
  • group_name_desc: tooltip for the laws group


Succession laws[edit]

The succession screen

Succession laws are declared inside a block succession_laws = { } or gender_laws = { }, and are shown in the Laws view.

The actual succession mechanics are hardcoded inside the succession and gender_succ commands, and are not moddable beyond weights exported to Defines.

On game start, each title will get a default succession and gender law, if not specified in history files:

  • For succession laws, they are evaluated in declaration order, and first one to match potential block will apply
  • For gender laws, it always starts with agnatic_cognatic, before trying any other.

Structure[edit]

succession_name = {
  # Character modifiers: child_opinion, dynasty_opinion, ...

  potential = {
    #Conditions for the law to appear
  }
  allow = {
    #Conditions for the law to be enabled
  }
  effect = {
    #Commands executed when law is enacted
  }
  revoke_allowed = {
    always = no
  }
}

Localization[edit]

  • succession_name: name of the succession law
  • succession_name_desc: tooltip
Modding
Common
Gfx/Sfx/localisation