特质模组制作:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.0
第15行: 第15行:
}
}
</pre>
</pre>
=== Special trait flags ===
=== 特殊特质旗标 ===
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | 名称
! width="25%" | Description
! width="25%" | 描述
! width="25%" | Usage
! width="25%" | 用法
|-
|-
|index
|index
|用于保存文件的数字标识符。最多可以 是 65535
|用于保存文件的数字标识符 (索引值) 。最多可以 是65535。
|index = X
|index = X
|-
|-
|health
|health
|改变实际健康值
|改变实际健康值
|health = X.X
|health = X.X
|-
|-
|fertility
|fertility
|生育 百分比修改器
|生育 百分比修改器
|fertility = X.X
|fertility = X.X
|-
|-
|inherit_chance
|inherit_chance
|遗传给子女的几率
|遗传给子女的几率
|inherit_chance = X
|inherit_chance = X
|-
|-
|birth
|birth
|100个角色中,有多少个角色天生就有这个特 (不遗传时)。可以有小数
|100个角色中,有多少个角色天生就有这个特 (不遗传时)。可以有小数
|birth = X
|birth = X
|-
|-
|random_creation
|random_creation
|在100个角色中,有多少角色是带着这个特 被创造出来的?( 相对于实际出生而言,这是对生成角色、剧本角色等而言的。)
|在100个角色中,有多少角色是带着这个特 被创造出来的? 相对于实际出生而言,这是对生成角色、剧本角色等而言的。
|random_creation = X
|random_creation = X
|-
|-
第64行: 第64行:
|-
|-
|compatibility
|compatibility
|这不是一个好感修 改器 ,但可以被'compatibility_modifier'和'trait_compatibility'触发使用 。兼容性 是检查特质持有者与所列 特质 (另一个角色的)的 兼容 性。
|这不是一个好感修 ,但可以被'compatibility_modifier'和'trait_compatibility'触发使用 。Compatibility 是检查特质持有者与所列(另一个角色的) 特质 性。
|<pre>
|<pre>
compatibility = {
compatibility = {
第73行: 第73行:
|-
|-
|parent_inheritance_sex
|parent_inheritance_sex
|指定该 性状 是否可以从男性/女性/所有父母那里继承(默认为全部)。
|指定该 特质 是否可以从男性/女性/所有父母那里继承(默认为全部)。
|parent_inheritance_sex = male/female/all
|parent_inheritance_sex = male/female/all
|-
|-
|child_inheritance_sex
|child_inheritance_sex
|指定该 性状 是否可以由男性/女性/所有子代继承(默认为全部)。
|指定该 特质 是否可以由男性/女性/所有子代继承(默认为全部)。
|child_inheritance_sex = male/female/all
|child_inheritance_sex = male/female/all
|-
|-
|genetic
|genetic
|如果设置为 "是" (默认为 "否" ),继承将遵循以下规则。特质可以是隐性的。子女可以从显性和隐性的父 性状 中继承该 性状
|如果设置为 “yes” (默认为 “no” ),继承将遵循以下规则。特质可以是隐性的。子女可以从显性和隐性的父 母特质 中继承该 特质
 显性有100%的机会被继承,隐性的 性状 有50%的机会被继承。如果该 性状 从父母双方成功继承,它就会变成显性的。
 显性有100%的机会被继承,隐性的 特质 有50%的机会被继承。如果该 特质 从父母双方成功继承,它就会变成显性的。
 如果只从父母一方继承,则为隐性 性状
 如果只从父母一方继承,则为隐性 特质
|genetic = yes/no
|genetic = yes/no
|-
|-
|inherit_from_real_father
|inherit_from_real_father
|该 性状 是否应该从亲生(生)父亲那里继承?(默认为 "是")
|该 特质 是否应该从亲生(生)父亲那里继承?(默认为 “yes”)
|inherit_from_real_father = yes/no
|inherit_from_real_father = yes/no
|-
|-
|enables_inbred
|enables_inbred
|这个特 可以让角色的子女被考虑近亲繁殖 特性 (默认 没有 )。
|这个特 可以让角色的子女被考虑 近亲繁殖(默认 为“no” )。
 只有在父母有共同祖先的情况下,它才会启用近亲繁殖 的机会 ,所以如果父母没有关系,就不会有'近亲繁殖'的风险。
 只有在父母有共同祖先的情况下,它才会启用近亲繁殖 概率 ,所以如果父母没有关系,就不会有'近亲繁殖'的风险。
 如果近亲繁殖没有被父母的特质启用,但是有共同的祖先,那么有机会(和近亲繁殖特质启用时一样),孩子会得到一个随机的特质 ,enabling_inbred = yes。
 如果近亲繁殖没有被父母的特质启用,但是 他们 有共同的祖先,那么有机会(和近亲繁殖特质启用时一样),孩子会得到一个随机的特质 ,该特质enabling_inbred = yes。
|enables_inbred = yes/no
|enables_inbred = yes/no
|-
|-
|good
|good
|标记该特 好(默认 为否 )。
|标记该特 {{Ruby| 的|good}} (默认 为no )。
|good = yes/no
|good = yes/no
|-
|-
|genetic_constraint_all
|genetic_constraint_all
|当获得 性状 时,将采用这种遗传约束
|当获得 特质 时,将采用这种遗传约束
|genetic_constraint_all = beauty
|genetic_constraint_all = beauty
|-
|-
|forced_portrait_age_index
|forced_portrait_age_index
|角色将使用这个肖像年龄 指数 ,而不是标记为 " 通用 " 的某个年龄子基因。如果你想在它们之间随机化,你可以指定多个这样的索引。如果多个特征强制索引,则会在所有的索引之间随机化
|角色将使用这个肖像年龄{{Ruby|索引值|index}} ,而不是标记为 “{{Ruby| 通用|generic}}” 的某个年龄子基因。如果你想在它们之间随机化,你可以指定多个这样的{{Ruby| 索引 值|index}} 。如果多个特征 强制索引,则会在所有的{{Ruby| 索引 值|index}} 之间随机化
|forced_portrait_age_index = 1
|forced_portrait_age_index = 1
|-
|-
|forced_portrait_age_index
|forced_portrait_age_index
|Example showing that you can define more than one index
| 显示你可以定义不止一个{{Ruby|索引值|index}}的例子。
|forced_portrait_age_index = 2
|forced_portrait_age_index = 2
|-
|-
|portrait_extremity_shift
|portrait_extremity_shift
|When gaining this trait, every single morph gene will be shifted by this percentage towards 0 or 1; whichever it is closest to. E.G., 0.4 will shift 25% towards 0, resulting in 0.3
| 获得该特质时,每个{{Ruby|形态基因|morph gene}}将以这个百分比向0或1(中最近的一个)移动;例如,0.4 将向0移动25% ,结果为0.3
|portrait_extremity_shift = 0.25
|portrait_extremity_shift = 0.25
|-
|-
|immortal
|immortal
|将阻止视觉衰老,并使角色免疫自然死亡。仍可被脚本杀死。生育 力将与视觉年龄相匹配。你可以使用set_immortal_age来改变视觉年龄。
|将阻止视觉 上的 衰老,并使角色免疫自然死亡。仍可被脚本杀死。生育力将与视觉 上的 年龄相匹配。你可以使用set_immortal_age来改变视觉 上的 年龄。
|immortal = yes
|immortal = yes
|-
|-
|physical
|physical
|将该特 标记为 物理
|将该特 标记为 身体
|physical = yes
|physical = yes
|-
|-
|health_trait
|health_trait
|将该特 标记为与健康有关
|将该特 标记为与健康有关
|health_trait = yes
|health_trait = yes
|-
|-
|fame
|fame
|标记该特 为名 相关
|标记该特 为名 相关
|fame = yes
|fame = yes
|-
|-
|trait_exclusive_if_realm_contains
|trait_exclusive_if_realm_contains
| 指挥官 随机分配给 指挥官 时考虑的地形类型列表。只有当 指挥官 的文化中包含一个具有列表中指定地形类型之一的省份时,才会分配/考虑这些特
| 将领 随机分配给 将领 时考虑的地形类型列表。只有当 将领 的文化中包含一个具有列表中指定地形类型之一的省份时,才会分配/考虑这些特
|trait_exclusive_if_realm_contains = {}
|trait_exclusive_if_realm_contains = {}
|}
|}

