Modding
Jump to navigation
Jump to search
This page discusses the basics of modding. For information about using game mods, see Mod
Modding (using 'mods', short for modification) in Europa Universalis V provides players with the ability to alter various aspects of the game or incorporate new features, enhancing the overall gaming experience. While certain elements remain hardcoded and cannot be modified, such as the Migration or Battle casualty logic or map modes, a wide range of options are available for customization.
| Documentation | Defines • Effects • Scopes • Scope links • Triggers Colors • Macros • Mean time to happen • Modifier types • On actions • Script value • Variables GUI script • Localization |
| Scripted content | Actions • Disasters • Events • Missions • Modifiers • Scripted gui • Setup • Situations • Customizable localization |
| Scripted types | Advances • Art • Buildings • Casus belli • Characters • Concepts • Countries • Culture • Diplomacy • Diseases • Estates • Goods • Institutions • International organizations • Laws • Peace treaties • Pops • Religion • Subject types • Traits • Units • Wargoals |
| Map | Map • Map mode modding • Terrain |
| Graphics | 3D Models • Interface • Graphical assets • Fonts • Flags |
| Audio | Music • Sound |
| Other | AI • Console commands • Checksum • Mods • Mod files load order • Mod structure • Troubleshooting |
| Guides | Interface modding guide • Mod translation • Save-game editing • Settlement position modding guide |
| Tools | Arcanum • PDX DeepL • PDX Workshop Manager • Add Your Tool to the Wiki |
Getting started[edit | edit source]
Setting up the mod folder[edit | edit source]
See also: Mod structure
- Create a new folder in
Documents/Paradox Interactive/Europa Universalis V/mod, this new folder corresponds with thegamefolder in the base game.- Don't directly modify the game files, they will be overwritten with any game update.
- In the new folder, create your "in_game", "main_menu", and "loading_screen" top level folders, then within those "common", "localization", etc. folders of your mod as needed.
- Follow the same structure as found in Europa Universalis V\game folder.
- Place .txt and other files for the actual content inside the appropriate folder.
- Add a
.metadatafolder with a metadata.json file inside. The file may be bare bones, but is a requirement in order for the game to load your mod at all.
The in-game mod tools can also be used to set up the basic mod folder. The images for what that looks like.
Basic tools and resources[edit | edit source]
- Utilize a source code editor with syntax highlighting and other helpful features, such as Code Search. Popular free programs for modding Europa Universalis V include:
- Visual Studio Code has the extension Paradox Highlight and CwTools available.
- IntelliJ (The Community Edition is free) has the extension Paradox Language Support available.
- Notepad++ is a less powerful choice, but may feel less overwhelming.
- There is a community-sourced custom language for Europa Universalis V that can be found on github.
- Alternatively, select Perl as your language syntax for closet built-in syntax highlighting.
- Add the following options in Steam via left click on Europa Universalis V -> Properties at the bottom of the General folder:
-debug_modeto activate the console and in-game dev tools. Alternatively, there are also mods to activate/deactivate debug mode in-game. Also, hotloads changes to your mod files without needing to restart the game.- A few files are not covered, such as on_action.
- Use
script_docsanddump_data_typescommands in the game console to generate other logs with effects, triggers, and scopes.- Access the console in-game with
~when debug_mode is active. - Generated files from
script_docsare located inDocuments\Paradox Interactive\Europa Universalis V\docs; see also Effect, Trigger, Event target, and Modifier types on the wiki - Generated files from
dump_data_typesare located inDocuments\Paradox Interactive\Europa Universalis V\logs\data_types; see also GUI script on the wiki - This is the most reliable technical documentation you can get.
- Those extracted files can also be found on GitHub
- Access the console in-game with
- 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.
Best practices[edit | edit source]
- Use proper indentation to ensure opening and closing brackets are on the same level. This allows for code folding, easier error spotting, and improved readability.
- Consider using an automatic formatting extension for your editor.
- When uncertain about implementation, search the base game code for relevant keywords using your editor.
- Add comments, starting with #, to remember later how things works, to navigate easier or to disable parts of code without deleting them.
- Avoid overwriting items you didn't change to minimize conflicts and enhance clarity.
Priority of modded files[edit | edit source]
Main article: Mod files load order
- Using a filename that exists in vanilla will overwrite the original file completely.
- If several files with the same name are used by different mods, the lowest mod list position in the launcher is relevant.
- If an item is modified by multiple mods, the game will choose from the file sorted last alphabetically by filename.
- This takes priority over the position in the mod list in the launcher.
Debugging[edit | edit source]
- Read the error.log to find exceptions and warnings the game identified in
Documents/Paradox Interactive/Europa Universalis V/logs -debug_modeadds a button that opens the `error.log` for you and also shows its current number of lines.- The default editor used for this on Windows is Notepad, but it is configurable.
- You can either edit
Documents/Paradox Interactive/Europa Universalis V/pdx_settings.jsondirectly, adding the following keys under theSystemkey:"editor": "C:\\Program Files\\Sublime Text\\sublime_text.exe"- tells the game which editor to use, you can use any valid editor on your computer, just make sure to use the correct path."editor_postfix": ":$:1"- this is used when opening the editor, for example this Sublime Text specific postfix makes sure the editor is opened scrolled to the latest line.
- Or you can use the ingame settings editor accessible through the in-game console, under the Settings button. Choose System in the Category selector and find the
Editorkey.
--ignore-disable-mods-on-crash. If the game crashes during loading resources, it will load with all mods disabled the next time. Use this option to force load the same playset. Useful when debugging crash in your own mod.
- Backup your work, things can go wrong, and it is always good to have a backup.
- Using a version control system like Git allows you to track your changes, revert to a working version and collaborate.
- If you are part of a team, consider using GitHub for team collaboration. If you are new to Git, a program like Github Desktopis great for beginners.
- Set encoding to
UTF-8 with BOMinside your editor for code files, especially for localization .yml files. - For localization files, make sure your filenames end with l_language like
foo_l_english.yml. Note the first character in the suffix is an ell (lowercase L), not the numeral 1 or uppercase i.
- Join the EU5 Mod Coop discord to ask other modders for help.
Tools and utilities[edit | edit source]
| Name | Category | Link(s) | Description |
|---|---|---|---|
| Paradox Highlight | Editor (VS Code) | VS Code Marketplace | Up-to-date syntax highlighting for all Europa Universalis V files. Other paradox games like Crusader Kings III are also supported. |
| CWTools - Paradox Language Services | Editor (VS Code) | VS Code Marketplace | For editing Paradox game files in Visual Studio Code. It has syntax-highlighting, error checking, auto-completion and more. Based on the CWTools library for parsing, editing, and validating Paradox Interactive script files. |
| Paradox Language Support | Editor (IntelliJ) | JETBRAINS Marketplace | The Intellij IDEA plugin for Paradox Interactive game modding. It has syntax-highlighting, error checking, auto-completion and more. |
| EU5 Language for Notepad++ | Editor (Notepad++) | Github | Provides EU5-specific script keywords and text highlighting in Notepad++ |
| Arcanum | Map Modding, Visual Editor | GitHub | A feature rich mod and map data editor |
| PDX Workshop Manager | General | GitHub | A tool to publish Paradox mods, to the Steam workshop in repeatable and configurable way |
| PDX DeepL | Translation | GitHub | A tool to do incremental auto translation of mods for Paradox games using DeepL |
| Pdx-Unlimiter | General | GitHub | A powerful and smart savegame manager, it can edit save files. It can preview modded flags without starting the game. |
| UWPDumper | General | GitHub | A tool to extract files from Microsoft Store games. |
| Clausewitz Maya Exporter | General | Paradox Forums | A tool to create and export 3D models to use in EU5 and other Clausewitz games. |
| Jomini.js | General | GitHub | A powerful parsing library in javascript based on webassemby, has a C version named Rakaly. |
| Europa Universalis V Community Graphical Assets | General | GitHub | A graphical assets repository for EU5 modders to use and contribute to |
| EU5 Map Maker | Map modding | Webpage | An online graphical map editor |
| Location Definition Tool | Map modding | Github | A downloadable graphical map editor |
| GIMP Heightmap Filter | Map modding | Github | A filter for GIMP which colorizes greyscale heightmaps |
Common problems[edit | edit source]
- Some local mod files fail to load.
- Symptoms:
- A mod is correctly shown in the mod manager, it is added to the playset, but some files do not have an effect.
error.logcontains a line such as[virtualfilesystem.cpp:562]: Could not create lexer from file due to 'fopen() failed: 2'followed by a line about encoding.- Potentially also problems with opening
error.logby clicking on the error deer in game launched with the-debug_modeflag.
- Likely causes:
- Permissions. The game could have trouble accessing the mod files due to broken permissions.
- File path containing non-ASCII characters. It seems like Europa Universalis V (similarly to other games such as Hearts of Iron IV) has troubles with this. On Windows, this can happen due to the user's username, and therefore the user folder containing
Documents/Paradox Interactive/Europa Universalis V/, containing non-ASCII characters. You can easily check whether this is the case by looking at your file path.
- Solutions:
- Unfortunately, it looks like modifying the path used by the game for user files (similarly to how it is explained for HoI4) does not seem to work as of writing.
- Symlinking the mod directory to another place also does not work, because the game would still access the original file path.
- For now, if your user folder on Windows contains non-ASCII characters, the simplest solution is to create a new user profile with an ASCII compliant name, and work on your mods from that profile. Renaming the user folder under
Usersis not advised due to inherent risks of breaking your Windows installation.
- Symptoms:
See also[edit | edit source]
References[edit | edit source]
| Game | Achievements • Features • Game rules |
| Guides | Beginner's guide • Europedia • Keyboard shortcuts • Map modes • Tutorial videos • User interface |
| Development | Developer diaries • Downloadable content • Patches |
| Community | Easter eggs • Jargon • Modding |