I've been playing around with DLL injection to patch the hard-coded limit on duchy titles for kings since it's been really annoying me that if you're a mega-duke and you form/usurp a kingdom it significantly weakens you, and I've come up with something that seems stable, but it's only been tested by me in one game on 1.03b of the GamersGate version of the game on Windows 7.
It's a bit messy since I don't really do much Windows programming so I had to make a lot of it up as I went along. It very likely only works on the GamersGate version of the game at the moment, because I don't have the Steam version of ck2.exe to test it with. I'm going to include the source here if anyone wants to improve it or make it work with the Steam version.
Here's a pre-compiled version:
View attachment CustomDuchyLimitBin.zip
And source:
View attachment CustomDuchyLimitSrc.zip
The config file is called duchymod.txt and has two lines, the first containing the duchy limit for a king and the second containing the opinion penalty for each duchy above that limit. The highest limit possible at the moment is 127, anything above that something bad will happen. Just run the game and once it's loaded run InjectMod.exe (doesn't really matter when, can be in the middle of a game), the mod will be loaded until you restart the game.
It shouldn't matter where the files are, as long as the exe, dll and config file are in the same directory. On Windows Vista and above you will need to have admin privileges to run it (it will automatically ask to execute as admin when you run it). I'm not sure about XP.
Hopefully they'll un-hardcode the values soon so this won't be necessary, but I'll try to keep it up to date with the latest version of the GamersGate version of the game at least.
There is no guarantee this won't crash your game, so please save before trying to load it.
It's a bit messy since I don't really do much Windows programming so I had to make a lot of it up as I went along. It very likely only works on the GamersGate version of the game at the moment, because I don't have the Steam version of ck2.exe to test it with. I'm going to include the source here if anyone wants to improve it or make it work with the Steam version.
Here's a pre-compiled version:
View attachment CustomDuchyLimitBin.zip
And source:
View attachment CustomDuchyLimitSrc.zip
The config file is called duchymod.txt and has two lines, the first containing the duchy limit for a king and the second containing the opinion penalty for each duchy above that limit. The highest limit possible at the moment is 127, anything above that something bad will happen. Just run the game and once it's loaded run InjectMod.exe (doesn't really matter when, can be in the middle of a game), the mod will be loaded until you restart the game.
It shouldn't matter where the files are, as long as the exe, dll and config file are in the same directory. On Windows Vista and above you will need to have admin privileges to run it (it will automatically ask to execute as admin when you run it). I'm not sure about XP.
Hopefully they'll un-hardcode the values soon so this won't be necessary, but I'll try to keep it up to date with the latest version of the GamersGate version of the game at least.
There is no guarantee this won't crash your game, so please save before trying to load it.