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.

Contents

.mod file[edit]

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.

Steam tags[edit]

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]

  • 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]

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.

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]

What is in each folder[edit]

common[edit]

advisortypes[edit]

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]

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]

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]

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

buildings[edit]

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

cb_types[edit]

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]

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

client_states[edit]

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

colonial_regions[edit]

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

countries[edit]

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]

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]

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]

Defines Culture icon.png cultures and culture groups.

custom_country_colors[edit]

Defines colors that can be used by custom nations.

custom_ideas[edit]

Defines ideas that can be used by custom nations.

defines[edit]

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

diplomatic_actions[edit]

Defines diplomatic actions and requirements for completing them.

disasters[edit]

Defines disaster types, triggers, and modifiers.

dynasty_colors[edit]

Defines the colors of dynasties on the dynasty mapmode.

estates[edit]

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

event_modifiers[edit]

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]

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]

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

fetishist_cults[edit]

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

government_names[edit]

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

governments[edit]

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

great_projects[edit]

Defines Great Projects and associated modifiers.

hre_reforms[edit]

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

ideas[edit]

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

institutions[edit]

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

leader_personalities[edit]

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

native_advancement[edit]

Defines native ideas and other properties.

natives[edit]

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

on_actions[edit]

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]

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

parliament_bribes[edit]

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

parliament_issues[edit]

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

personal_deities[edit]

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

policies[edit]

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

powerprojection[edit]

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

prices[edit]

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

province_names[edit]

Defines dynamic province names; used if setting is enabled.

rebel_types[edit]

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

region_colors[edit]

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

religions[edit]

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]

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

revolt_triggers[edit]

Determines if a country will become independent from rebels.

ruler_personalities[edit]

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

scripted_effects[edit]

Scripted effects.

scripted_functions[edit]

Scripted functions.

scripted_triggers[edit]

Scripted triggers.

static_modifiers[edit]

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

technologies[edit]

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

trade_companies[edit]

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

tradegoods[edit]

Defines tradegoods and what effects come from controlling their trade.

tradenodes[edit]

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

triggered_modifiers[edit]

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

units[edit]

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

wargoal_types[edit]

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

achievements.txt[edit]

Defines achievements.

alerts.txt[edit]

This file holds your message settings.

defines.lua[edit]

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

graphicalculturetype.txt[edit]

Defines graphical culture types.

historical_lucky.txt[edit]

Defines lucky nations.

technology.txt[edit]

Defines tech groups.

decisions[edit]

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]

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]

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

history[edit]

advisors[edit]

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

countries[edit]

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]

Define historical alliances, royal marriages, vassals, etc.

provinces[edit]

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]

Historical wars.

interface[edit]

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

localisation[edit]

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

map[edit]

lakes[edit]

Contains the positions and elevations of lakes.

random[edit]

Base files for use in generating random new world map tiles

tiles[edit]

Files and images relating to new random new world tiles

terrain[edit]

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

adjacencies.csv[edit]

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

ambient_object.txt[edit]

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

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

Defines the areas, regions and superregions for provinces

climate.txt[edit]

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

continent.txt[edit]

Defines which provinces belong to which continent.

definition.csv[edit]

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

heightmap.bmp[edit]

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]

The background of the minimap

positions.txt[edit]

The location of buildings and units in a province

provinces.bmp[edit]

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]

Specifies which provinces belong to what region.

rivers.bmp[edit]

The locations of the rivers in the game.

seasons.txt[edit]

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

terrain.bmp[edit]

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

terrain.txt[edit]

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

trade_winds.txt[edit]

Defines the trade winds for oceanic crossings

trees.bmp[edit]

Locations of different tree types

world_normal.bmp[edit]

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

_canal_river.bmp[edit]

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

missions[edit]

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

References[edit]

  1. [1], Patch 1.8 notes
Documentation EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localization
Scripting AdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEstatesEventsFactionsGovernmentGreat projectsHistoryIdea groupsInstitutionsMissionsModifiersNation designerPoliciesReligionRebel typesSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe Validator
Guides Adding a province