Difference between revisions of "Succession modding"

From Crusader Kings II Wiki
Jump to navigation Jump to search
(Localisation)
(Succession voting)
 
(7 intermediate revisions by one other user not shown)
Line 4: Line 4:
 
Succession type customization is very limited. Theoretically, you could use a 'vote' type succession without voters to choose a very specific heir. Handing out titles in a specific manner is not possible.<sup><small>[Needs verification]</small></sup>
 
Succession type customization is very limited. Theoretically, you could use a 'vote' type succession without voters to choose a very specific heir. Handing out titles in a specific manner is not possible.<sup><small>[Needs verification]</small></sup>
  
== Succession format ==
+
== Succession law format ==
Succession types go in <code>/common/laws</code>.
+
 
 +
Succession laws go in <code>/common/laws</code>.
 
<pre>
 
<pre>
<succession_name> = {
+
succession_laws = {  # Must wrap in a succession laws block.
    # Modifiers applied to the ruler.
+
 
    child_opinion = 42
+
    <succession_name> = {
 +
        # Modifiers applied to the ruler.
 +
        child_opinion = 42
 +
 
 +
        potential = {
 +
            # Conditions for the succession to be visible in the UI.
 +
        }
  
    potential = {
+
        allow = {
        # Conditions for the succession to be visible in the UI.
+
            # Conditions that allow the succession to be implemented.
    }
+
        }
  
    allow = {
+
        effect = {
        # Conditions that allow the succession to be implemented.
+
            # What happens when the succession is implemented.
    }
+
            succession = primogeniture        # Plain succession without voting.
  
    effect = {
+
            succession = {                     # The heir is selected by vote.
        # What happens when the succession is implemented.
+
                base_type = <base_type_name>  # See "Base succession type" below
        succession = primogeniture        # Plain succession without voting.
+
                voting_rules = <voting_rules>  # Defined in /common/succession_voting
 +
            }
  
        succession = {                    # The heir is selected by vote.
+
            # Dunno. Fix me!!
             base_type = <base_type_name>  # See "Base succession type" below
+
             elective_voting_rules = ???
            voting_rules = <voting_rules>  # Defined in /common/succession_voting
 
 
         }
 
         }
    }
 
  
    revoke_allowed = {
+
        revoke_allowed = {
        # ???
+
            # ???
        always = no
+
            always = no
 +
        }
 
     }
 
     }
 
}
 
}
Line 49: Line 56:
 
|-
 
|-
 
| <code>elective_gavelkind</code>
 
| <code>elective_gavelkind</code>
| Titles are divided up amongst the ruler's children, with the elected heir getting the primary title.
+
| Elective. Titles are divided up amongst the ruler's children, with the elected heir getting the primary title.
 
|-
 
|-
 
| <code>tanistry</code>
 
| <code>tanistry</code>
| The ruler and all vassals at one and two ranks below can nominate an heir - the Tanist - from among the members of the ruler's dynasty. Vassals will tend to favor older members from other branches of the family, especially claimants.
+
| Elective. The ruler and all vassals at one and two ranks below can nominate an heir - the Tanist - from among the members of the ruler's dynasty. Vassals will tend to favor older members from other branches of the family, especially claimants.
 
|-
 
|-
 
| <code>feudal_elective</code>
 
| <code>feudal_elective</code>
| All titles go to the elected heir.
+
| Elective. All titles go to the elected heir.
 
|-
 
|-
 
| <code>seniority</code>
 
| <code>seniority</code>
Line 70: Line 77:
 
|-
 
|-
 
| <code>papal_succession</code>
 
| <code>papal_succession</code>
| The Pope is elected by the College of Cardinals depending on age, piety, popularity and other factors.
+
| Elective. The Pope is elected by the College of Cardinals depending on age, piety, popularity and other factors.
 
|-
 
|-
 
| <code>appointment</code>
 
| <code>appointment</code>
Line 76: Line 83:
 
|-
 
|-
 
| <code>open_elective</code>
 
| <code>open_elective</code>
| All vassals and courtiers get a vote and decide on a successor from among themselves.
+
| Elective. All vassals and courtiers get a vote and decide on a successor from among themselves.
 
|-
 
|-
 
| <code>catholic_bishopric</code>
 
