模組製作(Modding),或者說創建模組,是一種修改遊戲資源或行為的方式,有時候僅僅是為了個人使用,有時候製作者也會發佈出來供其它玩家一起使用。可以通過以下途徑了解mod製作Paradox Mods和Steam Workshop。
在所有的P社遊戲中,十字軍之王3的可修改程度都是相當高的。mod製作者可以修改的內容也相當寬泛,比如語言翻譯,更多的事件和決議,更優秀的地圖,更大程度上的內容修改和作弊。
這篇引導的目的在於降低製作mod的門檻。但是學習的曲線總是曲折的,這需要你通過不斷的練習和閱讀他人優秀mod代碼來提升自己製作mod的水平。
大多數模組會改變校驗碼,這在1.9版本之前的遊戲中將禁用成就。在Crusader Kings III\game中的checksum_manifest.txt查看校驗文件夾和文件。不會改變校驗碼的是替換紋理、字體、着色器或音樂的模組。
提示 & 指引[編輯 | 編輯原始碼]
- 創建一個mod對遊戲進行修改: 即使是很小的改動,也不要直接修改CK3遊戲本體的遊戲文件,而是要單獨創建一個mod。因為本體更新時會直接覆蓋這些修改,並且沒有任何提示。
- 使用好的文本編輯器 用來編輯和搜索文件。以下軟件均免費:
- Visual Studio Code. 可使用Paradox Highlight插件為Crusader Kings III和其它Paradox Games提供最新版的語法高亮。還有一個粉絲自製的CWTools擴展,具有Paradox語法高亮、驗證以及觸發器和效果的工具提示。要安裝它,請到VS左側面板的擴展,搜索CWTools。(注意:驗證規則是不完整的,會在gui和本地化文件中顯示許多錯誤)
- Notepad++。選擇Perl作為你的語言,因為它可以提供良好的高亮顯示,並允許摺疊代碼塊和注釋。要將其設置為默認語言,請進入「設置」,「樣式器配置器」,在左側列表中找到Perl,並在底部的「User ext.」字段中添加「gui txt」(不加引號)。
- Atom。不包括本地化文件所需的UTF-8-BOM編碼。除此之外,其可自定義程度高。選擇Perl 6作為你的語言以獲得更好的效果。要將其設置為默認,請到文件,配置,找到「core:」,並在下面添加:「customFileTypes: "source.perl6"。["txt""gui"]",比如這個例子。
- Sublime Text. 這個連結本身是《大將軍:羅馬》的擴展,但是也可以用在ck3上: Sublime Tools. 這個擴展為效果和觸發器添加了不同的顏色高亮。如果你想要在sublime里切換注釋就還需要在同一個User文件夾里添加this file 。
- 總是通過 error.log 文件檢查mod運行中出現的bug。...\Documents\Paradox Interactive\Crusader Kings III\logs
- 日誌文件夾還包含效果、觸發器和作用域列表。在遊戲中使用控制台命令"script_docs"和"DumpDataTypes"來生成它們。
- 使用-debug_mode -develop開始遊戲 啟動選項使用控台以及"reload gui", "reload gfx"命令
- Steam:右鍵點擊遊戲->屬性->啟動選項->填入 -debug_mode -develop
- Windows: Create a shortcut for the .exe file -> right-click it -> Properties -> add -debug_mode -develop at the end of the Target field
- CK3文件夾在Linux系統的路徑 ~/.local/share/Paradox Interactive/Crusader Kings III
- 清晰明了的傳達你的MOD的關鍵內容
- 你的MOD說明應當以簡短並清晰的描述開始,說明你的MOD為遊戲增添或更改的內容。切忌以長篇大論、長長的告示列表、前提條件以及安裝介紹等等開頭。
- 不要假設用戶已經了解過這個mod了。(如果他們已經了解了這個mod就不會再讀你的描述了)
- 標明這個mod支不支持成就和鐵人模式。 (即使你覺得這已經很明顯了也要標出來)
- 當你訂閱這個mod的steam版本時,記得移除你放在本地的mod,否則這個mod可能會出現問題或者無法運行。
- 記得保存和備份。要麼手動保存要麼存在github一類的地方。Github同時也是合作製作mod的好工具。
- 用WinMerge一類的工具來合併文件夾,更新、修改文件以及打補丁。
- 當你想要換掉大量的文字時,最好使用正則表達式。 所有上面提到的編輯器都可以用. 資源: RegexOne, RegExr.
本地化文件[編輯 | 編輯原始碼]
- 本地化文件夾中的yml後綴結尾的文件必須以UTF-8 + BOM編碼保存,以便遊戲正確讀取。
- 為了保證遊戲正確讀取文件,文件名需要以*l_<language>.yml形式保存。例如council_l_english.yml。
- 你必須使用美式拼寫"localization"。使用英式拼寫"localization"會無法運行。
- 如果要重寫原始的本地化數值, 將你修改過的文件放入名為localization文件夾內名為"replace"的文件夾.
創建一個模組[編輯 | 編輯原始碼]
主條目:Mod structure#Creating initial files
建議使用遊戲啟動器來創建初始的模組文件:
- 打開遊戲啟動器。
- 在左側點擊「所有已安裝 Mod」。
- 點擊右上角的「上傳 MOD」。
- 再點擊「創建 MOD」。
- 輸入模組名稱、模組版本(注意不是遊戲版本)、目錄(啟動器會自動創建),並選擇至少一個標籤。在你點擊底部的「創建 MOD」按鈕之前,以上所有項都必須填寫完整。
- 名稱必須至少包含3個字符。
- 目錄名可以包含空格,但不能以空格結尾。
- 完成後,將你想修改的遊戲文件複製到新建的模組文件夾中,並遵循相同的文件夾結構。例如:
mod/my_new_mod/events/test_events.txt
上傳/更新模組[編輯 | 編輯原始碼]
再次上傳您的模組更新,
- 打開啟動器,
- 導航到「Mods」部分,
- 點擊「Mod工具」,從下拉菜單中選擇你的模組。
- 選擇什麼平台上傳它。
- 輸入任何描述。(如果更新,請確保啟動器從網站上複製最新的描述。)
- 添加一個縮略圖
- 對於Steam創意工坊,把thumbnail.png放在mod文件夾里。使用1:1的比例,最大1MB。創意工坊顯示的最大縮略圖約為600x600像素。
- 對於Paradox Mods,將縮略圖拖到描述下方的區域。建議最小尺寸為900x500,png或jpg,最大1MB。
- 點擊「上傳MOD」。
- 在Steam上,模組將以私人模式上傳,並出現在你的Steam資料->創意工坊項目中。打開它,並將側欄上的可見性改為 「公開」,即可實際發佈。
- 在Paradox Mods上,mod將在驗證過程後被發佈。你可能需要編輯你的描述,因為網站通常會刪除換行符和BBCode格式。
保存修改的內容[編輯 | 編輯原始碼]
保存的文件被放在:
- Windows: Documents\Paradox Interactive\Crusader Kings III\save games
- Linux: ~/.local/share/Paradox Interactive/Crusader Kings III/save games
鐵人檔是不可修改的!
首先在debug模式下開一局遊戲並且保存。
- Steam: 在Steam上右鍵單擊遊戲 -> Properties -> Set Launch Options -> 勾選debug_mode
- Windows: 為.exe文件創建一個快捷方式 -> 右鍵單擊-> Properties -> add -debug_mode at the end of the Target field
PC(Windows):
- 在保存遊戲的文件夾內找到你保存的遊戲
- 右鍵單擊此文件用7-Zip 或者 WinRar提取出壓縮文件.
- 將提取出的'gamestate'文件的擴展名重名為.ck3
- 右鍵單擊並且用編輯器打開 (不推薦使用windows notepad,因為這些文件很大).
- 編輯並保存文件。
- 遊戲中會直接加載mod(不需要重複壓縮)。
你可以直接編輯自動保存的遊戲without extracting the gamestate.
Mac:
- 打開終端
- 確認當前路徑是正確的
- 輸入命令 "unzip FileName.ck3"
- 將提取出的'gamestate'文件的擴展名重名為.ck3
- 保存此純文本
- 遊戲中會直接加載mod(不需要重複壓縮)
| 平台 | 保存方式 | 路徑 |
|---|---|---|
| Windows | 本地 | C:\Users\%USERPROFILE%\Documents\Paradox Interactive\Crusader Kings III\save games
|
| Windows | Steam 雲端 | C:\Program Files (x86)\Steam\userdata\####\1158310\remote\save games
|
| Mac | 本地 | $HOME/Documents/Paradox Interactive/Crusader Kings III/save games
|
| Linux | 本地 | $HOME/.local/share/Paradox Interactive/Crusader Kings III/save games
|
gamestate文件中的內容[編輯 | 編輯原始碼]
The table below contains the possible first-level blocks in the gamestate file. Entries are provided in order of appearance.
| Block | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| meta_data | Contains metadata about the game, such as the game version. Used by the main menu screen. | ||||||||
| ironman_manager | Related to ironman saving. | ||||||||
| (various variables) | These variables do not belong in a block.
| ||||||||
| variables | Contains script flags. | ||||||||
| game_rules | Contains the save's current game rules. | ||||||||
| provinces | Contains province data, including buildings. | ||||||||
| landed_titles | Contains the following sub-blocks:
| ||||||||
| dynasties | Contains the following sub-blocks:
| ||||||||
| deleted_characters | |||||||||
| living | Contains entries of living characters. The following format is used for each character:
index={
first_name="..."
birth=(date) # Format: yyy.m.d
female=yes # Optional
was_playable=yes # Optional
nickname="nick_..." # Optional
culture=(culture index) # Optional if dynasty_house is specified, defaults to dynasty_house culture. Required if no dynasty_house, or culture different from that of dynasty_house.
faith=(faith index) # Optional if dynasty_house is specified, defaults to dynasty_house faith. Required if no dynasty_house or faith different from that of dynasty_house.
dynasty_house=(dynasty house index) # Optional, must specify culture and faith if omitted
skill={ (diplomacy) (stewardship) (martial) (intrigue) (learning) (prowess) } # One value for each skill
prowess_age=(value) # Optional. Negative value.
dna="(dna string)" # Optional
mass=(value) # Optional, exclusive with weight
weight={ # Optional, exclusive with mass
base=(value)
current=(value) # Optional
target=(value) # Optional
}
sexuality=(value) # Optional. Defaults to heterosexual. Valid values: ho, bi, as, none. None is for children under 10.
traits={ (trait index...) } # Optional. List of trait indices. Typically omitted for young children.
recessive_traits = { (trait index...) } # Optional. List of trait indices
inactive_traits = { (trait index...) } # Optional. List of trait indices
# Optional (family_data)
family_data={
real_father=(character id) # Optional
betrothed=(character id) # Optional
primary_spouse=(character id) # Optional. Equal to one of the spouse ids.
spouse=(character id) # Optional. First spouse
spouse=(character id) # Optional. Second spouse
spouse=(character id) # Optional. Third spouse
spouse=(character id) # Optional. Fourth spouse
concubine=(character id) # Optional. First concubine
concubine=(character id) # Optional. Second concubine
concubine=(character id) # Optional. Third concubine
former_spouses={ (character id...) } # Optional. List of character ids
former_concubines={ (character id...) } # Optional. List of character ids
former_concubinists={ (character id...) } # Optional. List of character ids
child = { (character id...) } # Optional. List of character ids
}
alive_data={
# Optional (variables), contains flags
variables={
data={
# (...)
}
}
# Optional (modifiers), various locations in alive_data
modifier={
modifier="(modifier)"
expiration_date=(date)
}
gold=(value) # Optional
income=(value) # Optional
location=(landed title index) # Optional
stress=(value) # Optional
fertility=(value)
health=(value)
piety={
currency=(value)
accumulated=(value) # Optional. Devotion
}
prestige={
currency=(value) # Optional
accumulated=(value) # Optional. Fame
}
focus={ # Optional
type="(value)" # Education or lifestyle
date=(date)
changes=(value)
progress=(value)
}
secrets= { (id...) } # Optional. List of ids
targeting_secrets={ (id...) } # Optional. List of ids
schemes={ (id...) } # Optional. List of ids
targeting_schemes={ (id...) } # Optional. List of ids
heir={ (ids...) } # Optional. List of ids
pretender={ (ids...) } # Optional. List of ids
claim={ { # Optional. List of claims
title=(title id)
pressed=yes # Optional
}
}
used_punishments={ # Optional. List of reasons
(value)={
imprisonment_reason=yes # Optional
revoke_title_reason=yes # Optional
}
}
lifestyle_xp={ # Optional
diplomacy_lifestyle=(value) # Optional
martial_lifestyle=(value) # Optional
stewardship_lifestyle=(value) # Optional
intrigue_lifestyle=(value) # Optional
learning_lifestyle=(value) # Optional
}
perk={ ... } # Optional. List of perks
prison_data={ # Optional
imprisoner=(character id)
date=(date)
imprison_type_date=(date)
type="(value)" # house_arrest or dungeon
}
weight_update=(value) # Optional
kills={ (character ids... } # Optional. List of character ids
pool_history=(date) # Optional
wars={ (value) (value) (value) (value) } # Optional
} # End of alive_data block
court_data={
# All keys within this block are optional
host=(value)
employer=(character id)
council_task=(council task index)
special_council_tasks={ (value...) }
army=(value)
regiment=(regiment index)
knight=yes
wants_to_leave_court=yes
leave_court_date=(date)
}
# Optional (landed_data)
landed_data={
domain={ (landed title index...) } # List of landed title indices
vassal_contracts={ (values) } # List of values
units= { (values...) } # Optional
last_war_finish_date=(date) # Optional
last_raid=(date) # Optional
became_ruler_date=(date)
laws={ "(law id)"... } # List of law ids
strength=(value)
strength_for_liege=(value) # Optional
liege_tax=(value) # Optional
balance=(value)
dread=(value) # Optional
known_schemes={ (ids...) } # Optional. List of ids
succession={ (character id...) } # List of character ids
is_powerful_vassal=yes # Optional
vassal_power_value=(value) # Optional
domain_limit=(value)
vassal_limit=(value) # Optional
vassals_towards_limit=(value) # Optional
government="(government id)"
realm_capital=(value)
ai_allowed_to_marry=yes
council={ (value...) } # List of values
at_peace_penalty=(value)
diplo_centers={ (value...) } # List of values
election_titles={ (landed title index...) } # List of landed title indices
absolute_control=yes # Optional
interaction_cooldowns={ # Optional
(interaction)=(date)
}
} # End of landed_data block
# Optional (playable_data)
playable_data={
knights={ (character id...) } # List of character ids
was_player=yes
}
}
| ||||||||
| dead_unprunable | Contains character entries. | ||||||||
| characters | Contains the following sub-blocks:
| ||||||||
| character_lookup | |||||||||
| units | |||||||||
| activities | |||||||||
| opinions | Contains the following sub-blocks:
| ||||||||
| relations | Encompasses hooks, alliances, Contains the following sub-blocks:
| ||||||||
| schemes | Contains the following sub-blocks:
| ||||||||
| stories | Contains the following sub-blocks:
| ||||||||
| pending_character_interactions | Contains the following sub-blocks:
| ||||||||
| secrets | Contains the following sub-blocks:
| ||||||||
| armies | Contains the following sub-blocks:
| ||||||||
| religion | Contains the following sub-blocks:
| ||||||||
| wars | Contains the following sub-blocks:
| ||||||||
| sieges | Contains the following sub-blocks:
| ||||||||
| raid | Contains the following sub-blocks:
| ||||||||
| succession | |||||||||
| holdings | |||||||||
| ai | Contains the following sub-blocks:
| ||||||||
| county_manager | Contains the following sub-blocks:
| ||||||||
| fleet_manager | Contains the following sub-blocks:
| ||||||||
| council_task_manager | Contains the following sub-blocks:
| ||||||||
| important_action_manager | Contains the following sub-blocks:
| ||||||||
| faction_manager | Contains the following sub-blocks:
| ||||||||
| culture_manager | Contains the following sub-blocks:
| ||||||||
| mercenary_company_manager | Contains the following sub-blocks:
| ||||||||
| holy_orders | Contains the following sub-blocks:
| ||||||||
| coat_of_arms | Contains the following sub-blocks:
| ||||||||
| (triggered events) | Each triggered event has its own block, started using triggered_event={ | ||||||||
| next_player_event_id=(value) (variable) | |||||||||
| played_character | Contains the following sub-blocks:
| ||||||||
| currently_played_characters={ (character id...) } | List of character ids. |
從Microsoft Store版本中提取文件[編輯 | 編輯原始碼]
你可以用UWPDumper來提取文件。
- 下載最新的x64版本的UWPDumper。
- 打開開發者模式 (Windows設置 ->更新和安全> 開發者選項-> 開發人員模式)。
- 運行ck3.
- 運行你剛剛下載的UWPInjector.exe.
- 輸入ck3.exe旁邊的數字作為processID: ParadoxInteractive.ProjectTitus_zfnrdv2de78ny.
- 查看他儲存文件的地址 (可能類似於 C:\Users\%USERPROFILE%\AppData\Local\Packages\ParadoxInteractive.ProjectTitus_zfnrdv2de78ny\TempState\DUMP
- 等待程序運行完畢。
之後這些文件就會被放到上面提到的地址處。如果你想修改這些文件,創建一個mod並且把你想改的文件複製進去。
工具與實用程序[編輯 | 編輯原始碼]
- Paradox Highlight: 一個為CK3和其它Paradox遊戲代碼文件提供語法高亮的VSCode插件。
- Exporters (Maya and Photoshop)
- Clausewitz Maya Exporter: 一個可以創建和導出3D模型並且在CK3和其他Clausewitz遊戲中使用的工具。
- UWPDumper:一個從微軟商店遊戲中提取文件的工具。
外部連結[編輯 | 編輯原始碼]
- CK3 User Mods P社論壇
- Crusader Kings 官方Discord模組頻道。Go to the server-roles channel and choose CK3 Modding in the Channel Access post.
- CK3 Mod Coop A community Discord server dedicated to modding for CK3.
| 文檔 | Effects • 觸發器 • 修正 • 作用域 • 變量 • 數據類型 • 本地化 • 可定製的本地化 |
| 腳本 | AI • 劇本 • 角色 • 效果指令 • 內閣 • 文化 • 決議 • 宗族 • 事件 • 政體 • 歷史 • 地產 • 生活方式 • 軍隊 • 宗教 • Story cycles • 頭銜 • 特質 |
| 地圖 | 地圖 • 地形 |
| 圖形 | 3D模型 • Exporters • 界面 • Coat of arms • Graphical assets • Fonts • Particles • Shaders • Unit models |
| 音頻 | Music • Sound |
| 其他 | 控制台指令 • 校驗碼 • 模組結構 • Troubleshooting |