角色模组制作

本页面所适用的版本可能已经过时,最后更新于2.7
咯咯炀讨论 | 贡献2020年12月25日 (五) 20:35的版本 (15:36, 6 June 2020‎ 120.235.188.48)
Character data show up on the character screen. Note that character titles are indirectly defined via title history.
Once common ancestors of characters from the same dynasty are setup, it will form a clean dynastic tree.

Characters are defined in the files contained within /history/characters/ folder.

Structure

These files contain blocks of unique character IDs with the following basic structure:

<char_ID> = {

  #Character attributes

  name = "John"
  dynasty = <dynasty_ID>
  religion = <religion>
  culture = <culture>
  father = <char_ID>
  mother = <char_ID>

  #Character history

  <yyyy.mm.dd> = {
    birth = yes
  }
  <yyyy.mm.dd> = {
    death = yes
  }
}

For instance:


 122 = {
     name="Harold" # Godwineson, king of England
     dynasty=756
     dna="medjejoencc" 
     properties="ae00e0"
     martial=8
     diplomacy=6
     intrigue=5
     stewardship=6
     religion="catholic"
     culture="saxon"
     add_trait="arbitrary"
     add_trait="proud"
     add_trait="skilled_tactician"
     father=120
     mother=101534
     1025.1.2={
          birth=yes
     }
     1048.1.1={
          add_spouse=131 #Ealdgyth 'Swanneck'
     }
     1064.1.1={
          remove_spouse = 131
     }
     1065.6.6={
          add_spouse=123 #Ealdgyth of Mercia
     }
     1066.9.14 = {
          raise_levies = {
               location = 62 # Leicester
               force_mult = 2.5
          }
     }
     1066.10.14={
          raise_levies = {
               dismiss = yes
               location = 62 # Leicester
               force_mult = 2.5
          }
          death = {
               death_reason = death_battle
               killer = 140
          }
     }
 }

Character attributes

The following attributes can be used to define characters:

Attribute Type Description Example
name string Name of the character, as it will appear in the game. Not a localization key name = "Harold"
female bool Character's sex female = yes
dynasty dynastyID Dynasty of the character, using a numerical ID corresponding to one from the Dynasty modding file.If you want to create a random dynasty just write dynasty=random,and if you want to change to a new dynasty in an event,you

can write dynasty=father_bastard Warning: dynasty=none doesn't work anymore.[1][2] Use the effect={ dynasty=none } in the birth date clause.

dynasty = 756
1000.1.1= { birth=yes effect= { dynasty=none } }
father charID Father of the character, using a unique numerical ID father = 120
real_father charID Not used in vanilla real_father = 121
mother charID Mother of the character, using a unique numerical ID mother = 101534
dna string An 11-digit alphanumerical code, that contributes to the game engine's genetics and inheritance system, defining the appearance of a character. See Portrait modding dna = "medjejoencc"
properties string A 6-digit or 11-digit alphanumerical code defining the character's clothing, headgear etc. See Portrait modding properties = "ae00e0"

properties = "aj00bb00000"

martial integer Base martial skill of the character martial = 8
diplomacy integer Base diplomacy skill of the character diplomacy = 6
intrigue integer Base intrigue skill of the character intrigue = 5
stewardship integer Defines the base stewardship skill of the character stewardship = 6
learning integer Base learning skill of the character learning = 4
health integer Base health of the character health = 7
fertility float Base fertility of the character fertility = 0.8
religion religion Character's religion, using an ID from the religion files religion = "catholic"
secret_religion religion Character's secret religion, using an ID from the religion files secret_religion = "bon"
culture culture Character's culture, using an ID from the culture files culture = "saxon"
race culture Character's "race", using an ID from the culture files. The character's graphical culture and appearance will use the culturegfx assigned to that culture. Used for characters of a different ethnicity than the culture they were raised in (e.g. adoption), not used in the Vanilla rendition. race = "mongol"
trait / add_trait trait Adds a trait to the character, using an ID from the traits files. Characters without traits will be randomly assigned several on game start. trait = "skilled_tactician"
disallow_random_traits bool Prevents additional traits from being randomly assigned to a character by the game, except through subsequent events disallow_random_traits = yes
occluded bool See Portrait modding occluded = yes
historical bool Flags the character as important, so that they will never be pruned from the database[3] historical = yes
easter_egg bool Prevents the character from being assigned to a society at game start easter_egg = yes