2020年11月23日 (一) 23:41的版本

Traits are possessed by characters in the game and can modify their attributes, opinions, personality and other parameters.

Creating a trait

Traits are defined in .txt files in the directory /Crusader Kings III/common/traits.

Example trait:

my_new_trait = {
	index = 0 # A unique numerical indentifier for the trait
	education = yes #yes/no to define whether this is an Education trait
	# Flags and modifiers
        ... # Flags and modifiers
        ... # Flags and modifiers
        
}

特殊特质旗标

名称 描述 用法
index 用于保存文件的数字标识符(索引值)。最多可以是65535。 index = X
health 改变实际健康值。 health = X.X
fertility 生育力百分比修改器。 fertility = X.X
inherit_chance 遗传给子女的几率。 inherit_chance = X
birth 100个角色中,有多少个角色天生就有这个特质(不遗传时)。可以有小数。 birth = X
random_creation 在100个角色中,有多少角色是带着这个特质被创造出来的?(相对于实际出生而言,这是对生成角色、剧本角色等而言的。) random_creation = X
triggered_opinion 如果相关条件得到满足,则适用
triggered_opinion = {
	opinion_modifier = opinion_modifier_key	

	# Everything below is optional
	parameter = doctrine_parameter_key 	
	check_missing = yes			
	
	same_faith = yes			
	same_dynasty = yes			
	ignore_opinion_value_if_same_trait = yes	
	male_only = yes	
	female_only = yes
}
compatibility 这不是一个好感修正,但可以被'compatibility_modifier'和'trait_compatibility'触发使用。Compatibility是检查特质持有者与所列(另一个角色的)特质的相性。
compatibility = {
	gluttonous = 20
	drunkard = @pos_compat_low
}
parent_inheritance_sex 指定该特质是否可以从男性/女性/所有父母那里继承(默认为全部)。 parent_inheritance_sex = male/female/all
child_inheritance_sex 指定该特质是否可以由男性/女性/所有子代继承(默认为全部)。 child_inheritance_sex = male/female/all
genetic 如果设置为“yes”(默认为“no”),继承将遵循以下规则。特质可以是隐性的。子女可以从显性和隐性的父母特质中继承该特质。

