Province modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

A person visiting this page is likely wondering how to create a province. Below are a few guides for different image-editor programs. This guide was made for Windows 7 and Mac OSX 10.9, but should work on other versions of Windows and Mac.

Incompatible programs[edit]

Microsoft Paint, Paintbrush (on Mac), OpenOffice Draw and LibreOffice Draw (on Linux) are unable to edit rivers.bmp, heightmap.bmp, and terrain.bmp because they lack the ability to open indexed colors and retain them through saving. This issue often occurs when a person edits one of those files with one of the mentioned programs and finds that EU4 crashes upon launch.

GIMP[edit]

In order to showcase all the possible features a new island will be added to the Irish Sea in its own tradenode and continent.

Setting up shop (Windows)[edit]

Making a new folder
Adding the .mod file

First, create a folder at C:/Users/<Username>/Documents/Paradox Interactive/Europa Universalis IV/mod, which should be your default location for EU4. If it's not there, try searching around or, in a worst-case scenario, re-installing EU4 at this location. Name the file whatever you want, however for this mod I chose "Celtica". Then, if there already is a mod installed in the mods folder, it is recommended to copy the .mod file (on windows it may show up as a Windows Media Player file) and rename it to the same name as your folder. Then open it (The tutorial uses notepad++) and change name="<name>" and archive="mod/<foldername>". Remember, since this is a folder and not a .zip file it is not necessary (and will break the mod) to add .zip after the file name.

The "Skimpy" Way (Windows)[edit]

If for some reason there is little disk space or perhaps it takes too long to copy files, an inconvenient yet bare-bones "what you need to copy" guide is below. If time is not to be wasted, and work would like to begin on actual modding immediately, head on to the instructions in "The Quick Way".

Next, go to the installation of vanilla EU4 (which should be located at C:/Program Files (x86)/Steam/SteamApps/common/Europa Universalis IV) and copy the map folder. Paste the map folder into your mod folder in /mod. Then, in your mod file create the a "history" folder then a "provinces" folder. While not necessary, it is officially recommended to copy a province from C:/Program Files (x86)/(. . .)/history/provinces into the new folder at C:/Users/(. . .)/mod/<mod folder name>/history/provinces for ease of creating a province later. Then, create a folder called "common" in the mod and further in create a folder called "tradenodes" and copy said file (which should be called 00_tradenodes) from the vanilla installation. After that, create a folder named "localisation" and take prov_names_l_english and EU4_l_english from the vanilla folder.

The Quick Way (Windows)[edit]

Copy the common folder, history folder, localization folder and map folder from C:/Program Files (x86)/Steam/SteamApps/common/Europa Universalis IV to C:/Users/<Username>/Documents/Paradox Interactive/Europa Universalis IV/mod. Then If done correctly the file should be somewhere around 210MB.

Setting up shop (Mac)[edit]

First, create a folder at /Users/<Username>/Documents/Paradox Interactive/Europa Universalis IV/mod, which should be your default location for EU4. If it's not there, try searching around. Name the file whatever you want, however for this mod I chose "Celtica". Then, if there already is a mod installed in the mods folder, it is recommended to copy the .mod file (it may show up as a video file) and rename it to the same name as your folder. Then open it (this tutorial uses textedit) and change name="<name>" and archive="mod/<foldername>". Remember, since this is a folder and not a .zip file you should not add .zip after the file name.

Copy the common folder, history folder, localization folder and map folder from /Users/<Username>/Library/Application Support/Steam/SteamApps/common/Europa Universalis IV to /Users/<Username>/Documents/Paradox Interactive/Europa Universalis IV/mod/<Modname> (the folder created earlier). Then, if done correctly the folder should be somewhere around 210MB.

Setting up shop (Linux)[edit]

First find the mod folder which is usually located at ~/.paradoxinteractive/Europa Universalis IV/mod. If it's not there, try searching around:

   $ find ~/ -iname "mod"

