该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。
最后版本 | 您的文本 | ||
第1行: | 第1行: | ||
{{Version|timeless}}{{需要翻译}} | {{Version|timeless}}{{需要翻译}} | ||
'''模组制作'''('''Modding'''),或者说创建 | '''模组制作'''('''Modding'''),或者说创建模组,是一种修改游戏资源或行为的方式,有时候仅仅是为了个人使用,有时候制作者也会发布出来供其它玩家一起使用。可以通过以下途径了解mod制作[https://mods.paradoxplaza.com/games/ck3 Paradox Mods]和[https://steamcommunity.com/app/1158310/workshop/ Steam Workshop]。 | ||
在所有的P社游戏中,十字军之王3的可修改程度都是相当高的。mod制作者可以修改的内容也相当宽泛,比如语言翻译,更多的事件和决议,更优秀的地图,更大程度上的内容修改和作弊。 | 在所有的P社游戏中,十字军之王3的可修改程度都是相当高的。mod制作者可以修改的内容也相当宽泛,比如语言翻译,更多的事件和决议,更优秀的地图,更大程度上的内容修改和作弊。 | ||
第6行: | 第6行: | ||
这篇引导的目的在于降低制作mod的门槛。但是学习的曲线总是曲折的,这需要你通过不断的练习和阅读他人优秀mod代码来提升自己制作mod的水平。 | 这篇引导的目的在于降低制作mod的门槛。但是学习的曲线总是曲折的,这需要你通过不断的练习和阅读他人优秀mod代码来提升自己制作mod的水平。 | ||
''重要'': 大多数模组会改变校验码,将禁 止玩家获得 成就。在{{Cite file|Crusader Kings III\game}}中的{{Cite file|checksum_manifest.txt}}查看校验文件夹和文件。 唯一安全 的是替换纹理、字体、着色器或音乐的模组。 | |||
== 提示 & 指引== | == 提示 & 指引== | ||
第12行: | 第12行: | ||
*'''创建一个mod对游戏进行修改''': 即使是很小的改动,也不要直接修改CK3游戏本体的游戏文件,而是要单独创建一个mod。因为本体更新时会直接覆盖这些修改,并且没有任何提示。 | *'''创建一个mod对游戏进行修改''': 即使是很小的改动,也不要直接修改CK3游戏本体的游戏文件,而是要单独创建一个mod。因为本体更新时会直接覆盖这些修改,并且没有任何提示。 | ||
*'''使用好的文本编辑器''' 用来编辑和搜索文件。以下软件均免费: | *'''使用好的文本编辑器''' 用来编辑和搜索文件。以下软件均免费: | ||
**[https://code.visualstudio.com/ Visual Studio Code]. | **[https://code.visualstudio.com/ Visual Studio Code]. 有一个粉丝自制的CWTools扩展,具有Paradox语法高亮、验证以及触发器和效果的工具提示。要安装它,请到VS左侧面板的扩展,搜索CWTools。(注意:验证规则是不完整的,会在gui和本地化文件中显示许多错误) | ||
**[https://notepad-plus-plus.org/downloads/ Notepad++]。选择Perl作为你的语言,因为它可以提供良好的高亮显示,并允许折叠代码块和注释。要将其设置为默认语言,请进入“设置”,“样式器配置器”,在左侧列表中找到Perl,并在底部的“User ext.”字段中添加“gui txt”(不加引号)。 | **[https://notepad-plus-plus.org/downloads/ Notepad++]。选择Perl作为你的语言,因为它可以提供良好的高亮显示,并允许折叠代码块和注释。要将其设置为默认语言,请进入“设置”,“样式器配置器”,在左侧列表中找到Perl,并在底部的“User ext.”字段中添加“gui txt”(不加引号)。 | ||
**[https://atom.io/ Atom]。不包括本地化文件所需的UTF-8-BOM编码。除此之外,其可自定义程度高。选择Perl 6作为你的语言以获得更好的效果。要将其设置为默认,请到文件,配置,找到“core:”,并在下面添加:“customFileTypes: "source.perl6"。["txt""gui"]",比如[https://discuss.atom.io/t/how-do-i-make-atom-recognize-a-file-with-extension-x-as-language-y/26539 这个例子]。 | **[https://atom.io/ Atom]。不包括本地化文件所需的UTF-8-BOM编码。除此之外,其可自定义程度高。选择Perl 6作为你的语言以获得更好的效果。要将其设置为默认,请到文件,配置,找到“core:”,并在下面添加:“customFileTypes: "source.perl6"。["txt""gui"]",比如[https://discuss.atom.io/t/how-do-i-make-atom-recognize-a-file-with-extension-x-as-language-y/26539 这个例子]。 | ||
第24行: | 第24行: | ||
* '''清晰明了的传达你的MOD的关键内容''' | * '''清晰明了的传达你的MOD的关键内容''' | ||
**你的MOD说明应当以简短并清晰的描述开始,说明你的MOD为游戏增添或更改的内容。切忌以长篇大论、长长的告示列表、前提条件以及安装介绍等等开头。 | **你的MOD说明应当以简短并清晰的描述开始,说明你的MOD为游戏增添或更改的内容。切忌以长篇大论、长长的告示列表、前提条件以及安装介绍等等开头。 | ||
** | **Don't assume the person reading the description has ever heard of the mod before (if they had, they wouldn't generally be reading the description). | ||
** | **Clearly and visibly state whether your mod is Ironman-compatible. (Even if it seems obvious to you.) | ||
* | *Remove your local mod when you subscribe to the Steam version, otherwise it may not work in the game. | ||
* | *Backup your work. Either manually or with a source control system like Git. Also consider using GitHub for team collaboration. | ||
* | *Use a proper merge tool (like [https://winmerge.org/?lang=en WinMerge]) to merge between folders and update modified files for a new patch. | ||
* | *If you're replacing text across dozens or hundreds lines of code, you may want to use regular expressions. They are available in all of the text editors above. Learning resources: [https://regexone.com/ RegexOne], [https://regexr.com/ RegExr]. | ||
===本地化文件=== | ===本地化文件=== | ||
第36行: | 第36行: | ||
*为了保证游戏正确读取文件,文件名需要以'''*l_<language>.yml'''形式保存。例如'''council_l_english.yml'''。 | *为了保证游戏正确读取文件,文件名需要以'''*l_<language>.yml'''形式保存。例如'''council_l_english.yml'''。 | ||
** 你必须使用美式拼写"localization"。使用英式拼写"localization"会无法运行。 | ** 你必须使用美式拼写"localization"。使用英式拼写"localization"会无法运行。 | ||
* | * To overwrite existing localization values, put your files with changes into a folder named "replace" within the localization folder. | ||
==创建一个模组== | ==创建一个模组== | ||
{{main|Mod structure#Creating initial files}} | {{main|Mod structure#Creating initial files}} | ||
It is recommended to use the game launcher to create the mod's initial files. | |||
==上传/更新模组== | ==上传/更新模组== | ||
第60行: | 第60行: | ||
==保存修改的内容== | ==保存修改的内容== | ||
Save files are located in: | |||
*Windows: Documents\Paradox Interactive\Crusader Kings III\save games | *Windows: Documents\Paradox Interactive\Crusader Kings III\save games | ||
*Linux: ~/.local/share/Paradox Interactive/Crusader Kings III/save games | *Linux: ~/.local/share/Paradox Interactive/Crusader Kings III/save games | ||
'' | ''It is not possible to edit an ironman save!'' | ||
First start the game in the debug mode and save. | |||
*Steam: | *On Steam: right-click the game on Steam -> Properties -> Set Launch Options -> add -debug_mode | ||
*Windows: | *Windows: Create a shortcut for the .exe file -> right-click it -> Properties -> add -debug_mode at the end of the Target field | ||
PC(Windows): | PC(Windows): | ||
# | #Find the save file in the save games folder. | ||
# | #Right-click the save file and extract it like an archive with 7-Zip or WinRar. | ||
#将提取出的'gamestate'文件的扩展名重名为.ck3 | #将提取出的'gamestate'文件的扩展名重名为.ck3 | ||
# | #Right-click it and open with your text editor (Windows Notepad is not recommended as the save files are very big). | ||
# | #Edit the file and save it. | ||
#游戏中会直接加载mod(不需要重复压缩)。 | #游戏中会直接加载mod(不需要重复压缩)。 | ||
Autosaves can be edited directly without extracting the gamestate. | |||
Mac: | Mac: | ||
第105行: | 第105行: | ||
|} | |} | ||
=== gamestate | ===Contents of the gamestate file=== | ||
The table below contains the possible first-level blocks in the gamestate file. Entries are provided in order of appearance. | The table below contains the possible first-level blocks in the gamestate file. Entries are provided in order of appearance. | ||
{| class="wikitable | {| class="wikitable" | ||
! Block | !Block | ||
! Description | !Description | ||
|- | |- | ||
| meta_data | |meta_data | ||
| Contains metadata about the game, such as the game version. Used by the main menu screen. | |Contains metadata about the game, such as the game version. Used by the main menu screen. | ||
|- | |- | ||
| ironman_manager | |ironman_manager | ||
| Related to ironman saving. | |Related to ironman saving. | ||
|- | |- | ||
| (various variables) | |(various variables) | ||
| These variables do not belong in a block. | |These variables do not belong in a block. | ||
{| class="wikitable" | {| class="wikitable" | ||
! Variable | !Variable | ||
|- | |- | ||
| date | |date | ||
|- | |- | ||
| bookmark_date | |bookmark_date | ||
|- | |- | ||
| first_start | |first_start | ||
|- | |- | ||
| speed | |speed | ||
|- | |- | ||
| random_seed | |random_seed | ||
|- | |- | ||
| random_count | |random_count | ||
|} | |} | ||
|- | |- | ||
| variables | |variables | ||
| Contains script flags. | |Contains script flags. | ||
|- | |- | ||
| game_rules | |game_rules | ||
| Contains the save's current game rules. | |Contains the save's current game rules. | ||
|- | |- | ||
| provinces | |provinces | ||
| Contains province data, including buildings. | |Contains province data, including buildings. | ||
|- | |- | ||
| landed_titles | |landed_titles | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
{| class="wikitable" | {| class="wikitable" | ||
! Sub-block | !Sub-block | ||
! Description | !Description | ||
|- | |- | ||
| dynamic_templates | |dynamic_templates | ||
| | | | ||
|- | |- | ||
| landed_titles<br>''(repetition)'' | |landed_titles<br>''(repetition)'' | ||
| Contains an entry for each landed title in the game, in the format: | |Contains an entry for each landed title in the game, in the format: | ||
<pre> | <pre> | ||
# Exact formatting in file is different in terms of spaces and lines | # Exact formatting in file is different in terms of spaces and lines | ||
第216行: | 第216行: | ||
In vanilla CK3, this block ends at entry ~12369. | In vanilla CK3, this block ends at entry ~12369. | ||
|- | |- | ||
| index=(value)<br>''(variable)'' | |index=(value)<br>''(variable)'' | ||
| | | | ||
|} | |} | ||
|- | |- | ||
| dynasties | |dynasties | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* dynasty_house (ends at entry ~6401) | |||
* dynasties (ends at entry ~6239) | *dynasty_house (ends at entry ~6401) | ||
* static_dynasties (list of numbers) | *dynasties (ends at entry ~6239) | ||
* static_dynasty_houses (list of numbers) | *static_dynasties (list of numbers) | ||
*static_dynasty_houses (list of numbers) | |||
|- | |- | ||
| deleted_characters | |deleted_characters | ||
| | | | ||
|- | |- | ||
| living | |living | ||
| Contains entries of living characters. The following format is used for each character: | |Contains entries of living characters. The following format is used for each character: | ||
<pre> | <pre> | ||
index={ | index={ | ||
first_name="..." | first_name="..." | ||
birth=(date) | birth=(date) | ||
female=yes # Optional | female=yes # Optional | ||
culture=(culture index) | |||
faith=(faith index) | |||
culture=(culture index) | dynasty_house=(dynasty house index) # Optional | ||
faith=(faith index) | |||
dynasty_house=(dynasty house index) # Optional | |||
skill={ (diplomacy) (stewardship) (martial) (intrigue) (learning) (prowess) } # One value for each skill | skill={ (diplomacy) (stewardship) (martial) (intrigue) (learning) (prowess) } # One value for each skill | ||
sexuality=(sexuality id) # Optional | |||
dna="(dna string)" # Optional | dna="(dna string)" # Optional | ||
mass=(value) # Optional | mass=(value) # Optional | ||
traits={ (trait index...) } # List of trait indices | |||
traits={ (trait index...) } # | |||
inactive_traits = { (trait index...) } # Optional. List of trait indices | inactive_traits = { (trait index...) } # Optional. List of trait indices | ||
# Optional (family_data) | # Optional (family_data) | ||
family_data={ | family_data={ | ||
primary_spouse=(character id) | |||
spouse=(character id) | |||
primary_spouse=(character id) | child = { (character id...) } # List of character ids | ||
spouse=(character id) | |||
child = { (character id...) } # | |||
} | } | ||
第282行: | 第262行: | ||
# (...) | # (...) | ||
} | } | ||
} | } | ||
第293行: | 第267行: | ||
income=(value) # Optional | income=(value) # Optional | ||
location=(landed title index) # Optional | location=(landed title index) # Optional | ||
fertility=(value) | fertility=(value) | ||
health=(value) | health=(value) | ||
piety={ | piety={ | ||
currency=(value) | currency=(value) | ||
accumulated=(value) # Optional | accumulated=(value) # Optional | ||
} | } | ||
prestige={ | prestige={ | ||
currency=(value) | currency=(value) | ||
accumulated=(value) # Optional | accumulated=(value) # Optional | ||
} | } | ||
weight_update=(value) | |||
weight_update=(value) | |||
} # End of alive_data block | } # End of alive_data block | ||
court_data={ | court_data={ | ||
# All keys within this block are optional | # All keys within this block are optional | ||
employer=(character id) | employer=(character id) | ||
council_task=(council task index) | council_task=(council task index) | ||
regiment=(regiment index) | regiment=(regiment index) | ||
knight=yes | knight=yes | ||
} | } | ||
第364行: | 第292行: | ||
domain={ (landed title index...) } # List of landed title indices | domain={ (landed title index...) } # List of landed title indices | ||
vassal_contracts={ (values) } # List of values | vassal_contracts={ (values) } # List of values | ||
became_ruler_date=(date) | became_ruler_date=(date) | ||
laws={ "(law id)"... } # List of law ids | laws={ "(law id)"... } # List of law ids | ||
strength=(value) | strength=(value) | ||
balance=(value) | balance=(value) | ||
succession={ (character id...) } # List of character ids | succession={ (character id...) } # List of character ids | ||
domain_limit=(value) | domain_limit=(value) | ||
vassal_limit=(value) | vassal_limit=(value) | ||
vassals_towards_limit=(value) | vassals_towards_limit=(value) | ||
government="(government id)" | government="(government id)" | ||
realm_capital=(value | realm_capital=(value | ||
ai_allowed_to_marry=yes | ai_allowed_to_marry=yes | ||
council={ (value...) } # List of values | council={ (value...) } # List of values | ||
第388行: | 第307行: | ||
diplo_centers={ (value...) } # List of values | diplo_centers={ (value...) } # List of values | ||
election_titles={ (landed title index...) } # List of landed title indices | election_titles={ (landed title index...) } # List of landed title indices | ||
} # End of landed_data block | } # End of landed_data block | ||
第404行: | 第319行: | ||
</pre> | </pre> | ||
|- | |- | ||
| dead_unprunable | |dead_unprunable | ||
| Contains character entries. | |Contains character entries. | ||
|- | |- | ||
| characters | |characters | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* dead_prunable (contains character entries) | |||
* prune_queue | *dead_prunable (contains character entries) | ||
* dummy_female (contains a character entry) | *prune_queue | ||
* dummy_male (contains a character entry) | *dummy_female (contains a character entry) | ||
* unborn (contains unborn data entries) | *dummy_male (contains a character entry) | ||
* natural_deaths | *unborn (contains unborn data entries) | ||
* current_natural_death | *natural_deaths | ||
* sexuality_chances | *current_natural_death | ||
*sexuality_chances | |||
|- | |- | ||
| character_lookup | |character_lookup | ||
| | | | ||
|- | |- | ||
| units | |units | ||
| | | | ||
|- | |- | ||
| activities | |activities | ||
| | | | ||
|- | |- | ||
| opinions | |opinions | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* active_opinions (contains opinion entries) | |||
*active_opinions (contains opinion entries) | |||
|- | |- | ||
| relations | |relations | ||
| Encompasses hooks, alliances, Contains the following sub-blocks: | |Encompasses hooks, alliances, Contains the following sub-blocks: | ||
* active_relations | |||
*active_relations | |||
|- | |- | ||
| schemes | |schemes | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* active (contains scheme entries) | |||
*active (contains scheme entries) | |||
|- | |- | ||
| stories | |stories | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* active (contains story entries) | |||
* next=(date) ''(variable)'' | *active (contains story entries) | ||
*next=(date) ''(variable)'' | |||
|- | |- | ||
| pending_character_interactions | |pending_character_interactions | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* data | |||
* player | *data | ||
*player | |||
|- | |- | ||
| secrets | |secrets | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* secrets (contains entries of secrets) ''(repetition)'' | |||
*secrets (contains entries of secrets) ''(repetition)'' | |||
*known_secrets | |||
* known_secrets | |||
|- | |- | ||
| armies | |armies | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* regiments | |||
* army_regiments | *regiments | ||
* armies | *army_regiments | ||
*armies | |||
|- | |- | ||
| religion | |religion | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* religions | |||
* faiths | *religions | ||
* great_holy_wars | *faiths | ||
* holy_sites | *great_holy_wars | ||
*holy_sites | |||
|- | |- | ||
| wars | |wars | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* active_wars | |||
* names | *active_wars | ||
*names | |||
|- | |- | ||
| sieges | |sieges | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* sieges ''(repetition)'' | |||
*sieges ''(repetition)'' | |||
|- | |- | ||
| raid | |raid | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* raid ''(repetition)'' | |||
*raid ''(repetition)'' | |||
|- | |- | ||
| succession | |succession | ||
| | | | ||
|- | |- | ||
| holdings | |holdings | ||
| | | | ||
|- | |- | ||
| ai | |ai | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* war_coordinator_db | |||
* war_plan_db | *war_coordinator_db | ||
* ai_stategies | *war_plan_db | ||
*ai_stategies | |||
|- | |- | ||
| county_manager | |county_manager | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* counties | |||
* monthly_increase (list of values) | *counties | ||
*monthly_increase (list of values) | |||
|- | |- | ||
| fleet_manager | |fleet_manager | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* fleets | |||
*fleets | |||
|- | |- | ||
| council_task_manager | |council_task_manager | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* active | |||
*active | |||
|- | |- | ||
| important_action_manager | |important_action_manager | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* active | |||
*active | |||
|- | |- | ||
| faction_manager | |faction_manager | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* factions | |||
*factions | |||
|- | |- | ||
| culture_manager | |culture_manager | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* cultures | |||
* template_cultures (list of numbers) | *cultures | ||
* era_discovery | *template_cultures (list of numbers) | ||
*era_discovery | |||
|- | |- | ||
| mercenary_company_manager | |mercenary_company_manager | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* mercenary_companies | |||
*mercenary_companies | |||
|- | |- | ||
| holy_orders | |holy_orders | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* holy_orders | |||
* religion_name | *holy_orders | ||
* faith_name | *religion_name | ||
*faith_name | |||
|- | |- | ||
| coat_of_arms | |coat_of_arms | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* coat_of_arms_manager_name_map | |||
* coat_of_arms_manager_database (ends at entry ~17278) | *coat_of_arms_manager_name_map | ||
* next_id=(id) ''(variable)'' | *coat_of_arms_manager_database (ends at entry ~17278) | ||
*next_id=(id) ''(variable)'' | |||
|- | |- | ||
| (triggered events) | |(triggered events) | ||
| Each triggered event has its own block, started using triggered_event={ | |Each triggered event has its own block, started using triggered_event={ | ||
|- | |- | ||
| next_player_event_id=(value) ''(variable)'' | |next_player_event_id=(value) ''(variable)'' | ||
| | | | ||
|- | |- | ||
| played_character | |played_character | ||
| Contains the following sub-blocks: | |Contains the following sub-blocks: | ||
* name="..." ''(variable)'' | |||
* character=(character id) ''(variable)'' | *name="..." ''(variable)'' | ||
* player=(value) ''(variable)'' | *character=(character id) ''(variable)'' | ||
* important_decisions | *player=(value) ''(variable)'' | ||
* legacy | *important_decisions | ||
* rally_points | *legacy | ||
*rally_points | |||
|- | |- | ||
| currently_played_characters={ (character id...) } | |currently_played_characters={ (character id...) } | ||
| List of character ids. | |List of character ids. | ||
|} | |} | ||
== | ==Extracting files From Microsoft Store version== | ||
If you want to read the files using the Microsoft Store version, you can use a program called UWPDumper to extract the files. | |||
# | #Download the latest x64 binary of [[Modding#Tools & utilities|UWPDumper]] | ||
# | #Enable Developer Mode (Windows Settings -> Update and Security -> For Developers -> Developer Mode). | ||
# | #Run CK3. | ||
# | #Run UWPInjector.exe from the program you just downloaded. | ||
# | #Enter the number next to ck3.exe : ParadoxInteractive.ProjectTitus_zfnrdv2de78ny as the processID. | ||
# | #Check where it is going to store the files (probably somewhere like C:\Users\%USERPROFILE%\AppData\Local\Packages\ParadoxInteractive.ProjectTitus_zfnrdv2de78ny\TempState\DUMP | ||
# | #Wait for the program to finish. | ||
The files should then be present in the directory specified earlier. If you want to edit the files, create a mod and copy the desired files there. | |||
==工具与实用程序== | ==工具与实用程序== | ||
*[[Exporters]] (Maya and Photoshop) | *[[Exporters]] (Maya and Photoshop) | ||
*[https://forum.paradoxplaza.com/forum/threads/information-and-faq.924764/ Clausewitz Maya Exporter]: 一个可以创建和导出3D模型并且在CK3和其他Clausewitz游戏中使用的工具。 | *[https://forum.paradoxplaza.com/forum/threads/information-and-faq.924764/ Clausewitz Maya Exporter]: 一个可以创建和导出3D模型并且在CK3和其他Clausewitz游戏中使用的工具。 |