首页所有页面

特质模组制作


Traits 是CKII的重要组成部分,因此也适用于任何大改模组。本文将为你解释关于特质模组的所有需要了解的内容。强烈推荐用Notepad++来修改特质,但也可以使用Notepad或其他纯文本编辑器。


Definition

特征必须在 common/traits/ 文件夹中定义。 要制作这个特质,你首先需要告诉游戏它有什么效果。这会在这里完成。在本教程中,将以“自私”特质作为示例。首先,给这个特征起个名字:

selfish = {

}

Type

在定义了性状本身后,你还需要定义它的标志。你可以使用的旗帜如下。

游戏中的特质图标按类型从左到右分组: education, caste_tier, undefined, lifestyle, personality, is_health. 在一个群体内部,顺序是基于特质添加到角色的顺序。

代码名称 Value 描述 例子 代码
agnatic bool 有这种特质的父亲的孩子总是会继承这种特质。 Sayyid.png agnatic = yes
birth int 10000个出生的角色中带有这种特质的个数。(例如,100 = 1%) birth = 100
blinding bool 该特质反映了角色在被囚禁期间永久失明的情况。在某些文化中,这会使他们被剥夺继承权。 Blinded.png blinding = yes
cached bool 所有具有该特征的角色都会被缓存,以更高效地进行事件触发评估(应有数量限制)。

Then the character scope <trait_name> = {} 可以用来覆盖所有拥有该特质的角色。

cached = yes
can_hold_titles bool 此特质禁止角色持有任何头衔。 Horse.png can_hold_titles = no
cannot_inherit bool 此特质禁止角色继承任何头衔。 Monk.png cannot_inherit = yes
cannot_marry bool 此特质禁止角色结婚。查看词条can_marry。不会禁止纳妾 Monk.png cannot_marry = yes
caste_tier int 此特质是种姓特质,caste_tier定义了种姓的顺序。 Brahmin.png caste_tier = 3
customizer bool 如果为非,该特质不会在角色设计器中可供选择。 customizer = no
education bool 此特质是一种教育特质。 Amateurish plotter.png education = yes
attribute attribute 主要属性,如教育特质。 Amateurish plotter.png attribute = intrigue
enatic bool 有这种特质的母亲的孩子总是会继承这种特质。 enatic = yes
hidden bool 隐藏特质不会在角色界面显示。 hidden = yes
immortal bool 一旦拥有此特质,角色既不会衰老也不会自然死亡(但会死于处决或效果死亡)。参见词条永生 immortal = yes
in_hiding bool 此特质会激活“藏匿中”(in_hiding )效果。 In hiding.png in_hiding = yes
inbred bool 此特质表明该角色是近亲繁殖的,会影响后代、生育能力及自然死亡原因。 Inbred.png inbred = yes
incapacitating bool 这个角色很虚弱且需要摄政 Incapable.png incapacitating = yes
inherit_chance int 新生儿可以从父母那里继承这种特质的概率(可选);如果父母双方都有这种特质,则为两次相同概率之和。 inherit_chance = 15
both_parent_has_trait_inherit_chance int Dwarf.png both_parent_has_trait_inherit_chance = 50
is_epidemic bool The trait is given by an epidemic outbreak. See has_epidemic condition. Tuberculosis.png is_epidemic = yes
is_health bool 该特质影响角色的生命值,通常限制某些需要满血的事件。参见 health_traits condition. Stressed.png is_health = yes
is_illness bool The trait is a regular disease. See is_ill condition and cure_illness effect. Ill.png is_illness = yes
leader bool The trait is a command/leadership trait. See can_have_more_leadership_traits condition. Light foot leader.png leader = yes
leadership_traits int 角色会自动获得一定数量的领导力特质(军队指挥特质)。 leadership_traits = 1
childhood bool The trait is a childhood trait. Willful.png childhood = yes
lifestyle bool The trait is a lifestyle choice. See lifestyle_traits condition. Scholar.png lifestyle = yes
opposites List<trait> 不能同时拥有该特征的特征列表 opposites = { imbecile quick genius }
personality bool The trait is a personality trait (see trigger personality_traits = <min. count>) Lustful.png personality = yes
prevent_decadence bool The trait prevents the Muslim character from accumulating decadence prevent_decadence = yes
priest bool The trait implies a theological education. See is_priest condition) Detached priest.png priest = yes
pilgrimage bool The character is temporarily away and will need a regent but does not lose any wards On pilgrimage.png pilgrimage = yes
random bool With random = no该特性不会授予随机生成的角色(游戏开始时或角色生成时,非出生时)。 random = yes 是默认。具体语义会根据一般性状类型而变化。 random = no
rebel_inherited bool 在原版中用于农民领袖和异端领袖。当拥有这些特质的角色赢得叛乱战争却无继承人时,继承者也会获得农民领袖/异端领袖特质。 Peasant Leader.png rebel_inherited = yes
religious bool 这一特质具有宗教性质,宗教发生变化后应自动被抛弃。注:异教改革后也会被废弃。 Mutazilite.png religious = yes
religious_branch religion 该特征表明该宗教的一个教派。这也会让孩子出生时继承该特征。 Shaivist hindu.png religious_branch = jain
ruler_designer_cost int 为该特质设定一个自定义成本(以统治者年龄的年限计,正负值)在 Ruler Designer. ruler_designer_cost = -20
tolerates_<religion_group> bool 角色容忍该宗教群体的角色,也被他们容忍。<religion_group> 是动态的,可能是原版中不存在的群。 Sympathy Christendom.png tolerates_christian = yes

