角色模组制作

本页面所适用的版本可能已经过时,最后更新于1.1

修改角色涉及改变他们的外观、数据和行为。这可以从小的调整,如添加金币或虔诚,到复杂的变化,如脚本新的视觉效果和更多。

通过脚本改变外观[编辑 | 编辑源代码]

十字军之王3使用DNA系统来定义角色的外观,与《十字军之王2》中使用的系统相比有所改变。这些变化使得外观更加具体和逼真。

你可以通过dna_modifiers改变角色的DNA。在gfx/portraits/portrait_modifiers中创建一个文件,文件名为任何文件名,然后添加这个

dna_change_example_modifier = {
    usage = game
    dna_change_example_modifier = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = headgear
                template = western_imperial
                value = 1.0
            }
            color = {
                mode = modify
                gene = hair_color
                x = 0.5
                y = -0.5
            }
        }
        weight = {
            base = 0
            modifier = {
                add = 100
                has_character_flag = dna_change_example_modifier
            }
        }
    }
}

这将为任何带有 "dna_change_example_modifier "标志的角色添加西方帝国头饰并改变其头发颜色。你可以用add_character_flag命令为一个角色添加一个标志,就像这样

add_character_flag = {
    flag = dna_change_example_modifier
}

如果你遇到任何问题,请检查游戏的error.log,查看任何特定的错误信息,并相应地修改你的脚本。

添加新角色或改变现有角色[编辑 | 编辑源代码]

对于一些mod,例如总的转换,需要新的角色。在《十字军之王3》中,制作角色mod非常简单。 在创建你的mod后(在相应的文章中会有解释),你必须在example-mod/history/characters文件夹中编辑一个现有的或创建一个新的txt.-文件。 在我们的例子中,这个文件将被命名为example.txt。一个角色的例子会是这样的。

999001 = {
	name = "Henri"	#Henri de Lyon
	dna = lyon_twin_dna_entry
	dynasty = 2100001 #Lyon
	martial = 14
	diplomacy = 23
	intrigue = 10
	stewardship = 21
	religion = catholic	
	culture = french
	trait = diligent
	trait = education_learning_4
	trait = just
	trait = twin
	trait = physique_good_3
	trait = intellect_good_3
	trait = beauty_good_3
	trait = shrewd
	disallow_random_traits = yes
	father = 999003
	mother = 999004
	846.7.29 = {
		birth = yes
	}
	920.5.25 = {
		death = yes
	}
}
  • 首先,分配一个角色ID。这个ID必须是唯一的;用900000或更多的ID应该是安全的。这个ID在游戏文件中用来指代这个角色。
  • 角色的第一个名字可以通过使用name = "NAME"来设置。请注意,游戏中的名字可能会根据文化而改变(参见文化修改)。
  • 在 dna-line 中,可以插入特定 dna 的路径。可以使用common/dna_data文件夹中的00_dna.txt中现有的dna,也可以使用肖像编辑器创建一个新的dna。
  • 要将角色的性别设置为女性,使用female = yes
  • 一个角色可以被添加到一个现有的或新的宗族。Use dynasty = DYNASTY_ID for dynasties without houses, or dynasty_house = HOUSE_ID otherwise. The dynasty ID and house ID can be found in common/dynasties and common\dynasty_houses, respectively. See dynasties modding.
  • 文化和信仰必须分别用culture = CULTURE_IDreligion = FAITH_ID来分配。正确的名称可以在相应的文件夹common/culturecommon/religion中搜索找到。
  • 属性可以自由设置,其值上限为100。它们的值上限为100。如果它们没有被分配,游戏将随机生成数值。请注意,这只是在角色的基础属性值基础上增加,所以最终的数值可能会根据特性和其他因素而变小或变大。属性如下
  • martial
  • prowess
  • diplomacy
  • intrigue
  • stewardship
  • learning
  • 可通过使用trait = TRAIT_ID添加特质。用适当的特质ID替换TRAIT_ID。可以添加无限量的特质;除非分配或指定,否则游戏将随机生成特质。为了确保在游戏开始时特质不会被改变,使用disallow_random_traits = yes
  • 父母可以通过使用father = CHARACTER_IDmother = CHARACTER_ID来选择分配。确保使用目标人物的ID,而不是他们的名字。这在创建家族时很有用。
  • 性取向可以通过sexuality = SEXUALITY_ID来设置。可以使用以下
  • asexual无性
  • heterosexual异性
  • homosexual同性
  • bisexual双性
  • 通过health = HEALTH_VALUE设置角色的基本健康状况,通过fertility = FERTILITY_VALUE设置生育能力。
  • 最后,必须定义角色的出生和死亡。Crusader Kings 3使用yyyy.mm.dd作为日期格式。使用DATE = {...}定义日期块,将...替换为birth = yesdeath = yes。或者,将yes替换为由语音标记包围的日期(")。参见日期块的更多用法

同样的步骤也适用于改变现有的角色。有时,像查理曼大帝,已经有大部分的可能行。

Advanced use of date blocks[编辑 | 编辑源代码]

  • add_spouse = CHARACTER_ID, remove_spouse = CHARACTER_ID to add/remove spouses.
  • give_nickname = NICKNAME_ID to add nicknames. Later uses of give_nickname replace old nicknames. See nickname ID.
  • employer = CHARACTER_ID, similar to set_employer = CHARACTER_ID effect, moves the scoped character to the specified character's court.
  • give_council_position = COUNCILLOR_ID to make the character a councillor. The following are accepted:
  • councillor_marshal
  • councillor_spymaster
  • councillor_chancellor
  • councillor_court_chaplain
  • councillor_steward
  • Assignments defined in the previous section, like trait = TRAIT_ID, may also be used in date blocks.
  • Various other effects can be used that have a character scope, either directly in the date block or in an effect sub-block. See the following example from the game files, used to add a character flag and set character sexuality randomly:[1]
101515 = {
	...
	1019.1.1 = {
		...
		effect = {
			add_character_flag = has_scripted_appearance
			random_list = {
				50 = { set_sexuality = heterosexual }
				50 = { set_sexuality = bisexual }
			}
		}
	}
	...
}

参考资料[编辑 | 编辑源代码]

  1. game\history\characters\danish.txt, character 101515