Mod structure

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

To create a mod for Europa Universalis IV, you need to replicate the directory structure of the files which will be altered, then create a .mod file which tells the launcher the location of the new files.

.mod file[edit | edit source]

Where this file goes depends on the platform:

  • Windows: Documents\Paradox Interactive\Europa Universalis IV\mod
  • Linux: ~/.local/share/Paradox Interactive/Europa Universalis IV/mod
  • Mac OS: ~/Documents/Paradox Interactive/Europa Universalis IV/mod

It simply tells the launcher the directory it should look in, the name it should display to the user, and (as of Patch 1.8) the supported version of Europa Universalis IV[1]. For example:

name = "My Mod version 3"
path = "mod/mymod_v3"
supported_version = "1.9"

The supported version must match the major version number of Europa Universalis IV (1.8, 1.9, etc.) being used by the launcher in order to be loaded into the game.

When uploading it to the Steam workshop include a picture and tags so it is more easily found while browsing, like so:

name = "My Mod version 3"
path = "mod/mymod_v3"
supported_version = "1.9"
picture = "mymod_picture.jpg"
tags = {
 "Events"
 "Historical"
}

The picture file should go inside the "mymod_v3" folder rather than the Europe Universalis IV\mod directory.

Since the launcher updated with patch 1.29, the picture file should be named "thumbnail.png" and needs to be a decently small size, assumed to be 1 MB or smaller.

Steam tags[edit | edit source]

The tags are the tags in use in Steam's system.

Currently any combination of the following works:

  • Alternative History
  • Balance
  • Events
  • Expansion
  • Fixes
  • Gameplay
  • Graphics
  • Guide
  • Historical
  • Loading Screen
  • Map
  • Military
  • Missions And Decisions
  • National Ideas
  • New Nations
  • Religion
  • Sound
  • Technologies
  • Trade
  • Translation
  • Utilities

General notes[edit | edit source]

  • Audio file format
    As far as known, only OGG files will correctly play. While the engine doesn't crash or throw errors, it will not play MP3 files. Executing 'nextsong' in the console will print the console message "playing music/foo.mp3", suggesting that the file is read, but not actually played.

Mod folder[edit | edit source]

This folder goes in the same place as the .mod file. It should have the same directory structure as the contents of the Europa Universalis IV folder, minus the unchanged files. The game will load files from the root Europa Universalis IV folder, but if it encounters a different version of a file in the mod folder, it will load that instead.

This folder should also contain a "descriptor.mod" file that contains all the same information as your initial .mod file, but doesn't need to contain the "path = " line.

However, if to completely change a folder - for instance removing all missions from the game - add replace_path = "missions" in the .mod file. Any game folder that is added with this command will simply not be loaded.

name = "coolmod"
path = "mod/coolmod"
supported_version = "1.9"
replace_path = "missions"

Important: if to replace a folder with an empty folder - making sure nothing of that content is loaded - place a dummy file in the folder. Otherwise the empty folder in the mod won't be included when uploaded to Steam. [2]

Submod[edit | edit source]

Eu4 loads the mods in alphabetical order and does not honor the load order of mods in the launcher. To make a submod which overrides files of a primary mod, a dependencies section can be added to the .mod file:

name = "othercoolmod"
path = "mod/othercoolmod"
dependencies={
        "My Mod version 3"
        "coolmod"
}

This mod will override the files of both "My Mod version 3" and "coolmod".

Uploading The Mod[edit | edit source]

In the new Paradox Launcher, you should be able to quickly upload your mod to either the Paradox Mods service or Steam Workshop. From "All Installed Mods", there is an "Upload Mod" button where you should be able to select the mod you have been working on. If it's not visible, make sure you have a folder which contains only the mod files (eg. /common/tradenodes) and a file called 'descriptor.mod'. Also, make sure you have a .mod file in the ...\Europa Universalis IV\mod\ folder with a "path =" line pointing towards your mod folder.

What is in each folder[edit | edit source]

common[edit | edit source]

advisortypes[edit | edit source]

