(01:19, 25 November 2020 Steinbeard) |
小无编辑摘要 |
||
(未显示7个用户的12个中间版本) | |||
第1行: | 第1行: | ||
{{Version|timeless}}{{需要翻译}} | {{Version|timeless}}{{需要翻译}} | ||
'''模组制作'''('''Modding'''),或者说创建模组,是一种修改游戏资源或行为的方式,有时候仅仅是为了个人使用,有时候制作者也会发布出来供其它玩家一起使用。可以通过以下途径了解mod制作[https://mods.paradoxplaza.com/games/ck3 Paradox Mods]和[https://steamcommunity.com/app/1158310/workshop/ Steam Workshop]。 | '''模组制作'''('''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的水平。 | ||
大多数模组会改变校验码, 这在1.9版本之前的游戏中 将禁 用 成就。在{{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]. 有一个粉丝自制的CWTools扩展,具有Paradox语法高亮、验证以及触发器和效果的工具提示。要安装它,请到VS左侧面板的扩展,搜索CWTools。(注意:验证规则是不完整的,会在gui和本地化文件中显示许多错误) | **[https://code.visualstudio.com/ Visual Studio Code]. 可使用[https://marketplace.visualstudio.com/items?itemName=dragon-archer.paradox-highlight Paradox Highlight]插件为Crusader Kings III和其它Paradox Games提供最新版的语法高亮。还 有一个粉丝自制的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 这个例子]。 | ||
**[https://www.sublimetext.com/ Sublime Text]. | **[https://www.sublimetext.com/ Sublime Text]. 这个链接本身是《大将军:罗马》的扩展,但是也可以用在ck3上: [https://forum.paradoxplaza.com/forum/index.php?threads/sublime-tools-for-imperator.1274246/ Sublime Tools]. 这个扩展为效果和触发器添加了不同的颜色高亮。如果你想要在sublime里切换注释就还需要在同一个User文件夹里添加[https://cdn.discordapp.com/attachments/563655919892692996/649656191173263370/PDXComments.tmPreference this file] 。 | ||
*'''总是通过 error.log 文件检查mod运行中出现的bug'''。<nowiki>...\Documents\Paradox Interactive\Crusader Kings III\logs</nowiki> | *'''总是通过 error.log 文件检查mod运行中出现的bug'''。<nowiki>...\Documents\Paradox Interactive\Crusader Kings III\logs</nowiki> | ||
*''' | *''' 日志文件夹还包含效果、触发器和作用域列表。''' 在游戏中使用控制台命令"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 | **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系统的路径 ''' <nowiki>~/.local/share/Paradox Interactive/Crusader Kings III</nowiki> | *'''CK3文件夹在Linux系统的路径 ''' <nowiki>~/.local/share/Paradox Interactive/Crusader Kings III</nowiki> | ||
* | * '''清晰明了的传达你的MOD的关键内容''' | ||
* | **你的MOD说明应当以简短并清晰的描述开始,说明你的MOD为游戏增添或更改的内容。切忌以长篇大论、长长的告示列表、前提条件以及安装介绍等等开头。 | ||
* | **不要假设用户已经了解过这个mod了。(如果他们已经了解了这个mod就不会再读你的描述了) | ||
* | **标明这个mod支不支持成就和铁人模式。 ( 即使你觉得这已经很明显了也要标出来) | ||
* | *当你订阅这个mod的steam版本时,记得移除你放在本地的mod,否则这个mod可能会出现问题或者无法运行。 | ||
*记得保存和备份。要么手动保存要么存在github一类的地方。Github同时也是合作制作mod的好工具。 | |||
*用[https://winmerge.org/?lang=en WinMerge] 一类的工具来合并文件夹,更新、修改文件以及打补丁。 | |||
* 当你想要换掉大量的文字时,最好使用正则表达式。 所有上面提到的编辑器都可以用. 资源: [https://regexone.com/ RegexOne], [https://regexr.com/ RegExr]. | |||
===本地化文件=== | ===本地化文件=== | ||
第32行: | 第35行: | ||
*本地化文件夹中的yml后缀结尾的文件必须以'''UTF-8 + BOM'''编码保存,以便游戏正确读取。 | *本地化文件夹中的yml后缀结尾的文件必须以'''UTF-8 + BOM'''编码保存,以便游戏正确读取。 | ||
*为了保证游戏正确读取文件,文件名需要以'''*l_<language>.yml'''形式保存。例如'''council_l_english.yml'''。 | *为了保证游戏正确读取文件,文件名需要以'''*l_<language>.yml'''形式保存。例如'''council_l_english.yml'''。 | ||
* | ** 你必须使用美式拼写"localization"。使用英式拼写"localization"会无法运行。 | ||
* 如果要重写原始的本地化数值, 将你修改过的文件放入名为localization文件夹内名为"replace" 的文件夹. | |||
== | == 创建一个模组== | ||
{{main|Mod structure#Creating initial files}} | {{main|Mod structure#Creating initial files}} | ||
推荐使用游戏官方登陆器来创建初始文件。 | |||
==上传/更新模组== | ==上传/更新模组== | ||
第56行: | 第60行: | ||
==保存修改的内容== | ==保存修改的内容== | ||
保存的文件被放在: | |||
*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 | ||
'' | '' 铁人档是不可修改的!'' | ||
首先在debug模式下开一局游戏并且保存。 | |||
* | *Steam: 在Steam上右键单击游戏 -> Properties -> Set Launch Options -> 勾选debug_mode | ||
*Windows: | *Windows: 为.exe 文件创建一个快捷方式 -> 右键单击-> Properties -> add -debug_mode at the end of the Target field | ||
PC(Windows): | PC(Windows): | ||
# | # 在保存游戏的文件夹内找到你保存的游戏 | ||
# | # 右键单击此文件用7-Zip 或者 WinRar 提取出压缩文件. | ||
#将提取出的'gamestate'文件的扩展名重名为.ck3 | #将提取出的'gamestate'文件的扩展名重名为.ck3 | ||
# | # 右键单击并且用编辑器打开 ( 不推荐使用windows notepad,因为这些文件很大). | ||
# | # 编辑并保存文件。 | ||
#游戏中会直接加载mod(不需要重复压缩)。 | #游戏中会直接加载mod(不需要重复压缩)。 | ||
你可以直接编辑自动保存的游戏without extracting the gamestate. | |||
Mac: | Mac: | ||
第101行: | 第105行: | ||
|} | |} | ||
=== | === gamestate 文件中的内容 === | ||
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 mw-collapsible mw-collapsed" | ||
!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 | ||
第212行: | 第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) | |||
*dynasty_house (ends at entry ~6401) | * dynasties (ends at entry ~6239) | ||
*dynasties (ends at entry ~6239) | * static_dynasties (list of numbers) | ||
*static_dynasties (list of numbers) | * static_dynasty_houses (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) # Format: yyy.m.d | ||
female=yes # Optional | female=yes # Optional | ||
culture=(culture index) | was_playable=yes # Optional | ||
faith=(faith index) | nickname="nick_..." # Optional | ||
dynasty_house=(dynasty house index) # 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 | skill={ (diplomacy) (stewardship) (martial) (intrigue) (learning) (prowess) } # One value for each skill | ||
prowess_age=(value) # Optional. Negative value. | |||
dna="(dna string)" # Optional | dna="(dna string)" # Optional | ||
mass=(value) # Optional | mass=(value) # Optional, exclusive with weight | ||
traits={ (trait index...) } # List of trait indices | 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 | inactive_traits = { (trait index...) } # Optional. List of trait indices | ||
# Optional (family_data) | # Optional (family_data) | ||
family_data={ | family_data={ | ||
primary_spouse=(character id) | real_father=(character id) # Optional | ||
spouse=(character id) | betrothed=(character id) # Optional | ||
child = { (character id...) } # List of character ids | 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 | |||
} | } | ||
第258行: | 第282行: | ||
# (...) | # (...) | ||
} | } | ||
} | |||
# Optional (modifiers), various locations in alive_data | |||
modifier={ | |||
modifier="(modifier)" | |||
expiration_date=(date) | |||
} | } | ||
第263行: | 第293行: | ||
income=(value) # Optional | income=(value) # Optional | ||
location=(landed title index) # Optional | location=(landed title index) # Optional | ||
stress=(value) # Optional | |||
fertility=(value) | fertility=(value) | ||
health=(value) | health=(value) | ||
piety={ | piety={ | ||
currency=(value) | currency=(value) | ||
accumulated=(value) # Optional | accumulated=(value) # Optional. Devotion | ||
} | } | ||
prestige={ | prestige={ | ||
currency=(value) | currency=(value) # Optional | ||
accumulated=(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) | 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 | } # End of alive_data block | ||
court_data={ | court_data={ | ||
# All keys within this block are optional | # All keys within this block are optional | ||
host=(value) | |||
employer=(character id) | employer=(character id) | ||
council_task=(council task index) | council_task=(council task index) | ||
special_council_tasks={ (value...) } | |||
army=(value) | |||
regiment=(regiment index) | regiment=(regiment index) | ||
knight=yes | knight=yes | ||
wants_to_leave_court=yes | |||
leave_court_date=(date) | |||
} | } | ||
第288行: | 第364行: | ||
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 | ||
units= { (values...) } # Optional | |||
last_war_finish_date=(date) # Optional | |||
last_raid=(date) # Optional | |||
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) | ||
strength_for_liege=(value) # Optional | |||
liege_tax=(value) # Optional | |||
balance=(value) | balance=(value) | ||
dread=(value) # Optional | |||
known_schemes={ (ids...) } # Optional. List of ids | |||
succession={ (character id...) } # List of character ids | succession={ (character id...) } # List of character ids | ||
is_powerful_vassal=yes # Optional | |||
vassal_power_value=(value) # Optional | |||
domain_limit=(value) | domain_limit=(value) | ||
vassal_limit=(value) | vassal_limit=(value) # Optional | ||
vassals_towards_limit=(value) | vassals_towards_limit=(value) # Optional | ||
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 | ||
第303行: | 第388行: | ||
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 | ||
absolute_control=yes # Optional | |||
interaction_cooldowns={ # Optional | |||
(interaction)=(date) | |||
} | |||
} # End of landed_data block | } # End of landed_data block | ||
第315行: | 第404行: | ||
</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) | |||
*dead_prunable (contains character entries) | * prune_queue | ||
*prune_queue | * dummy_female (contains a character entry) | ||
*dummy_female (contains a character entry) | * dummy_male (contains a character entry) | ||
*dummy_male (contains a character entry) | * unborn (contains unborn data entries) | ||
*unborn (contains unborn data entries) | * natural_deaths | ||
*natural_deaths | * current_natural_death | ||
*current_natural_death | * sexuality_chances | ||
*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) | |||
*active (contains story entries) | * next=(date) ''(variable)'' | ||
*next=(date) ''(variable)'' | |||
|- | |- | ||
|pending_character_interactions | | pending_character_interactions | ||
|Contains the following sub-blocks: | | Contains the following sub-blocks: | ||
* data | |||
*data | * player | ||
*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)'' | ** indices | ||
*known_secrets | *** type | ||
*** target | |||
**** type | |||
**** identity=(id) | |||
*** owner=(id) | |||
*** relation_type | |||
*** participants = { (ids)} | |||
* known_secrets = { | |||
** secret=(id) | |||
** owner=(id) | |||
|- | |- | ||
|armies | | armies | ||
|Contains the following sub-blocks: | | Contains the following sub-blocks: | ||
* regiments | |||
*regiments | * army_regiments | ||
*army_regiments | * armies | ||
*armies | |||
|- | |- | ||
|religion | | religion | ||
|Contains the following sub-blocks: | | Contains the following sub-blocks: | ||
* religions | |||
*religions | * faiths | ||
*faiths | * great_holy_wars | ||
*great_holy_wars | * holy_sites | ||
*holy_sites | |||
|- | |- | ||
|wars | | wars | ||
|Contains the following sub-blocks: | | Contains the following sub-blocks: | ||
* active_wars | |||
*active_wars | * names | ||
*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_coordinator_db | * war_plan_db | ||
*war_plan_db | * ai_stategies | ||
*ai_stategies | |||
|- | |- | ||
|county_manager | | county_manager | ||
|Contains the following sub-blocks: | | Contains the following sub-blocks: | ||
* counties | |||
*counties | * monthly_increase (list of values) | ||
*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 | |||
*cultures | * template_cultures (list of numbers) | ||
*template_cultures (list of numbers) | * era_discovery | ||
*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 | |||
*holy_orders | * religion_name | ||
*religion_name | * faith_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_name_map | * coat_of_arms_manager_database (ends at entry ~17278) | ||
*coat_of_arms_manager_database (ends at entry ~17278) | * next_id=(id) ''(variable)'' | ||
*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)'' | |||
*name="..." ''(variable)'' | * character=(character id) ''(variable)'' | ||
*character=(character id) ''(variable)'' | * player=(value) ''(variable)'' | ||
*player=(value) ''(variable)'' | * important_decisions | ||
*important_decisions | * legacy | ||
*legacy | * rally_points | ||
*rally_points | |||
|- | |- | ||
|currently_played_characters={ (character id...) } | | currently_played_characters={ (character id...) } | ||
|List of character ids. | | List of character ids. | ||
|} | |} | ||
== | == 从Microsoft Store 版本中提取文件== | ||
你可以用UWPDumper来提取文件。 | |||
# | # 下载最新的x64版本的[[Modding#Tools & utilities|UWPDumper]] 。 | ||
# | # 打开开发者模式 (Windows 设置 -> 更新和安全> 开发者选项-> 开发人员模式) 。 | ||
# | # 运行ck3. | ||
# | # 运行你刚刚下载的UWPInjector.exe. | ||
# | # 输入ck3.exe 旁边的数字作为processID: ParadoxInteractive.ProjectTitus_zfnrdv2de78ny. | ||
# | # 查看他储存文件的地址 ( 可能类似于 C:\Users\%USERPROFILE%\AppData\Local\Packages\ParadoxInteractive.ProjectTitus_zfnrdv2de78ny\TempState\DUMP | ||
# | # 等待程序运行完毕。 | ||
之后这些文件就会被放到上面提到的地址处。如果你想修改这些文件,创建一个mod并且把你想改的文件复制进去。 | |||
==工具与实用程序== | ==工具与实用程序== | ||
*[https://marketplace.visualstudio.com/items?itemName=dragon-archer.paradox-highlight Paradox Highlight]: 一个为CK3和其它Paradox游戏代码文件提供语法高亮的VSCode插件。 | |||
*[[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游戏中使用的工具。 |
2024年3月29日 (五) 18:15的最新版本
模组制作(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
推荐使用游戏官方登陆器来创建初始文件。
上传/更新模组[编辑 | 编辑源代码]
再次上传您的模组更新,
- 打开启动器,
- 导航到“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 |