go to the folder and create your mod directory

   $ cd  ~/.paradoxinteractive/Europa\ Universalis\ IV/mod
   $ mkdir "{your mod name}"

If there already is a mod installed in the mods folder, it is recommended to copy the .mod file (it may show up as a music file) and rename it to the same name as your folder:

   $ ls
   $ cp "{existing mod name}.mod" "{your mod name}.mod"

If there is no such file you can create a new one:

   $ touch "{your mod name}.mod"

Then open it and change name="{your mod name}" and archive="mod/{your mod name}". Remember, since this is a folder and not a .zip file you should not add .zip after the file name.

Copy the common folder, history folder, localization folder and map folder from ~/.local/share/Steam/SteamApps/common/Europa Universalis IV to ~/.paradoxinteractive/Europa Universalis IV/mod/{your mod name} (the folder created earlier).

   $ cp -r ~/.local/share/Steam/SteamApps/common/Europa\ Universalis\ IV/common "{your mod name}/common"
   $ cp -r ~/.local/share/Steam/SteamApps/common/Europa\ Universalis\ IV/history "{your mod name}/history"
   $ cp -r ~/.local/share/Steam/SteamApps/common/Europa\ Universalis\ IV/localisation "{your mod name}/localisation"
   $ cp -r ~/.local/share/Steam/SteamApps/common/Europa\ Universalis\ IV/map "{your mod name}/map"

Then, if done correctly the folder should be somewhere around 210MB.

   $ du -sm "{your mod name}"

Editing heightmap.bmp[edit]

Editing Heightmap

Since a new island is being added, adding a province in province.bmp would simply add a province in the middle of the ocean which is not fun. First, open heightmap.bmp in GIMP. Anything below (95, 95, 95) is water so a recommended course of action is to use the colorpicker tool and select a color from coastal Netherlands or Florida. After you're done drawing it should look like something to the right. Make sure the image is in greyscale (Image > Mode > Grayscale) and hit Shift+Control+E or navigate to (File > Export As. . .). Make sure that the image is being saved in .bmp format and in the map path in your mod, then click on the plus next to compatibility options (the screen should pop up after confirming that you'd like to overwrite heightmap.bmp) and check '"Do not write colourspace information"'. This is important because if it is not done the mod will crash. Load up EU4 and if everything is done correctly something like the image to the right should appear.

Editing terrain.bmp[edit]

Editing Terrain.bmp

Obviously there's a problem! The island is all weird and blue. To fix that, terrain.bmp must be edited as well. One way of doing it is to use the rectangular select tool to select the entire image and then use Control+Shift+V to create a new image. On that new image, create a new layer then open heightmap.bmp, selecting it with the rectangular select tool, and then pasting it into the new layer on the new image. If your terrain.bmp appears as grey, change the image mode in ( Image > Mode) to RGB then paste again. While editing, it should look like something to the right.

After editing, proceed to copy the layer with the terrain and paste it onto the terrain on your original terrain.bmp, once again saving with '"Do not write colourspace information"' checked. Loading up your game, it should look like something to the right.

Editing the Color .dds files[edit]

Hmm. . ., it still looks faded and weird. But that's because the colormap interprets it as underwater! An approach such as using an online converter to convert from .dds to PNG and back is needed, since GIMP can't open dds files. Alternately, since this is just visual, this step can be skipped, though that is not recommended.

Pick a color from nearby landmasses and use that to color in the island, using the same techniques that were applied to editing heightmap.bmp.

Note: The .dds files are located in the terrain folder inside the map folder. They're labeled "colourmap_<season>" / "colourmap_water". They also are half the size of the terrain.bmp file.

Adding a province and editing the provinces.bmp[edit]