Defines the different types of advisors which can be hired: their traits, associated monarch power, and what modifies the chance of getting one.

ai_attitudes[edit | edit source]

Defines the attitudes AI countries can have to the player and each other, such as Neutral attitude Neutral, Friendly attitude Friendly, Hostile attitude Hostile, Protective attitude Protective, etc., along with what modulates the chances of having these attitudes.

ai_personalities[edit | edit source]

Defines the overall "personalities" that AI countries can have, such as Administrator Administrator, Militarist Militarist, Diplomat Diplomat, etc. There isn't much that you can change in here; it's practically hardcoded.

bookmarks[edit | edit source]

Defines the bookmarked dates that appear in the scenario selection screen, along with the suggested countries to play.

buildings[edit | edit source]

Specifies what buildings can be built and their associated costs and benefits.

cb_types[edit | edit source]

Defines the Casus Bellis (CBs) a nation may use to declare war. It is important to note that wargoals are not defined in this file, and that incorrectly defining either may cause strange bugs.

church_aspects[edit | edit source]

Defines Protestantism Protestant church aspects and benefits of them and blessings for Coptic.png Coptic nations.

client_states[edit | edit source]

Defines the preset client states which a nation may create upon reaching technology level 22.

colonial_regions[edit | edit source]

Defines the areas where colonial nations may spawn in. You need 5 provinces in a colonial region to spawn a colonial nation.

countries[edit | edit source]

Contains a list of text files describing some of the properties all countries, such as their historical idea groups, ruler names, leader names, ship names, their color on the map, and so on.

country_colors[edit | edit source]

Ordinarily the colors of a country's soldiers' uniforms are determined by the engine looking at the dominant colors of their flags. However, for certain countries it is sometimes needed to override this.

country_tags[edit | edit source]

Defines a unique, 3 letter code, or "tag", for every single country, and points to the file in common\countries in which it is defined. It is important that every single tag defined herein has a corresponding file in common\countries, or else the game will crash at launch. Check to make sure it is spelled correctly.

cultures[edit | edit source]

Defines Culture icon.png cultures and culture groups.

custom_country_colors[edit | edit source]

Defines colors that can be used by custom nations.

custom_ideas[edit | edit source]

Defines ideas that can be used by custom nations.

defines[edit | edit source]

Defines the bonuses to players and AIs with different difficulty levels.

diplomatic_actions[edit | edit source]

Defines diplomatic actions and requirements for completing them.

disasters[edit | edit source]

Defines disaster types, triggers, and modifiers.

dynasty_colors[edit | edit source]

Defines the colors of dynasties on the dynasty mapmode.

estates[edit | edit source]

Defines the estates that you can interact and give provinces to.

event_modifiers[edit | edit source]

Defines modifiers which may give bonuses or maluses to a country, which are activated by event. These can be for either provinces or countries. The duration of the modifier is not specified in here, but in the event which triggered it.

factions[edit | edit source]

Defines the factions used in Flag of Ming Ming's Celestial Empire government, merchant republics, and revolutionary republics. It is possible to define new factions in here too, for other countries. This requires many other files to work in tandem. For more information see modding factions.

fervor[edit | edit source]

Defines use of Monthly fervor.png fervor and related bonuses.

fetishist_cults[edit | edit source]

Defines the cults that you can choose from when playing as a Fetishist Fetishist nation.

government_names[edit | edit source]

Defines the names that will appear in events and decisions depending on your government rank and type.

governments[edit | edit source]

Defines the different types of governments and under what conditions the AI will switch to them.

great_projects[edit | edit source]

Defines Great Projects and associated modifiers.

hre_reforms[edit | edit source]

Defines the reforms the Emperor can pass, from Reichsreform to Renovatio Imperii

ideas[edit | edit source]

Defines the Idea unlock ideas unlocked through spending points, as well as unique country (and group) National Ideas and Traditions.

institutions[edit | edit source]

Defines Institutions.png institutions, bonuses for supporting them, as well as their spawn province.

