角色模組製作

本頁面所適用的版本可能已經過時,最後更新於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