ParadoxGameConverters / EU4ToVic3

Converts Europa Universalis 4 saves into Victoria 3 mods.
MIT License
49 stars 24 forks source link

Character importing and names #488

Open IohannesIohannium opened 11 months ago

IohannesIohannium commented 11 months ago

Due to how heavily it would need to do calculations, make the following as an optional thing that is turned off by default.

When we import a character from EU4, the converter should check if the names already exist as localized strings in blankMod/output/localization/english/replace/names/99_names_l_english.yml and [...]/replace/dynasties/99_dynasty_names_l_english.yml. The checking process implies stripping the original name from diacritics, converting the spaces into underscores, then find out if there are any strings in the file that are [2 or 3 characters], underscore, normalized string (with an initial dyn_ if a last name). If yes, it is matched. Although technically more strings may match, for simplicity we use the first one found.

Example: we have a EU4 general named François D'Estienne d'Orves. The given name, François, gets normalized into Francois and is then matched with fr_Francois; the last name is normalized to D'Estienne_d'Orves and matched with dyn_fr_D'Estienne_d'Orves. Thus, when creating him in Vic3 as a general, we'll have the following:

create_character = {
    first_name = fr_Francois
    last_name = fr_D'Estienne_d'Orves
    ...
}

This ensures our general is displayed as François D'Estienne d'Orves in most languages, as Франсуа Д'Естиен д'Орв in Russian, etc.

Because EU4 puts regnal numbers in the first-name field, it is clear that monarch names are never going to be matched, but that is something for another issue.

IohannesIohannium commented 11 months ago

In case (as I cannot check) Victoria 3 does not employ regnal numerals, we can also apply the above procedure to monarch names, provided we strip them of the number (easily check by regex to remove [space][I, V or X][I, V, X, none][I, V, X, none] at the end of any found name)