• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

unmerged(53410)

Second Lieutenant
Jan 29, 2006
126
0
I have been spending some time writing a CK2 to EU3 converter, I wrote it in C# so you will need .NET 4.5 to use it.
It is still a BETA, so lot's of features are still missing or not yet working as intended. Please, help by posting about errors, weird results, etc.
I have exposed many functions and values to Lua so it is easy to modify, even without any programming experience.
The current version has only been tested for converting from CK2 as early as v1.02b and as late as v1.103 (vanilla) to EU3 DW 5.2 (vanilla and with Idhrendur's converter mod version 0.4A).

About converting from ck2 mods:
As far as I know the converter does not work with any ck2 mod unless you also mod the converter scripts, if you make such modifications please let me know so I can help you and publish the result here.
At this point metalguy24 has started to work on converter scripts for converting from CK2Plus to EU3 DW vanilla.
Other than that I don't know of anyone working on making the converter usable with mods.

#DOWNLOAD version 1.01
https://dl.dropbox.com/u/3443348/CK2toEU3.rar

#INSTALL
1. Copy the folder "converter" to your CK2 install folder (not the folder "CK2toEU3" but the sub folder "converter").
2. Open the file "converter\defines.lua" using any text editor
3. Set the fields in_path and out_path to the paths you would like to use for the ck2 and eu3 save files being converted

#USE
1. See INSTALL 2-3 and make sure the paths are correct
2. Run the program (CK2toEU3.exe)
3. If the output eu3-file is not in the eu3 save games folder move it there
4. Play!

Version 1.01
*The converter now supports CK2 version 1.103
*Increased chance for viking nations to get quest_for_the_new_world at conversion
*Active global flags are now exposed to lua, e.g. flags.greenland_discovered = true if greenland_discovered is set
*Greenland and Vinland can now only be converted as colonized if they have been discovered

Version 1.0
Download 0.96
*Completely rewritten engine, to get a more flexible code base
*Converter is now supporting every CK2 version from 1.02b to 1.102
*Converter is now supporting EU3 DW version 5.2
*Converter now includes full support for Idhrendur's converter mod version 0.4A, just set use_converter_mod_0_4A to true in defines.lua
*Reworked the province link system, now every EU3 province is built from a group of de jure CK2 titles (see province.lua)
*Reworked culture.lua, making it easier to understand and use, also changing a lot of the culture conversion rules
*Added a lot of province and city name variations
*Minor changes is made in almost every other script file

Version 0.96
Download 0.96
*Can now convert from 1.09
*Added tag lists for all new titles on duchy tier and above
*Added basic heir picking for ultimogeniture and tanistry
*Added support for trade post buildings in the scripts
*Slightly modified building conversions

Version 0.95
Download 0.95
*Slightly modified the hre.get_imperial_influence function
*Added the possibility to map ck2 provinces to eu3 provinces with special settings (e.g. Madeira)
*Added tag lists for e_roman_empire (Roman Empire) and e_mexikha (Aztec Empire)
*Fixed a crash that some times occurred when searching for the player's eu3 nation in the writing process
*nahuatl culture now converts to aztek
*religion aztec is now converted to animism
*Religions miaphysite and monothelite is now converted to orthodox heresy

Version 0.93
Download 0.93
*Non pagan republics that don't converts as noble_republic or merchant_republic will now be converted as administrative_republic
*Increased chance for pagan republics to get tribal_democracy or tribal_federation
*Nations that get noble_republic, merchant_republic or administrative_republic will now get government tech level 10
*Nations that get papal_government or theocratic_government now get government tech level 9
*Nations that get imperial_government now get government tech level 8
*Made it more likely for all other nations to get a government tech level of at least 5
*Increased the chance for muslim nations to get a government tech level of at least 3
*Max land tech level on conversion is now 10
*Increased the chance for a nation that get more than one CoTs to get a higher trade tech level
*Made it less likely for poor nations to get a high trade tech level
*Nations that get merchant_republic now get a trade tech level of at least 7
*All txt-files is now converted to lua
*Increased the number of non independent cores by making it possible for such nations to use the list of alt tags
*Modified several tag lists
*Fixed a crash for games started before 1.06

Version 0.9
Download 0.9

*Improved the main algorithm for setting cores to provinces
*Added cores for major non independent nations with de jure claim, not for empires
*Fixed a bug that made some rulers not convert at all
*Made lowborn characters convert with patronymic last name
*Made rulers of papal_government, tribal_democracy, noble_republic and merchant_republic nations convert without dynasty
*Made rulers of papal_government nations convert without any last name
*Made no_personal_union true for theocratic_government
*Removed the array gameplaysettings from defines.lua and placed the settings in the new file gameplaysettings.lua
*Under aged monarchs now converts as heir with a temporary regent
*Heirs gets a claim value (High if many relatives held title before or has other strong claim, low if a new dynasty with weak or no claim)
*Exposed the values strong_base_claim, avg_base_claim, weak_base_claim and generation_claim_factor to defines.lua
*Reduced legitimacy for nations with a temporary regent
*Made holy orders more likely to be converted as independent nations
*Changed the requirements for the tribal_democracy, tribal_federation and tribal_despotism government types
*Now converting ck2 diseases to the eu3 modifiers epidemic or plague (see disease.lua)
*Culture prussian now converts to old_prussian
*Culture german in several Baltic duchies now converts to prussian
*Cultures catalan, maghreb_arabic and egyptian_arabic on Malta now converts to maltese
*Culture alan now converts to georgian
*Culture polish no longer converts to pommeranian
*Culture manden in some places now converts to tuareg
*CK2 culture pommeranian now converts to polish except in d_silesia where it converts to schlesian
*Fixed a bug that made it possible for sub vassals to convert as independent
*Fixed a bug where the provinces of some not independent nations did not convert at all
*Modified several tag lists
*All bishoprics now get theocratic_government
*Catholic vassals is now more likely to get feudal_monarchy
*Added government.fixed_forms tables for more forms of governments to make modding that easier
*Made it more likely for tribal duchies (High Chiefdoms) to get tribal_federation by adding them to government.fixed_forms.tribal (government.lua)
*Made it more likely for the three Mongol hordes to get steppe_horde by creating and using the table title.mongol_hordes (title.lua and government.lua)
*Made it more likely for the three Mongol hordes to convert as independent
*Modified some TAG requirements
*Added a no_kingdom_vassals setting to defines.lua
*Made minor independent pagan nations that don't pass the independence test or don't get a tag convert as natives
*Exposed the values min_city_size_city, min_city_size_temple, min_city_size_castle to defines.lua and increased them to 1000, 400 and 100

Version 0.8
Download 0.8

*Fixed a bug where electors where not set to the HRE
*Exposed a max electors value for the HRE to defines.lua
*Changed main tag for e_il-khanate to JAI
*Fixed the tag list for d_bergen
*Fixed a bug when converting culture of rulers
*HRE emperor title now pick tags with the other emperors even if hre.remains fails and e_hre is removed
*Saxons that are under k_scotland both de jure and de facto is now converted to scottish
*Fixed bug where all direct vassals of an independent nation becomes independent
*If a barony in the HRE can not find an independent nation by searching up from the liege it now consider the emperor title it's nation
*Added 10 province points if one of the holders in a province is the hre emperor, making it less likely that the emperor don't get any provinces (value is exposed in defines.lua)
*Added german to pommerian culture conversion
*Added polish to pommerian culture conversion
*Added HSA (Hansa) as alternative tag to a bunch of hre and baltic counties
*Added some fixed province names
*Added some fixed city names
*Removed the tag KON from all titles
*Removed the tag ASH from all titles
*Added moddir functions, see defines.lua
*Added one alternative tag to all mercs that did not have one before
*Added tag lists for k_anatolia and d_susa
*Restructured the order of tag lists to make it more like in the current version of landed_title.txt
*Removed the tag PAP from all titles except papal state and the catholic holy orders
*Modified the restrictions for the tag TEU
*Slightly modified a bunch of tag lists
*Added restrictions for the tags HSA, GER and ITA
*Removed heretic to reformation conversion
*Added modifier heretic_country to heretic nations
*Added modifier heresy to heretic provinces and provinces with more than one major religion except in heretic nations
*Exposed the values heresy_pop_percent, heresy_years_max and heretic_country_years_max to defines.lua
*Excommunicated ruler is now excommunicated post conversion as well
*Nations with an excommunicated ruler is now forced to zero papal influence and zero cardinals
*Eliminated some situations that gave both an alliance and war between two nations on conversion
*Fixed a bug that made the system for fixed city names rarely used at all
*Added support to use Idhrendur's converter mod version 0.1, see the flag using_converter_mod_0_1 in defines.lua

Version 0.7
Download 0.7

*Fixed a bug where character names where not read correctly
*Personal union subjects is now less likely to become independent the longer they have shared ruler with the primary title
*Forcing personal union subject that do not become independent to merge with the holders primary nation
*Forcing personal union subject that do not get a tag to merge with the holders primary nation
*Now writing culture and religion of provinces to the history block as well making it more compatible with the EU3toV2 converter
*Removed debug printing of advisor types
*Minor script optimisations
*Decreased number of regiments converted
*Slightly increased the chance to get a university on conversion
*Slightly increased the chance to get an embassy on conversion
*Capitals of noble_republic and merchant_republic are now equal when placing CoTs
*Religions baltic_pagan, finnish_pagan, norse_pagan now converts to shamanism
*Fixed crash when converting catholic heresies
*Made sure only primary titles can get steppe_horde government
*Re-factored conversion of the HRE (thanks to Captain Frakas, not your design exactly but in the general direction)
*Made personal union subjects of republics merge with the primary title

Version 0.62
*Forced anti-pope controllers and their vassals to zero papal influence and zero cardinals
*As advisor anti-popes can now only be converted to a philosopher, theologian or inquisitor
*Sets the government of a nation ruled by an anti-pope to theocratic_government
*Sets the government of k_orthodox, d_sunni and d_shiite to theocratic_government
*Fixed a crash when writing some minor nations to the eu3-file

Version 0.61
*Added a log message when staring to pick TAGs for nations
*Fixed a crash when picking alternative TAGs for minor nations

Version 0.6
*Made sure that no title only have restricted TAGs in the list
*German culture in tyrol now converts to austrian
*Added separate TAG lists to some counties
*Added a TAG list for k_dacia
*Added a TAG list for d_latium
*Placed the required_indep_val in defines.lua for easy access
*Added a table.contains_any function to simplify the file culture.lua
*Improved conversion of some cultures
*Added conversion of kurdish culture
*Slightly increased the default values of stability per prestige and piety
*Slightly decreased the army and navy tradition points given from martial skill
*Added a separate treasury_ck2_to_eu3 value to defines.lua separating it from base tax conversion
*Slightly increased the numbers of merchants, officials and diplomats
*Slightly decreased the numbers of missionaries
*Slightly increased the city size from temple and castle buildings
*Forced the garrison sizes to 1000 * fort level
*Slightly changed quality_quantity conditions to push the average value a little towards quantity
*Restructured the government conversion function to fix some bugs in it
*Added a few post to the fixed province name list

Version 0.5
*Fixed bug where historical dynasties did not get there names
*Slightly increased the ruler stats conversion ratio
*Exposed the min and max restrictions of monarch and leader skills to lua
*Added a small compensation to monarch skills for non adult rulers
*If a catholic ruler is heretical, the heresy is now mapped to reformed or protestant
*The converter now prints its version number on init
*Fixed a bug with the conversion of some cultures e.g. saxon in brittannia converts to english
*Fixed a bug converting the main culture of cultural unions
*Fixed a crash when there is no or few independent catholic rulers on conversion
*Fixed a bug where the alternative tags for a title never was allowed
*Made e_hre government convert to feudal_monarchy instead of imperial_government unless it has the HRE tag
*Made it possible to get armories, training fields and barracks on conversion
*Improved the conversion of the german culture
*Improved the conversion of the saxon culture
*Increased the chance for an independent county to remain independent
*Counties can now have own tag lists and only uses the list of the de jure duchy if they don't

Version 0.4
*Modified temple conversion condition, making it more likely to get temple in provinces
*Lowered the manpower multiplier
*Lowered minimum martial skill to convert to leader, resulting in some more leaders
*Debug log writing added
*Added national idea generation
*Added gameplaysettings to the defines
*Reformed the advisor conversion function
*Added fixed city names to the province_names list
*Expanded the province_names list
*Added the new titles from Sword of Islam
*Added manden to mali culture conversion
*Fixed a bug with the lover relation
*Made polygamy possible
*Fixed bug when loading de jure liege of a title

Version 0.31
*Fixed a bug when parsing quoted strings
*Made 1452 fully acceptable as conversion year (building conversion)

Version 0.3
*First released version
 
Last edited:
I fixed some minor bugs, new version (0.31) is now up.
 
Make sure the converter folder (the one with CK2toEU3.exe) is placed in the ck2 installation folder (the on with ck2.exe).
And that the input/output paths in defines.lua are correct.

Edit: Sorry, the crash was probably all my fault. But it should be fixed now.

I will add a nice logging function in the next release to find bugs. :)
 
