Modding allows to change elements of the game or add new features. Certain things are hardcoded, i.e. not available for modding, such as changing map modes or adding new hotkeys.
All mods will be achievement compatible unless they utilize console commands.
Tips
- Create a mod instead of directly modifying the game files, as they will be overwritten with any game update
- Use a good text editor that has syntax highlighting and other useful features like find in files. The following programs are free and currently have plugins to support Victoria 3 scripting:
- Sublime Text is very fast and has syntax, completion, and documentation support with the plugin found here: Victoria 3 Tools
- Visual Studio Code is a slower but feature rich editor that has a fan-made plugin called CWTools that is found here: CwTools
- Notepad++ is another good lightweight editor but it has no fan made plugins that support Victoria 3 specifically. Choosing Perl as your language syntax will give satisfactory syntax highlighting.
- Start the game with "-debug_mode" and "-filewatcher" options to use the console, dev tools, and automatically reload changed files without having to restart the game.
- Use the error.log to catch any bugs, it is extremely useful the logging is very accurate and is one of the greatest tools modders have for debugging things that are not working. It is located next to the mod folder in Documents/Paradox Interactive/Victoria 3/logs
- Backup your work, things can go wrong and it is always good to have a backup. Either do it manually or use a version control system like Git. Also consider using GitHub for team collaboration. If you are new to Git a program like Github Desktopis great for beginners.
- Use "script_docs" and "DumpDataTypes" console commands in the game to generate other logs with event effects, triggers and scopes.
- If you are unsure of how to do something, search through the base game files for words you know you need to use. Finding in files is one of the most important tools to quickly write bug free mods.
- Remove your local mod when you subscribe to the Steam version, otherwise it won't work.
- Indent properly, so that opening and closing brackets are on the same level. Proper formatting will allow you to fold blocks of code, help spot any mistakes and make it easier to read.
- Add comments, starting with #, to remember later how things works, to navigate easier or to disable parts of code without deleting them.
Modding Guides
Game object reference
Dependency and Folder Structure
If you want to add a new game object, you will need to keep in mind which more fundamental objects it depends on, and how to organize the files so the game recognizes it.
All paths are relative to the 'game' folder inside your Victoria 3 install directory, as that is where all scriptable parts of the game are located.
Note: objects with no dependencies may still reference primitive objects (numbers, strings etc) or core game concepts, but no object type that mods can edit or define, only change the parameter value of. Nested references, especially within modifiers, are generally also not counted, since modifiers can have arbitrary dependency relations.
Object type | Path | Dependencies |
---|---|---|
Professions | common/pop_types | |
Trade goods | common/goods | |
Needs | common/pop_needs |
|
Eras | common/technology/eras | |
Technologies | game/common/technology/technologies |
|
Institutions | common/institutions | |
Law groups | common/law_groups | |
Laws | common/laws |
|
Ideologies | common/ideologies |
|
Interest group traits | game/common/interest_group_traits | |
Interest groups | common/interest_groups |
|
Production methods | common/production_methods |
|
Production method groups | common/production_method_groups |
|
Building groups | common/building_groups |
|
Buildings | common/buildings |
|
Parameters
When creating a game object, you generally need to follow a specific pattern. Here are the parameters for various game objects, what they mean, which are required, and what type of value to enter.
Object type | Parameter | Parameter type | Required | Meaning |
---|---|---|---|---|
Trade goods | texture | string | good icon filepath | |
cost | integer | base good price | ||
category | keyword, one of:
|
which goods category it belongs to | ||
prestige_factor | integer | base prestige for being lowest rank leading producer:
specifically, holding the MIN_PRESTIGE_AWARD spot. | ||
traded_quantity | integer | how many goods are traded for each level of a trade route | ||
convoy_cost_multiplier | floating point number | how many times more convoys are needed to transport this good | ||
consumption_tax_cost | integer | how much authority it costs to levy a consumption tax
note: absence of this parameter implies no consumption tax can be levied | ||
Technology Era | technology_cost | integer | the base technology cost for techs in this era | |
Technology | era | Technology Era | which era this technology belongs to | |
texture | string | technology icon filepath | ||
category | keyword, one of:
|
which category this technology belongs to | ||
modifier | country modifier | which immediate effects this technology has on your country
Example: Cotton Gin provides 25% cotton plantation throughput. | ||
unlocking_technologies | list of technologies | All prerequisite technologies. If empty, it has no prerequisites | ||
can_research | boolean | if 'no', makes it unavailable for normal research.
Example: Sericulture. |
See also
Modders Guides
参考文档 | 效果 • 条件 • 事件目标 • 定义域 •增益 • 变量 • Data types • 本地化 • Customizable localization |
脚本 | 脚本化函数 • 国家 • 决议 • 事件 • 日志 • 定义 • 外交 • 附属类型 • 修正 • Objectives • On actions |
游戏内概念 | 建筑 • Pop • 文化 • 宗教 • 利益集团 • 派系 • 科技 • 法律 • 机构 • 法令 • 货物 • 概念 |
地图 | 地图 |
图像 | 3D Models • Interface • Graphical Assets • Fonts • Flags |
音乐 | Music • Sound |
其他 | 控制台指令 • Checksum • 模组结构 • Troubleshooting |
指引 | 自定义国家 • 存档编辑 • 地图数据编辑 |