Adding the province
  • To add a province, first a color must be chosen. By default, several colors are assigned in the definition file in the map folder. Province 2026 is bugged, so move to 2027 and put in the name "Celtica" where the second to last x is. After the 2027 and before Celtica are 3 RGB codes. Make the color in GIMP reflect that, and using the strategy found while editing the heightmap.bmp add the color to the region of Celtica. If you are trying to set a province ID to anything lower than 2027 (so it is likely to be a complete map overhaul), then please see the below section 'How to edit existing provinces' when proceeding with this section.
  • After adding the province, make sure definition is saved and provinces.bmp is exported with '"Do not write colourspace information"' checked and the .bmp is saved as 24-bits.
  • Then, go into "default" found in the map folder and change the maximum number of provinces to 2028. Also add the province number to one continent in "continent.txt", one winter zone in "climate.txt" and as many regions as necessary in "region.txt".
  • Open "prov_names_l_english" which can be found in the localisation folder, go to the end and follow the formatting while putting in the new province name.
  • As a final step, Go to history/provinces and copy the file named "1-Uppland" and rename it with the province details, in this case "2027-Celtica". This file can now be specified to have different cores, basetax, trade good etc., all of which should be already set up in the folder you copied, you should just have to change the values.

Congratulations! A new province! However it still looks strange - don't worry it'll be fixed soon enough.

Adding a new tradenode[edit]

To showcase the power of nudge, a new trade node will be added.

  • In EU4_l_english (in the localization folder), find "ragusa" and after finding it put "celtica: "Celtica"".
  • In Common/tradenodes open 00_tradenodes and scroll to the end, and add this (pastebin.com).
  • Scroll up until you find western_european_coast (line 1276) and just after antwerpen but just before members add this (pastebin.com).

Using nudge[edit]

Using nudge

Open up any scenario (e.g. Rise of the Ottomans) and open the console (with a US/UK keyboard the key to do this is ` (grave) key or Shift+'). Type in nudge to enter the nudge screen.

  • Click on the dinghy at Hatton Bank (to the west of France) and use the arrows to change the trade route to Celtica. Once there, use the arrows next to Control Points to add and delete and edit the path of the trade route to Celtica.
  • Next, click on the province of Celtica and then a box filled with options such as "City" and "Unit" will be present. To quickly move these ambient objects, use right click.

Important: Click on the 'save' button as exiting out of nudge may crash the game and the setting will not be saved otherwise.

Next, exit the game and go to the /Documents/Paradox Interactive/Europa Universalis IV/map. Not the EUIV folder from your SteamLibrary folder. There should be a file titled "positions.txt" so take the file and move it to /<modname>/map.

Adding adjacencies[edit]

Opening the adjacencies.csv file, make two lines and add; 2027;241;sea;1285;-1;-1;-1;-1;Celtica-Ireland 2027;374;sea;1285;-1;-1;-1;-1;Celtica-Wales

These can be explained as From;To;Type;Through;start_x;start_y;stop_x;stop_y;Comment. -1 for coordinates will make the game automagically plot lines from provinces.

End product[edit]

Following all of this, the following should be (roughly) seen.

Complete island

Thanks for using this WIP guide!

How to edit existing provinces[edit]

If you are doing a complete map overhaul, you may want to use the existing province ID's for different ones. Just follow all the steps above all the way up until you have to edit files in the history/provinces file (In the Adding a province section). It is important now that you still include the vanilla files for the original provinces, but instead edit the content of the file to read replace_path = "history/provinces/<file name that the province is being replaced with>.txt".

For example, if I wanted my Celtica file to replace Uppland and have the ID 1, I would start by opening the '1-Uppland' file (in a program like Notepad) and saving it as '1-Celtica'. Then, I would have to edit the 1-Uppland file to read replace_path = "history/provinces/1-Celtica.txt". I can then edit the Celtica file so that all the information in there is correct to the information I have researched about the province, and voila, it should work

It is essential to do this otherwise the game will still read the vanilla files as well, so you'll end up with multiple countries having cores where you do not want them.

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