Last edited:
Version 0.4

Version 0.4 is now available, making the converter work with the current version of CKII.

Version 0.4
*Modified temple convertion condition, making it more likely to get temple in provinces
*Lowered the manpower multiplier
*Lowered minimum martial skill to convert to leader, resulting in some more leaders
*Debug log writing added
*Added national idea generation
*Added gameplaysettings to the defines
*Reformed the advisor convertion function
*Added fixed city names to the province_names list
*Expanded the province_names list
*Added the new titles from Sword of Islam
*Added manden to mali culture conversion
*Fixed a bug with the lover relation
*Made polygami possible
*Fixed bug when loading de jure liege of a title
 
So is everything functional in this? I mean does it correctly convert kingdoms, empires, cultures and religion?
 
So is everything functional in this? I mean does it correctly convert kingdoms, empires, cultures and religion?

There is no conversion mod included for EU3 so the converter works with what exists in EU3 DW.

Nations are converted using lists of possible tags, empires pick first, then kingdoms, then duchies. Nations have to pass an independence check, to see if they should be independent so some vassals will become eu3 vassals and some will be merged into the liege. Secondary titles can become independent but in personal union when converted.

Cultures are converted using special functions that are exposed in Lua. If you open the file culture.lua you can see how it works in the current version and make what changes you like.