tolerates_jewish_group = yes
tolerates_muslim = yes
tolerates_pagan_group = yes
tolerates_zoroastrian_group = yes
tolerates_indian_group = yes

same_trait_visibility bool 只有当玩家也拥有该特质时,该特质才会在其他角色身上显现。对秘密社团、邪教和秘密熊类很有帮助。

This is a shortcut for:

is_visible = { 

	OR = {

		character = FROM

		has_trait = <trait>

	}

}

Not used in vanilla same_trait_visibility = yes
hidden_from_others bool 这个特性只有拥有该特性的玩家才能看到,甚至其他拥有相同特性的玩家也看不到。

This is a shortcut for is_visible = { character = FROM }.

Secretly Cathar.png hidden_from_others = yes
is_visible conditions Conditions for the trait to be visible:
  • ROOT the character looking at the trait
  • FROM is the character with the trait

通常角色应该看到自己的特质,至少是这样 character = FROM is used.

Secretly Catholic.png
is_visible = {

  OR = {

    character = FROM

    society_member_of = secret_religious_society_catholic

    AND = {

      is_close_relative = FROM

      trait = secretly_catholic

    }

  }

}

vice bool Lustful.png vice = yes
virtue bool Charitable.png virtue = yes
succession_gfx bool Wounded.png succession_gfx = yes
is_symptom bool Cough.png is_symptom = yes

对于“自私”特质,则会使用人格标志。请注意,一个特质可以同时使用多个旗帜。

selfish = {

  personality = yes

}

Modifiers

主条目:Modifiers

设置好特性标志后,你可能会想赋予它一些个性 modifiers and/or a command modifier.


对于“自私”,则适当给予管理权福利和外交惩罚。