Character history

Important events in the character's life - such as birth, marriage and marrying a spouse - are defined as group tags by year and date. CKII uses as year.month.day format, so a character born on the 3rd January 874 would be defined as such:

874.1.3 = {
    birth = yes
}

The group tag defines the date of the event, while flags within the group tag define both what the event is and, for birth and death only, what date will be displayed. Mismatching dates are not fatal, but may be confusing in-game.

Each group tag date with a character definition can contain some history commands.

List of history commands

Note: in case there is no dedicated history command, it is possible to execute a character scope command via the general purpose effect clause.

Attribute Type Description Example
birth yes/date Defines when the character was born birth = yes
death yes/date/clause Defines when the character dies. Inside the clause, can specify:
  • death_reason: the cause of death. Possible values: death_natural (default), death_trait (health trait complication, see trait modding), death_murder, death_murder_unknown, death_hashshashin, death_battle, death_duel, death_execution, death_dungeon, death_sacrificed, death_accident, death_suicide, death_rabble, death_childbirth.
  • killer: the killer/executor (charID), ex: killer = 122
death = yes

death = {death_reason = death_murder killer = 191004}

add_claim title Adds a strong claim to the character, corresponding to an alphanumerical ID from the landed titles files.

Note: to add a weak claim the following can be used:

effect = {
  add_weak_claim = k_england
}
add_claim = k_england
remove_claim title Removes a claim remove_claim = k_england
add_spouse charID Defines a marriage between the character and another. Uses a character ID add_spouse = 121
add_matrilineal_spouse charID add_matrilineal_spouse = 121
add_consort charID Makes another character this character's consort/concubine. Uses a character ID add_consort = 121
remove_spouse charID Defines the end of a marriage between the character and another. Uses a character ID remove_spouse = 121
add_lover charID add_lover = 122
employer charID Will move the character to the court of another character. Uses a character ID employer = 122
give_job_title job Usually used under the same date tag as employer, to give the character a job in another character's court give_job_title = job_marshal
give_nickname nickname Gives the character a nickname, corresponding to an alphanumerical ID from the nicknames files give_nickname = nick_the_great
prestige int prestige = -50
piety int piety = -50
decadence int decadence = 50
wealth int wealth = -500
remove_trait trait remove_trait = "crusader"
capital title Moves the capital capital = c_toledo
dynasty dynasty Changes the dynasty dynasty = 101183
effect commands Commands to apply at that date, in character scope. Note that these commands are only executed once the game starts, which could cause discrepencies on the lobby[4]. Will only execute if the character is not dead. effect = { give_minor_title = title_despot }

effect = { set_character_flag = is_ragnar_lodbrok }

effect_even_if_dead commands As above, but will be executed even after the character's death.
raise_levies clause See details below
raise_levies = {
  location=340 # Palermo
  force_mult=1.5
}
immortal_age int Sets the physical age at which a character became immortal. Must add a trait with immortal also!

Note that without immortal_age, a character that is between 256 and 271 (255+16) years old at any given start date will appear as a child (forever) due to an integer overflow.[5]

immortal_age = 20

Raise levies

The following code is used to make Harold Godwineson raise an army in Leicester, 2.5 times the ordinary levy size, on 14 September 1065:

1066.9.14 = {
    raise_levies = {
        location = 62 # Leicester
        force_mult = 2.5
    }
}

The next month, Harold Godwineson can be made to dismiss his army, having lost the Battle of Hastings:

1066.10.14={
    raise_levies = {
        dismiss = yes
        location = 62 # Leicester
        force_mult = 2.5
    }
}

Of course, Harold also died during the battle, so one can add a death group tag, within which one can specify that he died in battle and was killed by William the Conqueror (ID 140):

1066.10.14={
    raise_levies = {
        dismiss = yes
        location = 62 # Leicester
        force_mult = 2.5
    }
    death = {
        death_reason = death_battle
        killer = 140
    }
}

Wikipedia link

To enable the Wikipedia icon link (opening in out-of-game browser), create a localization key with format W_L_<character_ID>:

W_L_200600;http://en.wikipedia.org/wiki/Sverker_I_of_Sweden;http://fr.wikipedia.org/wiki/Sverker_Ier_de_Su%C3%A8de ;;;;;;;;;;;;x

References