Religion is converted but not heresy.

Beside your specific questions it also converts government type, ruler stats, money, manpower, dynasties, buildings, stability, policy sliders, tech levels, etc.
Characters can be converted to rulers, advisers, leader and cardinals.
There is a special system for converting the HRE.

Wow, you've done a pretty good job. Though strangely none of the rulers have stats above 1, or dynasties.

Thank you :) strange about the rulers, sounds like a bug. I will look into it soon.

Someone please post pics. And how does it work exactly? Does it create a bunch of new tags?

I will upload some pictures soon.

It uses the tags available in EU3 DW.

Most systems uses some lua-file so you can see for yourself and change whatever you like.
The tag-lists for example is in the file title.lua, there every duchy, kingdom and empire have a list of tags to choose from.
 
Here are some pictures.

ck2-001.jpg
First one is simply saved at start up from the hundred year war bookmark.
eu3-001.jpg
And how that one looks converted to EU3 DW.
You can see that some French vassals have been converted as vassals, it is the same in several other nations.
Also the HRE was not centralized enough to remain a united nation instead it uses the HRE system.
Norway as a secondary title of the Swedish king is now in a personal union under Sweden.

ck2-002.jpg
This is a game where I have form the Empire of Scandinavia.

eu3-002.jpg
Post conversion.
You can see that Scandinavia still holds together. Great :)
Also here is the HRE fragmented.
And you can see a bug, the Scandinavians seems to have forgotten the existence of some European provinces. Not so great. :(
 
Hi,
This looks like a great converter, but I've been having a problem with it. I've been playing the Fatimids in CK2, and have successfully conquered the entire map. I'd like to continue using my Fatimid superblob into EU3, but when I try to use your converter, it stalls. Under main.txt it shows it works normally until it tries to convert the papacy data, when it produces this error:
Converting papacy data...
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at CK2toEU3Lua.Papacy.Convert()
at CK2toEU3Lua.Program.Main(String[] args)

Then it crashes. I've tried fixing this bug by cheating and giving the Pope a single county, but the error still occurs. Do you have any idea what is going on, and how it could be fixed?
 
Very cool, thanks! I had one problem, I converted a game in which I had many kingdom titles. The game put the other kingdom titles in a personal union under me, which is fair, but then immediately all the unions were broken. I don't know if that's a bug or just EU3 being weird.
 
I am excited by the project, but I'm having a problem running it. The dos window opens and the program does something but it closes up before I can read more than a few lines and the output file is not created. Is there a way to pause it, or get it to output what it's doing in a debug file so I can tell you where it bombs out?

One possible problem issue is that it's really a 1.05 game (I don't have any complete 1.06 games yet), although I did open it in 1.06b and save it again, and it didn't seem to make any difference.
 