selfish = {

  personality = yes
管理权 = 2 # CKII 引擎不识别 '+',仅在给出正数时写入数字 diplomacy = -1 }

Regarding relations,没人喜欢自私的人,所以在我们这里,我们必须加上一个相反的词,分别表示慈善和一个general_opinion:

 selfish = {

  personality = yes
stewardship = 2 # The CKII engine doesn't recognize '+', simply write the number when giving positive numbers diplomacy = -1
opposites = { trait = charitable }
opposite_opinion = -30 general_opinion = -10 }

关于AI权重,影响非玩家角色的行为(大多数主要影响战略考虑),关于“自私”特质,ai_rationality会更好。

selfish = {

  personality = yes
stewardship = 2 # The CKII engine doesn't recognize '+', simply write the number when giving positive numbers diplomacy = -1
opposites = { trait = charitable }
opposite_opinion = -30 general_opinion = -10
ai_rationality = -10 }

Potential

潜在部分定义了谁可以在战役开始时随机拥有该特质,谁可以随机生成该特质(例如通过就业 decisions),或者在成年时随机获得。但它不会影响 events 赋予了该特质;即使角色未达到潜力 conditions he can still get the trait via events.

潜在部分仅是一个或多个条件。它紧接着该特征的开句括号之后。例如,我们可能想防止游戏产生自私的孩子。

selfish = {

  potential = {

     年龄 = 16 #This 防止任何未满16岁的人获得该特征

  }

  personality = yes
stewardship = 2 # The CKII engine doesn't recognize '+', simply write the number when giving positive numbers diplomacy = -1
opposites = { trait = charitable } opposite_opinion = -30 general_opinion = -10
ai_rationality = -10 }

Compliments

Since Way of Life 可以通过[GetRootFromCompliment]和[GetRootFromInsult](等)本地化命令,为其他字符的信件中或任何其他本地化文本中出现的赞美和侮辱定义本地化键。这些密钥需要 localised.

Flag Description Code
male_compliment

female_compliment

Compliments in a letter to a man/woman male_compliment = COMPL_SCHOLAR
male_compliment_adj

female_compliment_adj

Positive Adjectives in a letter to a man/woman male_compliment_adj = COMPL_LEARNED
male_insult

female_insult

Insults in a letter to a man/woman male_insult = INSULT_TORTURER
male_insult_adj

female_insult_adj

Negative Adjectives in a letter to a man/woman male_insult_adj = INSULT_EVIL
child_compliment 孩子写的信里的赞美,用来代替成人的信 child_compliment = COMPL_SMARTY
child_compliment_adj 儿童写信中使用的正面形容词,代替成人的形容词 child_compliment_adj = COMPL_CLEVER
child_insult 用孩子写的侮辱信代替成人信件 child_insult = INSULT_PEABRAIN
child_insult_adj 儿童写信中使用的负面形容词,代替成人形容词 child_insult_adj = INSULT_STUPID
selfish = {

  potential = {

     age = 16

  }

  personality = yes

  stewardship = 2

  diplomacy = -1

  opposites = {

     trait = charitable

  }

  

  opposite_opinion = -30

  general_opinion = -10

  ai_rationality = -10

  

  male_insult = INSULT_SELFCENTERED

  female_insult = INSULT_SELFCENTERED

  male_insult_adj = INSULT_SELFISH

  female_insult_adj = INSULT_SELFISH

}

Icon

图标让特质易于玩家识别。图标可以用Photoshop或其他图片编辑器制作。需要是24x24像素,保存为.dds或.tga文件。

当你有了图标后,把它保存在<yourmodfolder>\gfx\traits里。现在在 <yourmodofolder>\interface\<yourmod>.gfx 创建一个文件。你将用这个文件告诉游戏图标存储在哪里。

Start by adding this to the file:

spriteTypes = {

	spriteType = {

	

	}

}

Make sure that you never repeat the spriteTypes block! You should instead be adding spriteType (末尾无“s”)开闭内的项{ 大括号/大括号}。

Now, add a line for the name:

spriteType = {

  name = "GFX_trait_<nameofthetrait>"

}

现在你应该添加一行,告诉游戏图标存放在哪里:

spriteType = {

  name = "GFX_trait_<nameofthetrait>"

  texturefile = "gfx/traits/<nameofthetraiticon>.tga"

}

Add some standard lines at the end:

spriteType = {

 name = "GFX_trait_<nameofthetrait>"

 texturefile = "gfx/traits/<nameofthetrait>.tga"

 noOfFrames = 1

 norefcount = yes

 effectFile = "gfx/FX/buttonstate.lua"

}

For our 'selfish' trait, this would look like this:

spriteType = {

 name = "GFX_trait_selfish"

 texturefile = "gfx/traits/selfish.tga"

 noOfFrames = 1

 norefcount = yes

 effectFile = "gfx/FX/buttonstate.lua"

}

保存文件后,你的特质现在应该会有一个图标。

Localisation

主条目:Localisation

Traits require the following localization keys:

  • <trait_name> : name of the trait
  • <trait_name>_desc : description of the trait
  • <trait_name>_death : in case the trait reduces heath (health = -1),用于描述“因性状过早死亡”的原因(death_reason = death_trait)。例如:
ill_death;after a period of illness;d'une grave maladie;nach einer Zeit der Krankheit;;después de un período de enfermedad;;;;;;;;;x

如果我们用自私特质这样做,我们会得到这样一个:

selfish;Selfish;Égoïste;Selbstsüchtig;;Egoísta;;;;;;;;;x

selfish_desc;This character is Selfish and only thinks about himself;Ce personage est Égoïste et ne pense qu'a lui;German;;Spanish;;;;;;;;;x

把本地化保存为.csv文件。一旦你做到了,你就完成了,现在你拥有了一个新的特质!

See also

相关页面 (95)

Amateurish plotterBlindedBrahminCharitableConcubinageConditionsCoughDecisionsDetached priestDwarfEU4转档器模组制作Event moddingEventsHorseIllImmortalIn hidingInbredIncapableLight foot leaderLocalisationLustfulModifiersMonkMutaziliteOn pilgrimagePeasant LeaderRegentRelationsRuler DesignerSayyidScholarScopeSecretly CatharSecretly CatholicShaivist hinduSteam创意工坊StressedSympathy ChristendomTraitsTuberculosisWay of LifeWillfulWounded事件模组制作作用域修正内阁成员模组制作决议模组制作剧本模组制作单位模组制作历史模组制作另类开局模组制作图形模组制作地图外政权模组制作地图模组制作头衔模组制作奇观模组制作宗教模组制作定义