Decision modding

From Crusader Kings II Wiki
Revision as of 00:24, 27 December 2014 by Romulien (talk | contribs) (Basic structure of decisions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Decisions need to be in the /decisions/ folder.

Decisions

Decisions are declared inside a block decisions = { } or plot_decisions = { }, and are shown in the Intrigue view.

Special scopes:

  • ROOT is the decision taker

Structure:

decision_name = {
  is_high_prio = yes # Will show an alert once decision is enabled
  potential = {
    #Conditions for the decision to appear
  }
  allow = {
    #Conditions for the decision to be enabled
  }
  effect = {
    #Commands executed when taking the decision
  }
  revoke_allowed = {
    always = no #Not used in vanilla
  }
  ai_will_do = {
    #Factors for an AI character to take the decision (1 = 100% chance)
  }
}

Targeted decisions

Targeted decisions are declared inside a block targetted_decisions = { } or vassal_decisions = { }, and are shown in the Diplomacy view.

Note: vassal_decisions seem to be a shortcut for targetted_decisions with ai_target_filter = vassals

Special scopes:

  • FROM is the decision taker
  • ROOT is the targeted character

In order to limit CPU load, filter / ai_target_filter specify the types of targeted characters (for the player / the AI respectively), for which potential and allow blocks will be evaluated:

  • self: self MUST be set for decisions targeting only the taker
  • spouse: decision taker spouses
  • court: all characters in the decision taker host court, including prisoners, and characters currently away (wards, prisoners, etc)
  • home_court: all characters in the decision taker home court, including prisoners, and characters currently away (wards, prisoners, etc)
  • vassals: direct vassal rulers of the decision taker employer
  • sub_realm: all characters below the decision taker employer
  • realm: all characters in the same top realm as the decision taker
  • dynasty: all members of the same dynasty, including the dead
  • rivals: decision taker's rivals plus any character that have an opinion modifier with 'crime = yes' set (the same set of characters the 'is_foe' trigger evaluates)
  • all: all living characters (to be avoided, very CPU heavy !)

Structure:

decision_name = {
  is_high_prio = yes # Will show an alert if special action is available
  filter = sub_realm #Filter characters targeted by the player
  ai_target_filter = dynasty #Filter for characters targeted by the AI
  from_potential = {
    #Conditions on the decision taker for the decision to appear
  }
  potential = {
    #Conditions on the targeted character for the decision to appear
  }
  allow = {
    #Conditions for the decision to be enabled
  }
  effect = {
    #Commands executed when taking the decision
  }
  revoke_allowed = {
    always = no #Not used in vanilla
  }
  ai_will_do = {
    #Factors for an AI character to take the decision (1 = 100% chance every month - for each allowed target!)
  }
}

Demesne laws

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

Structure:

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
  }
  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, ...
}

De jure laws

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

Laws ending with 0 (crown_authority_0 and investiture_law_0) are used as default at game start.

Structure:

law_name = {
  show_as_title = yes
  group = crown_authority
  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
  }
  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, ...
}

Succession laws

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.

The first sucession laws to be loaded (succ_gavelkind in vanilla) is used as default, when not specified in history files.

Structure:

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
  }
}

See also