Law modding

From Crusader Kings II Wiki
Revision as of 19:23, 7 April 2019 by Dauth (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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)
  }
  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 the following order: Turkish/Open Succession, Gavelkind, Seniority, Primogeniture, Feudal Elective, Tanistry, Open Elective, Catholic Bishopric Investiture, Patrician Elective, Ultimogeniture, Papal Succession, Appointment (titles revert to liege on death), Elective Gavelkind, Nomad Succession, and Confucian Bureaucracy (replaced by a random character with China's culture and high stewardship). The first one to match the potential block will apply. If none of them are available, the default will be Gavelkind. Default succession law can also be implemented by events (for example, the events to make Eldership default for the pagans that use it).
  • For gender laws, it is determined by the "default_selection" block within the law definition.

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