Europa Universalis IV

Europa Universalis IV

45 ratings
Dynamic Names Redux
4
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
80.302 MB
29 Jun @ 9:11am
20 Jul @ 2:17am
3 Change Notes ( view )

Subscribe to download
Dynamic Names Redux

Description
This mod adds a dynamic names system to EU4. It will change the anme based on the government type, government rank, religion, dynasty, etc.

This ISN'T in any way connected to the 'old' Dynamic Names or Dynamic Names 2. This is better - more names, more dynamis and most importantly...

I attach the generator. All you need to do is to add whatever new tags and dynasties you have in your mod and add some rules of naming. That's all! You can generate your own dynamic names mod from this, just add a link to the OG one in the description.


Quick tutorial:
Once you download the mod, it includes a "generator" folder. Inside are other subfolders. The three files that interest us are "rules.json", "tagNames.txt" and "dynasties.txt". I'll quickly explain what each of them does.

* tagNames.txt
In this file, define the names of the tags in your mod. It's as simple as copy-pasting them from your localisation files. Important: DELETE the '0' that sometimes is added in the loc files. The generator won't process it and crash.

* dynasties.txt
In this file, list all the dynasty names that are to be dynamically used in namings (example includes the Hafsid Sultanate as a dynamic name for Tunis). Each dynasty name needs to be in its own line. There are no other requirements, spaces and such are ok.

*rules.json
This is the most complex file. Here you define the exact naming rules. Each entry is a JSON object. The easiest way to add a new one is to copy an existing one. The rules need to be separated with a comma (,). Each rule must have a unique identifier (the name written in ALL CAPS, for example KINGDOM or CHINESE_EMPIRE).
- name: here put whatever name you want to utilise. There are wildcards to make the names truly dynamic here. These are {NAME}, which defaults to the tag name (for example Sweden), {NAME_ADJ}, which defaults to the adjective and {NAME_ADJ2}, which defaults to the second adjective (it's used for example in the French localisation of EU4). These must of course be defined in the tagNames.
- tags: a list of tags (example: ["SWE", "DEN"], which will define the name as ONLY for these tags. Useful when a name is very much tag-based (example being "Duchy of Saint Sava" for Herzegovina).
- conditions: any other conditions. These are written in the normal code used to mod EU4. They must ALL be fulfilled in order for the name to be used.

There's also a file named "defines.py", which allows to change some presets. You can switch the name that will be used for the generated events and such there. Useful if you want to integrate the mod to your own and have a unified file naming system.

After all is set, simply run Main.py by double-clicking it. You need to have Python installed.

Debugging: in the game, open the console and type 'event dynamic_names.0' (or whatever other name you gave it in defines). It will show what event will be fired for your tag, simply run it via the console using 'event dynamic_names.XXX'. The event will list all the names that had been applied.

Important: The rules take precedent top-down. This means that the last rule on the list will be the last applied. Another quirk of the generator is that the dynastic name override all other. Make sure to put correct conditions. For example I made it so the Mamluk government doesn't get the {DYNASTY} Sultanate name.

Note: Generation takes time. Let it run in the background and go on a walk with a dog or something.

Note 2: This is not iroman-compatible. Will never be.
57 Comments
netcat 5 Aug @ 11:28am 
I tested it on a Windows 11 Virtual Machine with installing Python 3.12 through the Microsoft Store, and git from https://git-scm.com/downloads/win . Then i just did the command
pip install antlr4-python3-runtime
in CMD, i went to /generator and then i ran python3 main.py. If you still have issues running it, just send me a DM and we can work it out.
Jey the Count  [author] 5 Aug @ 7:41am 
Netcat, I can't run your code, how did you install Antlr4?
netcat 4 Aug @ 1:46am 
I believe I already fixed that in my version, will be updated soon.
Amuro 3 Aug @ 7:43pm 
Great mod, but sometimes it says "Prinedom of" instead of "Princedom of" - particularly looking at the Prinedom of Joseon for a vassalized Korea
netcat 3 Aug @ 4:26pm 
Awesome! Yeah this mod really breathes new life into the game for me (i love seeing the names of nations change as a playthrough goes on, so this is basically perfect). That's why I'm putting (maybe too much) effort into this, haha.

I did change some things around per personal preference, I'll try to make a comprehensive list of all the changes I made so it's easy to keep track of.

I don't have that much modding experience with EU4 itself but I found this mod to be a great entrypoint for that, so I'm just playing around with it at this point, and seeing what other ideas i could come up with to make it even better.

I'll also stop hogging the comment section now so other people can come up with ideas!
Jey the Count  [author] 3 Aug @ 3:06pm 
Hollllllly cow, you truly put way more effort into this than I ever intended to, didn't you?

This is very cool. I'll gladly include your work and pin you as co-author.
Jey the Count  [author] 3 Aug @ 2:45pm 
Ok, I'll look into this tomorrow.
netcat 3 Aug @ 9:39am 
I've been working on a complete overhaul of the structure of the rules file as well. i've been experimenting with YAML instead of JSON, but i figured a structure similar to regular paradox script files may be better, so i made my own parser for it as well.

The benefit of this is that not only is it now closer to the regular PDX modding script language, but it also benefits from formatting and code highlighting using the CWTools Paradox Language Services extension for VSCode, which makes adding rules much easier (at least, in my experience.)

The main script is now extensible and efficient as well, so that's a huge bonus too.

If you'd like to take a look before i do any pull requests, feel free to check it out here. The rules are now in rules/rules.txt
https://github.com/man-netcat/dynamic-names-generator
netcat 28 Jul @ 1:18am 
Enjoy your holidays!