leader_personalities[edit | edit source]

Defines personality traits that generals and admirals may acquire after battles, and their associated bonuses.

native_advancement[edit | edit source]

Defines native ideas and other properties.

natives[edit | edit source]

Defines what type of natives live in different unoccupied provinces according to region, and their numbers, Native aggressiveness aggressiveness, and Ferocity.png ferocity.

on_actions[edit | edit source]

These are triggers for events which fire when the game engine reaches certain conditions. These conditions do not seem to be documented well anywhere (though see this forum discussion) Some of these conditions are based on a game event like losing a siege, which can trigger event #9206, an event about tribal armies looting. Others are triggered via "pulses", as in "on_bi_yearly_pulse" which has a chance to trigger one of several events every two years.

opinion_modifiers[edit | edit source]

Defines the modifiers to countries' opinions of each other, and how long they last for.

parliament_bribes[edit | edit source]

Defines the required bribes for Parliament to increase the chances of passing legislation.

parliament_issues[edit | edit source]

Defines the issues that you can choose from in the Parliament menu.

personal_deities[edit | edit source]

Defines personal deities and associated bonuses for each for Hindu and Norse religions.

policies[edit | edit source]

Defines policies (acts) and associated modifiers granted by enabling each of them.

powerprojection[edit | edit source]

Defines fixed, dynamic, and ticking sources of Power projection.png power projection, their decay, and their maximums.

prices[edit | edit source]

Defines the prices of tradegoods, and what alters the demand for them.

province_names[edit | edit source]

Defines dynamic province names; used if setting is enabled.

rebel_types[edit | edit source]

Specifies the different types of rebels, what their demands are, when they spawn, how hard they fight, etc.

region_colors[edit | edit source]

Determines the color of each region in the region mode, not labeled.

religions[edit | edit source]

Defines the different religions ingame along with their associated heresies, province and country bonuses, what they call their wars, and so on. More more information see religion modding

religious_reforms[edit | edit source]

Defines religious reforms for the Nahuatl.png Nahuatl, Inti.png Inti, and Mayan.png Mayan religions.

revolt_triggers[edit | edit source]

Determines if a country will become independent from rebels.

ruler_personalities[edit | edit source]

Defines various ruler personalities, their effects, modifiers to chances of developing, and costs for custom nations.

scripted_effects[edit | edit source]

Scripted effects.

scripted_functions[edit | edit source]

Scripted functions.

scripted_triggers[edit | edit source]

Scripted triggers.

static_modifiers[edit | edit source]

Defines the effects of a large number of effects that don't change, such as Yearly prestige.png prestige, Legitimacy.png legitimacy, and War exhaustion.png war exhaustion.

technologies[edit | edit source]

Specifies the different tech levels according to what monarch power is used for them.

trade_companies[edit | edit source]

Defines provinces required, naming, and colors of trade companies.

tradegoods[edit | edit source]

Defines tradegoods and what effects come from controlling their trade.

tradenodes[edit | edit source]

Defines which provinces are in what tradenodes, and how the nodes connect to each other.

triggered_modifiers[edit | edit source]

Defines things like the "Conquest of Mecca" modifier which hold constant so long as certain conditions are met.

units[edit | edit source]

Defines the stats and tech group of land and naval units.

wargoal_types[edit | edit source]

Defines wargoals for Casus Bellis (i.e. what can be taken in peace deals and what causes the ticking warscore)

achievements.txt[edit | edit source]

Defines achievements.

alerts.txt[edit | edit source]

This file holds your message settings.

defines.lua[edit | edit source]

Miscellaneous things. Searching this file can be useful for finding a number of settings.

graphicalculturetype.txt[edit | edit source]

Defines graphical culture types.

historical_lucky.txt[edit | edit source]

Defines lucky nations.

technology.txt[edit | edit source]

Defines tech groups.

decisions[edit | edit source]

These .txt files define the decisions a country can take, including its preconditions, effects and what determines whether the AI will pick it.

events[edit | edit source]

