Modding
Modding, or creating mods, is the act of modifying the assets or behavior of the game either for personal use, or to release publicly to other players, for instance via Paradox Mods or the Steam Workshop.
As with all Paradox games, Crusader Kings III is moddable to a great extent. Motivations of modders may vary widely; better translation to native language, more events or decisions, better map, major overhaul, cheating, etc.
This guide is intended to lower the entry barriers to the world of Crusader Kings III modding. However, there is still a learning curve to it, and it cannot replace the need to read some working vanilla code and do lots of trial and error experimentation.
Important: the majority of mods will change the checksum, not allowing the player to get achievements. See checksum_manifest.txt in the game folder for the list of checksummed folders and files. The only safe mods are the ones that replace textures, shaders, fonts or music.
Tips & guidelines[edit | edit source]
- Create a mod for your modifications: use a personal mod even for minor changes, and never directly modify the game files in the CK3 game folder as they may be overwritten without warning.
- Use a good text editor to edit files and search through folders. The following are free:
- 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 (Raku) 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.
- Intellij IDEA. Has a fan-made Paradox Language Support plugin with Paradox syntax highlighting and validation. To install it, go to File -> Settings -> Plugins and search for "Paradox Language Support".
- Start the game with -debug_mode launch option to instantly reload files and use the console.
- On Steam: right-click the game on Steam -> Properties -> add -debug_mode to Launch Options at the bottom
- Windows: Create a shortcut for the .exe file -> right-click it -> Properties -> add -debug_mode at the end of the Target field
- Windows Xbox Game Pass: Open 'Command Prompt' and run 'start shell:AppsFolder\ParadoxInteractive.ProjectTitus_zfnrdv2de78ny!App -debug_mode’
- Always check the error.log file for execution errors.
Documents/Paradox Interactive/Crusader Kings III/logs/error.log
- The log folder also contains lists of effects, triggers and scopes. Use "script_docs" and "DumpDataTypes" console commands in the game to generate them.
- The directory for the CK3 folder on Linux is
~/.local/share/Paradox Interactive/Crusader Kings III
- Communicate key facts about your mod clearly and succinctly:
- Begin description with a short list of what your mod adds to or changes about the game. Add more detailed info at the bottom.
- Clearly state whether your mod is compatible with achievements and ironman saves.
- Provide links to your mod on other platforms (Workshop, Paradox Mods, forums).
- When possible, upload your mod to all platforms, especially if it is popular. Not everybody owns the game on Steam.
- Backup your work. Either manually or with a source control system like Git. Consider using GitHub and Discord for team collaboration.
- Remove your local copy of the mod when you subscribe to the Steam version, otherwise it will not work in the game. (removing the .mod file or changing its extension is enough)
- 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, regular expressions may save a lot of time. They are available in all of the text editors above. Learning resources: RegexOne, RegExr.
- Join CK3 Modding discord to ask any questions and help others
- The Modding Git Guide is a community made guide for using Git, GitHub/GitLab, and related tools such as KDiff3. It can be a useful stop for questions beyond this wiki, and contains step by step guides for much of what is talked about here. Though the examples are HOI4 based, the principles apply equally well to any Paradox game mod.
Localization Files[edit | edit source]
- *.yml files in the localization folder must be saved with UTF-8 + BOM encoding to be read properly by the game.
- filenames need to be saved in the form as *l_<language>.yml for the game to read the file correctly. For example council_l_english.yml.
- You must use the US spelling of "localization". The Commonwealth spelling of "localisation" will not work.
- To overwrite existing localization values, put your files with changes into a folder named "replace" within the localization folder.
Creating a mod[edit | edit source]
- Main article: Mod structure#Creating initial files
It is recommended to use the game launcher to create initial mod files:
- Open the game launcher.
- Go to All Installed Mods on the left.
- Press Upload Mod in the top right.
- Press Create a Mod.
- Enter a name, version of the mod (not the game), directory (the launcher will create it) and at least one tag. All of these must be completed before you can press Create at the bottom.
- (Name must be at least 3 symbols long. DIrectory can include spaces, but cannot end with one.)
After this, copy the game files you want to edit to the created mod folder, following the same folder structure. For example, mod/my_new_mod/events/test_events.txt
Follow the links at the bottom of this page for more specific guides.
Uploading/updating a mod[edit | edit source]
Uploading and updating follows the same process:
- Open the game launcher.
- Go to All Installed Mods on the left.
- Press Upload Mod in the top right.
- 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.
Installing mods manually[edit | edit source]
Mods are installed to your Documents/Paradox Interactive/Crusader Kings III/mod
folder.
Every mod in it must have a .mod file and a folder. (For example, "Nameplates.mod" and "nameplates" folder)
From Forum[edit | edit source]
Modders will usually zip both the .mod file and the mod folder. In this case, you only need to unpack the zip file directly to your "mod" directory. If instead you see descriptor.mod and a number of other folders, continue to the next section:
From Paradox Mods[edit | edit source]
Mods downloaded from Paradox Mods only have the contents of the mod folder and require the following:
- Create a new folder in your "mod" directory. Give it any name, like "my mod".
- Unzip the downloaded mod directly to this new folder.
- Copy descriptor.mod from it and paste to your "mod" folder.
- Rename the copied descriptor file to anything.
- Open it with a text editor and add a line
path="mod/my mod"
(where "my mod" is the name of the folder you created). Save the file. - After this, you should be able to add this mod in the launcher.
If this didn't work, you can try to create a new mod from the launcher and then copy the downloaded files to its folder (excluding descriptor.mod).
Extracting files From Microsoft Store version[edit | edit source]
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.
Troubleshooting[edit | edit source]
Mods stopped working[edit | edit source]
For unknown reasons, mods sometime stop working. There are two ways to solve this:
- Reload from the launcher:
- Open the launcher
- Go to All Installed Mods on the left
- Press Reload Mods in the top right and Reload (Clearing cache doesn't seem to be necessary)
- Go to Playsets. The mod should have a warning saying the files aren't present on disk. Remove it from the playset.
- Close the launcher
- Resubscribe to the mod.
- Open the launcher and add the mod back again.
- If nothing helps, delete the following files if they are present and restart the launcher:
- Documents/Paradox Interactive/Crusader Kings III/mods_registry.json
- Documents/Paradox Interactive/Crusader Kings III/launcher-v2.sqlite
Tools & utilities[edit | edit source]
- Exporters (Maya and Photoshop)
- Community-made modding tools
- Clausewitz Maya Exporter: a tool to create and export 3D models to use in CK3 and other Clausewitz games.
- UWPDumper: a tool to extract files from Microsoft Store games.
- CK3 triggers, modifiers, effects, event scopes, event targets, on actions, code revisions and setup.log: List of valid inputs for most game versions since launch. Use GitHub file history feature to compare_versions.
Save game editing[edit | edit source]
> This doesn't seem to work anymore
Save files are located in:
- Windows: Documents\Paradox Interactive\Crusader Kings III\save games
- Linux: ~/.local/share/Paradox Interactive/Crusader Kings III/save games
First start the game in the debug mode and save. If it's an ironman game, exit to menu to autosave.
- On Steam: right-click the game on Steam -> Properties -> add -debug_mode to Launch Options at the bottom
- Windows: Create a shortcut for the .exe file -> right-click it -> Properties -> add -debug_mode at the end of the Target field
PC:
- Find the save file in the save games folder.
- If it was an autosave, skip to the next step. Else:
- Right-click the save file and extract it like an archive with 7-Zip or WinRar
- Rename the extracted 'gamestate' file to have a .ck3 extension.
- Right-click it and open with a text editor (Windows Notepad is not recommended as the save files are very big).
- Edit the file and save it.
- To remove ironman status, search for "ironman=yes" and change it to "no"
- Load it in the game.
Mac:
- Open Terminal
- Ensure that the directory is set to the correct folder
- Type in "unzip FileName.ck3"
- Rename the extracted 'gamestate' file to something with a .ck3 extension
- Edit this plain-text save
- Load it directly in the game (no need to re-compress)
OS | Save type | Location |
---|---|---|
Windows | Local | C:\Users\%USERPROFILE%\Documents\Paradox Interactive\Crusader Kings III\save games
|
Windows | Steam Cloud | C:\Program Files (x86)\Steam\userdata\####\1158310\remote\save games
|
Mac | Local | $HOME/Documents/Paradox Interactive/Crusader Kings III/save games
|
Linux | Local | $HOME/.local/share/Paradox Interactive/Crusader Kings III/save games
|
Contents of the gamestate file[edit | edit source]
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. |
Mods with wiki pages[edit | edit source]
- Wiki pages for modifications are the responsibility of the modification team, not the Paradox wiki team
- Way of Kings
- Kingdom of Heaven
- When the World Stopped Making Sense
- Princes of Darkness
- Elder Kings II
External links[edit | edit source]
- CK3 User Mods on the Paradox Forum.
- Crusader Kings official Discord modding channel. 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.
Documentation | Effects • Triggers • Modifiers • Scopes • Variables • Data types • Localization • Customizable localization |
Scripting | AI • Bookmarks • Characters • Commands • Council • Culture • Decisions • Dynasties • Events • Governments • History • Holdings • Lifestyles • Regiments • Religions • Story cycles • Titles • Traits |
Map | Map • Terrain |
Graphics | 3D models • Exporters • Interface • Coat of arms • Graphical assets • Fonts • Particles • Shaders • Unit models |
Audio | Music • Sound |
Other | Console commands • Checksum • Mod structure • Modding tools • Troubleshooting |
Characters | Characters • Attributes • Traits • Resources • Lifestyle • Dynasty • Culture • Innovations • Modifiers |
Realm & Governance | Vassals • Council • Court • Schemes • Government • Laws • Decisions • Titles • Barony • County |
Warfare | Warfare • Casus belli • Alliance • Army • Hired forces |
Faith | Religion • Faith • Doctrines • Tenets |
Meta | Modding • Patches • Downloadable content • Developer diaries • Achievements • Jargon |