| <code>catholic_bishopric</code>
Line 82: Line 89:
 
|-
 
|-
 
| <code>patrician_elective</code>
 
| <code>patrician_elective</code>
| This is the succession type in the great naval Merchant Republics. The next Doge is determined from among the heads of the five grand Patrician families depending on Age, Prestige, and invested Campaign Funds.
+
| Elective. This is the succession type in the great naval Merchant Republics. The next Doge is determined from among the heads of the five grand Patrician families depending on Age, Prestige, and invested Campaign Funds.
 
|-
 
|-
 
| <code>nomad_succession</code>
 
| <code>nomad_succession</code>
Line 91: Line 98:
 
|-
 
|-
 
|}
 
|}
 +
 +
== Succession voting ==
 +
 +
Succession voting scripts go in <code>/common/succession_voting</code>.
 +
<pre>
 +
<succession_voting_name> = {
 +
 +
    # ROOT is the potential elector, FROMFROM is the title.
 +
    elector_selection = {      # Determine who is allowed to vote.
 +
 +
        days = -5              # This has nothing to do with days. This is the current character's score.
 +
                              # A positive score means they are allowed to vote, and a negative score means
 +
                              # they are not. This line by itself means no-one is allowed to vote.
 +
 +
        additive_modifier = {
 +
            value = 10        # Add 10 score if ...
 +
            FROMFROM = {      # this character is the current ruler.
 +
                holder_scope = {
 +
                    character = ROOT
 +
                }
 +
            }
 +
        }
 +
    }
 +
 +
    # ROOT is the elector, FROMFROM is the title.
 +
    elector_vote_strength = {  # Determine how many votes electors get.
 +
 +
        days = 1              # This has nothing to do with days. This is the number of votes the elector gets.
 +
    }
 +
 +
    # ROOT is the title holder, FROM is the potential candidate, FROMROM is the title.
 +
    candidate_trigger = {      # Determines who can be voted for.
 +
 +
        dynasty = FROM        # This character is a valid candidate if they are of the same dynasty as the ruler (includes the ruler).
 +
    }
 +
 +
    # ROOT is the elector, FROM is the candidate.
 +
    candidate_vote_score = {  # Determines the score an elector will assign to a candidate.
 +
                              # The candidate with the highest score will recieve the elector's votes.
 +
 +
        days = 0              # Yes, days means score again.
 +
 +
        additive_modifier = {  # Add or subtract score in additive_modifiers.
 +
            value = 999
 +
            localisation_key = tooltip_feudal_elector_vote_myself  # Text that will appear in the UI related to elections.
 +
            character = FROM  # If we are the candidate, vote for ourself!
 +
        }
 +
    }
 +
}
 +
</pre>
  
 
== Localisation ==
 
== Localisation ==
Line 96: Line 153:
  
 
<code><succession_name></code> for the name, <code><succession_name>_desc</code> for the description.
 
<code><succession_name></code> for the name, <code><succession_name>_desc</code> for the description.
 +
 +
 +
{{ModdingNavbox}}
 +
{{ModdingGuidesNavbox}}
 +