Look under the main.txt file in the converter folder. That's where the record of the dos output was recorded when I tried to use the converter. That's how I found out that the papacy was somehow crashing it.
 
True there should be a file called main.log or main.txt where the console output is saved.
 
Hi,
This looks like a great converter, but I've been having a problem with it. I've been playing the Fatimids in CK2, and have successfully conquered the entire map. I'd like to continue using my Fatimid superblob into EU3, but when I try to use your converter, it stalls. Under main.txt it shows it works normally until it tries to convert the papacy data, when it produces this error:
Converting papacy data...
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at CK2toEU3Lua.Papacy.Convert()
at CK2toEU3Lua.Program.Main(String[] args)

Then it crashes. I've tried fixing this bug by cheating and giving the Pope a single county, but the error still occurs. Do you have any idea what is going on, and how it could be fixed?

Is there any independent catholic ruler left at all? I found a bug which should result in this kind of crash if the converter does not find any catholic ruler, I will fix it in the next version.
Hold on, the Fatimids will rule Europe any day now. :)

Can you send me your ck2 save-file, please?

Very cool, thanks! I had one problem, I converted a game in which I had many kingdom titles. The game put the other kingdom titles in a personal union under me, which is fair, but then immediately all the unions were broken. I don't know if that's a bug or just EU3 being weird.

I have seen sub nations go both ways (full independence or merge into the main nation) but always very early in EU3 so there is probably a bug with the conversion.
I will try to figure this out, hopefully to the next release.
 
Last edited:
I think I figured it out, apparently Personal Unions dissolve automatically if the senior member's prestige is negative. I did have negative prestige, so that explains it. It was EU3 being weird after all.
 
It looks like a great mod! Too bad I dont get it to work! :( I think its something wrong with the paths but whatever I do it doesn't fix it. Is it maybe because I bought CK2 on Steam?
 
I use the steam version.
Have you installed .NET 4.0 ?
Do you get a log-file (main.log)?