显性有100%的机会被继承,隐性的特质有50%的机会被继承。如果该特质从父母双方成功继承,它就会变成显性的。 如果只从父母一方继承,则为隐性特质。

genetic = yes/no
inherit_from_real_father 该特质是否应该从亲生(生)父亲那里继承?(默认为“yes”)。 inherit_from_real_father = yes/no
enables_inbred 这个特质可以让角色的子女被考虑为近亲繁殖(默认为“no”)。

只有在父母有共同祖先的情况下,它才会启用近亲繁殖概率,所以如果父母没有关系,就不会有'近亲繁殖'的风险。 如果近亲繁殖没有被父母的特质启用,但是他们有共同的祖先,那么有机会(和近亲繁殖特质启用时一样),孩子会得到一个随机的特质,该特质enabling_inbred = yes。

enables_inbred = yes/no
good 标记该特质为 好的good(默认为no)。 good = yes/no
genetic_constraint_all 当获得特质时,将采用这种遗传约束 genetic_constraint_all = beauty
forced_portrait_age_index 角色将使用这个肖像年龄 索引值index,而不是标记为“ 通用generic”的某个年龄子基因。如果你想在它们之间随机化,你可以指定多个这样的 索引值index。如果多个特征被强制索引,则会在所有的 索引值index之间随机化。 forced_portrait_age_index = 1
forced_portrait_age_index 显示你可以定义不止一个 索引值index的例子。 forced_portrait_age_index = 2
portrait_extremity_shift 获得该特质时,每个 形态基因morph gene将以这个百分比向0或1(中最近的一个)移动;例如,0.4将向0移动25%,结果为0.3。 portrait_extremity_shift = 0.25
immortal 将阻止视觉上的衰老,并使角色免疫自然死亡。仍可被脚本杀死。生育力将与视觉上的年龄相匹配。你可以使用set_immortal_age来改变视觉上的年龄。 immortal = yes
physical 将该特质标记为身体特质 physical = yes
health_trait 将该特质标记为与健康有关 health_trait = yes
fame 标记该特质为名誉相关 fame = yes
trait_exclusive_if_realm_contains 将领特质随机分配给将领时考虑的地形类型列表。只有当将领的文化中包含一个具有列表中指定地形类型之一的省份时,才会分配/考虑这些特质。 trait_exclusive_if_realm_contains = {}

Creating immortal traits

As with the previous game, traits that grant immortality are not present in the game at launch but are already programmed and can be easily created. It only requires adding the following parameter to a trait: immortal = yes

For your immortals to look forever young, you can use the effect immortal age. Such as, set_immortal_age = 30

Localization

By default, the name key is trait_<key>, and the desc key is trait_<key>_desc.

Icon

The default icon path is gfx/interface/icons/traits/<trait>.dds.

These can be overridden with dynamic descriptions. E.G., name = some_loc_key Or name = { first_valid = { ... } }

The parameters are: name, desc, icon.

The root scope is the character. Note that in some cases there may be no root, so make sure your first check is a fallback for "NOT = { exists = this }" if you add dynamic names, descs, or icons.

An example:

icon = {
	first_valid = {
		triggered_desc = {
			trigger = { NOT = { exists = this } }
			desc = "gfx/interface/icons/traits/diligent.dds"
		}
		
		triggered_desc = {
			trigger = { gold > 1000 }
			desc = "gfx/interface/icons/traits/diligent.dds"
		}
		
		desc = "gfx/interface/icons/traits/deceitful.dds"
	}
}