模组制作(Modding),或者说创建模组,是一种修改游戏资源或行为的方式,有时候仅仅是为了个人使用,有时候制作者也会发布出来供其它玩家一起使用。可以通过以下途径了解mod制作Paradox Mods和Steam Workshop。
在所有的P社游戏中,十字军之王3的可修改程度都是相当高的。mod制作者可以修改的内容也相当宽泛,比如语言翻译,更多的事件和决议,更优秀的地图,更大程度上的内容修改和作弊。
这篇引导的目的在于降低制作mod的门槛。但是学习的曲线总是曲折的,这需要你通过不断的练习和阅读他人优秀mod代码来提升自己制作mod的水平。
重要:大多数模组会改变校验码,将禁止玩家获得成就。在Crusader Kings III\game
中的checksum_manifest.txt
查看校验文件夹和文件。唯一安全的是替换纹理、字体、着色器或音乐的模组。
提示 & 指引
- 创建一个mod对游戏进行修改: 即使是很小的改动,也不要直接修改CK3游戏本体的游戏文件,而是要单独创建一个mod。因为本体更新时会直接覆盖这些修改,并且没有任何提示。
- 使用好的文本编辑器 用来编辑和搜索文件。以下软件均免费:
- Visual Studio Code. Has a fan-made CWTools extension with Paradox syntax highlighting, validation and tooltips for triggers and effects. To install it, go to Extensions on the left panel of VS and search for CWTools. (Note: validation rules are incomplete and will show many false errors in gui and localization files)
- Notepad++. Choose Perl as your language, as it will provide good highlighting and allow to fold blocks of code and comments. To set it as default, go to Settings, Styler Configurator, find Perl in the list on the left and add "gui txt" (without quotes) to the "User ext." field at the bottom.
- Atom. Doesn't include UTF-8-BOM encoding needed for localization files. Otherwise is very customizable. Choose Perl 6 as your language for better results. To set it as default, go to File, Config, find "core:" and add below it: "customFileTypes: "source.perl6": [ "txt" "gui"]", like in this example.
- Sublime Text. There is an extension for it released by the developers of Imperator which could be used with CK3: Sublime Tools. It adds colored highlighting for effects and triggers. If you want to toggle comments in Sublime, you also need to add this file to the same "User" folder.
- 总是通过 error.log 文件检查mod运行中出现的bug。...\Documents\Paradox Interactive\Crusader Kings III\logs
- The log folder also contains lists of effects, triggers and scopes. Use "script_docs" and "DumpDataTypes" console commands in the game to generate them.
- Start the game with -debug_mode -develop launch options to use the console and "reload gui", "reload gfx" commands.
- On Steam: right-click the game on Steam -> Properties -> Set Launch Options -> add -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
- Clearly communicate whether your mod is ironman-friendly to players.
- 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 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: RegexOne, RegExr.
本地化文件
- 本地化文件夹中的yml后缀结尾的文件必须以UTF-8 + BOM编码保存,以便游戏正确读取。
- 为了保证游戏正确读取文件,文件名需要以*l_<language>.yml形式保存。例如council_l_english.yml。
Creating a mod
主条目:Mod structure#Creating initial files It is recommended to use the game launcher to create the mod's initial files.
Uploading/updating a mod
Upload your mod again to update it.
- Open the launcher.
- Navigate to the "Mods" section.
- Press "Mod Tools", choose your mod from the dropdown menu.
- Choose what platform to upload it to.
- Enter any description. (If updating, make sure the launcher copied the most recent one from the site.)
- Add a thumbnail
- For the Steam Workshop, put thumbnail.png in the mod folder. Use 1:1 ratio, 1MB max. The biggest thumbnail the Workshop displays is around 600x600 pixels.
- For Paradox Mods, drag the thumbnail to the field below the description. Suggested minimum size is 900x500, png or jpg, 1MB max.
- Press "Upload".
- On Steam, the mod will be uploaded in private mode and appear in your Steam Profile -> Workshop Items. Open it and change visibility on the side bar to Public to actually publish.
- On Paradox Mods the mod will be published after the verification process. You may need to edit your description, as the site usually removes line breaks and BBCode formatting.
保存修改的内容
Save files are located in:
- Windows: Documents\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.
- On Steam: right-click the game on Steam -> Properties -> Set Launch Options -> add -debug_mode
- Windows: Create a shortcut for the .exe file -> right-click it -> Properties -> add -debug_mode at the end of the Target field
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
- 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(不需要重复压缩)。
Autosaves can be edited directly 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
|
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.
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) female=yes # Optional culture=(culture index) faith=(faith index) dynasty_house=(dynasty house index) # Optional skill={ (diplomacy) (stewardship) (martial) (intrigue) (learning) (prowess) } # One value for each skill sexuality=(sexuality id) # Optional dna="(dna string)" # Optional mass=(value) # Optional traits={ (trait index...) } # List of trait indices inactive_traits = { (trait index...) } # Optional. List of trait indices # Optional (family_data) family_data={ primary_spouse=(character id) spouse=(character id) child = { (character id...) } # List of character ids } alive_data={ # Optional (variables), contains flags variables={ data={ # (...) } } gold=(value) # Optional income=(value) # Optional location=(landed title index) # Optional fertility=(value) health=(value) piety={ currency=(value) accumulated=(value) # Optional } prestige={ currency=(value) accumulated=(value) # Optional } weight_update=(value) } # End of alive_data block court_data={ # All keys within this block are optional employer=(character id) council_task=(council task index) regiment=(regiment index) knight=yes } # Optional (landed_data) landed_data={ domain={ (landed title index...) } # List of landed title indices vassal_contracts={ (values) } # List of values became_ruler_date=(date) laws={ "(law id)"... } # List of law ids strength=(value) balance=(value) succession={ (character id...) } # List of character ids domain_limit=(value) vassal_limit=(value) vassals_towards_limit=(value) 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 } # 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.
|
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 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)
- Clausewitz Maya Exporter: 一个可以创建和导出3D模型并且在CK3和其他Clausewitz游戏中使用的工具。
- UWPDumper: a tool to extract files from Microsoft Store games.
外部链接
- 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 |