角色模组制作

本页面所适用的版本可能已经过时,最后更新于2.7
Wanglish讨论 | 贡献2022年5月5日 (四) 17:53的版本
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
角色数据显示在角色屏幕上。请注意,角色头衔是通过头衔历史记录间接定义的。
一旦家族人物的共同祖先被设置,它将形成一棵干净的家族树。

预制角色被定义在 /history/characters 文件夹的文件里。

角色文件结构

预制角色文件具有以下基本结构:

<char_ID> = {

  #角色属性

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

  #角色历史

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

例如:


 122 = {
     name="Harold" #哈罗德.戈德温,英格兰的国王
     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
          }
     }
 }

角色属性

以下属性可用于定义角色:

属性 类型 描述 示例
name string 角色的名称,因为它将出现在游戏中。不是本地化键 name = "Harold"
female bool 角色性别 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

角色历史

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.

历史命令列表

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

维基链接

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

引用