[[Category:Modding|#]]
  
 
{{stub}}
 
{{stub}}

Latest revision as of 17:01, 15 June 2021

Succession type customization is very limited. Theoretically, you could use a 'vote' type succession without voters to choose a very specific heir. Handing out titles in a specific manner is not possible.[Needs verification]

Succession law format[edit]

Succession laws go in /common/laws.

succession_laws = {  # Must wrap in a succession laws block.

    <succession_name> = {
        # Modifiers applied to the ruler.
        child_opinion = 42

        potential = {
            # Conditions for the succession to be visible in the UI.
        }

        allow = {
            # Conditions that allow the succession to be implemented.
        }

        effect = {
            # What happens when the succession is implemented.
            succession = primogeniture         # Plain succession without voting.

            succession = {                     # The heir is selected by vote.
                base_type = <base_type_name>   # See "Base succession type" below
                voting_rules = <voting_rules>  # Defined in /common/succession_voting
            }

            # Dunno. Fix me!!
            elective_voting_rules = ???
        }

        revoke_allowed = {
            # ???
            always = no
        }
    }
}

Base succession type[edit]

All succession types must use a hard-coded 'base type', which determines who the heirs are, if there are voters, and what titles the heirs receive upon death of the current ruler.

Name Description
gavelkind The titles of the ruler are divided among his children, with the oldest getting the primary title. If the ruler has no children who can inherit, the law defaults to Primogeniture. You get no Prestige penalty for having unlanded sons, and can have a 30% larger demesne. Gavelkind is a very popular law with everyone except the oldest child. Destruction of titles while under Gavelkind succession is not allowed.;
elective_gavelkind Elective. Titles are divided up amongst the ruler's children, with the elected heir getting the primary title.
tanistry Elective. The ruler and all vassals at one and two ranks below can nominate an heir - the Tanist - from among the members of the ruler's dynasty. Vassals will tend to favor older members from other branches of the family, especially claimants.
feudal_elective Elective. All titles go to the elected heir.
seniority All titles go to the oldest living member of the ruling dynasty.
primogeniture All titles go to the oldest child of the ruler.
ultimogeniture All titles go to the youngest child of the ruler.
turkish_succession The most powerful child of the ruler succeeds, though other influential children are likely to intervene... The law is very popular with your offspring, with the exception of the oldest one. The rest of your dynasty also approves. This succession is likely the one used by Iqta governments.[Needs verification]
papal_succession Elective. The Pope is elected by the College of Cardinals depending on age, piety, popularity and other factors.
appointment On death, all titles revert back to the liege. The succession of duchy and kingdom viceroyalties.
open_elective Elective. All vassals and courtiers get a vote and decide on a successor from among themselves.
catholic_bishopric If the liege lord has nominated a successor, he succeeds. Otherwise, the Papal Candidate is chosen.
patrician_elective Elective. This is the succession type in the great naval Merchant Republics. The next Doge is determined from among the heads of the five grand Patrician families depending on Age, Prestige, and invested Campaign Funds.
nomad_succession Under Nomad Succession, the son or brother with the most Prestige normally inherits, but prestigious Clan leaders also stand a chance if their Population is bigger than the Khagan's. Wrong-culture characters are disqualified and adults have precedence over children. If the Khagan's primary heir is still a child, the Khaganate is lost to one of the Clan chiefs. Clan chiefs with more Prestige than the heir get Claims on the Khaganate.
offmap_succession This succession type generates a character of China's culture and religion. They have decent (4-10) stats, and good (7-11) stewardship, and will always have a Stewardship education. The offmap power defined in the top liege's government is used to determine the culture and religion. Will not function if this isn't defined

Succession voting[edit]

Succession voting scripts go in /common/succession_voting.

<succession_voting_name> = {

    # ROOT is the potential elector, FROMFROM is the title.
    elector_selection = {      # Determine who is allowed to vote.

        days = -5              # This has nothing to do with days. This is the current character's score.
                               # A positive score means they are allowed to vote, and a negative score means
                               # they are not. This line by itself means no-one is allowed to vote.

        additive_modifier = {
            value = 10         # Add 10 score if ...
            FROMFROM = {       # this character is the current ruler.
                holder_scope = {
                    character = ROOT
                }
            }
        }
    }

    # ROOT is the elector, FROMFROM is the title.
    elector_vote_strength = {  # Determine how many votes electors get.

        days = 1               # This has nothing to do with days. This is the number of votes the elector gets.
    }

    # ROOT is the title holder, FROM is the potential candidate, FROMROM is the title.
    candidate_trigger = {      # Determines who can be voted for.

        dynasty = FROM         # This character is a valid candidate if they are of the same dynasty as the ruler (includes the ruler).
    }

    # ROOT is the elector, FROM is the candidate.
    candidate_vote_score = {   # Determines the score an elector will assign to a candidate.
                               # The candidate with the highest score will recieve the elector's votes.

        days = 0               # Yes, days means score again.

        additive_modifier = {  # Add or subtract score in additive_modifiers.
            value = 999
            localisation_key = tooltip_feudal_elector_vote_myself  # Text that will appear in the UI related to elections.
            character = FROM   # If we are the candidate, vote for ourself!
        }
    }
}

Localisation[edit]

Standard localisation rules apply.

<succession_name> for the name, <succession_name>_desc for the description.