These files define events that can happen to players or AI countries: what triggers them, how often they happen, and their options and effects.

gfx[edit | edit source]

Contains the art assets used ingame. Most germane for modding are the flags and event_pictures folders.

history[edit | edit source]

advisors[edit | edit source]

Defines historical advisors (Machiavelli, da Vinci, Newton, etc.)

countries[edit | edit source]

Files in here define the history of every country in the game. The filenames must begin with the country's tag. At a bare minimum they must contain the preferred government type, tech group, religion, culture and preferred capital. Optionally they may specify historical monarchs, regime changes, religious conversions and the like.

diplomacy[edit | edit source]

Define historical alliances, royal marriages, vassals, etc.

provinces[edit | edit source]

The history of every single province in the game is specified here. Who owned it, the base tax, who had discovered it, the religion, trade goods, etc.

wars[edit | edit source]

Historical wars.

interface[edit | edit source]

These .gfx and .gui files define the structure of the interface, menus, and how the art assets are displayed.

localisation[edit | edit source]

Contains .yml files specifying what text is displayed ingame, optionally translated into other languages.

map[edit | edit source]

lakes[edit | edit source]

Contains the positions and elevations of lakes.

random[edit | edit source]

Base files for use in generating random new world map tiles

tiles[edit | edit source]

Files and images relating to new random new world tiles

terrain[edit | edit source]

Contains small image files specifying how things like the fog of war, border lines and so on look.

adjacencies.csv[edit | edit source]

Defines what provinces are connected to others via narrow straits that troops can walk across unless blockaded by an enemy.

ambient_object.txt[edit | edit source]

Tells the engine where to display flavor objects on the map, like bears and eagles and windmills and stuff.

area.txt/region.txt/superregion.txt[edit | edit source]

Defines the areas, regions and superregions for provinces

climate.txt[edit | edit source]

Defines the climates of provinces, like which ones get the attrition modifiers in winter.

continent.txt[edit | edit source]

Defines which provinces belong to which continent.

definition.csv[edit | edit source]

Defines each province by number and what RGB value they correspond to in provinces.bmp

heightmap.bmp[edit | edit source]

Grayscale image telling the engine how high each bit of the map should be elevated. Light is high, dark is low. Altering this does NOT alter whether provinces have terrain penalties during combat; that is specified in terrain.bmp.

minimap.base[edit | edit source]

The background of the minimap

positions.txt[edit | edit source]

The location of buildings and units in a province

provinces.bmp[edit | edit source]

The layout of the provinces, both land and sea, are defined here. Each province is a unique RGB color, which is specified in definition.csv. When editing this make sure to do so without antialiasing or blurred brush edges on.

region.txt[edit | edit source]

Specifies which provinces belong to what region.

rivers.bmp[edit | edit source]

The locations of the rivers in the game.

seasons.txt[edit | edit source]

Defines the start and end of the seasons and how the color filter on the map changes.

terrain.bmp[edit | edit source]

Specifies which areas of the map are mountainous, forest, etc. by color.

terrain.txt[edit | edit source]

Defines the penalties associated with terrain, and how they correspond to the colors in terrain.bmp

trade_winds.txt[edit | edit source]

Defines the trade winds for oceanic crossings

trees.bmp[edit | edit source]

Locations of different tree types

world_normal.bmp[edit | edit source]

It's a normalmap for the engine to handle lighting and speculars and stuff.

_canal_river.bmp[edit | edit source]

Shows the location of the canal named at the start of the file

missions[edit | edit source]

Defines missions for the player and the AI can attempt, including the requirements, conditions for winning and failure, and the reward.

References[edit | edit source]

  1. [1], Patch 1.8 notes
Documentation EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localizationRun files
Scripting Scripted functionAdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEstatesEventsFactionsGovernmentGreat projectsHistoryIdea groupsInstitutionsMercenariesMissionsModifiersNation designerHoly Roman EmpirePoliciesReligionRebel typesSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapNation designerRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe ValidatorRun files
Guides Adding a provinceSave-game editing