Crusader Kings 2

Personal Castle & Secret Base Mod

Author

George Wong

Date, Revisions

Created on 10 March, 2015

Abstract

This is an experiment in modding Crusader Kings 2 on PC. The ruler of any demense gets a personal castle to occupy. I wanted to add some custom buildings to my personal castle which no other player can build. I looked at the source code for another personal castle mod from Steam Workshop and began coming up with my own buildings with interesting results.

Document Status, Version

Version 1.0

Prerequisites

Crusader Kings 2 (Required)

Notepad++

Basic programming knowledge




Crusader Kings 2 Map


Abstract

This is an experiment in modding Crusader Kings 2 for the PC. The ruler gets a personal castle to occupy (usually in your starting demense). I wanted to add a building with additional bonuses to my castle, which no other player or AI can build. I looked at the source code for another similar mod from Steam Workshop and began experimenting with the variables. The challenge was figuring out the syntax and fine-tuning the changes without breaking the game.

My ruler, wife and six children ;-)


Crusader Kings 2 Ruler

The Personal Castle mod v1.73

The Personal Castle mod is available from the Crusader Kings II Steam workshop. It was built by Steam user =F4D=Nuubialainen. I didn't have skills to create a new mod from scatch so this will be the foundation of my own mod when I figure out how to make it standalone.

Make sure you install it in the right location and enable it on the launcher. If the launcher doesn't have the mod, Steam probably didn't put the mod in the correct folder. Paradox Interactive places mods in the user directory, not the Steamapps folder.

For example:
C:\Users\[Computer Name]\Documents\Paradox Interactive\Crusader Kings II\mod\Personal_castle
										

Mod

Mods have a *.mod file and an associated folder name. I assume the mod file is a text file which redirects to the files for the CK2 launcher


Mod

I've only edited two files from this mod:

C:\Users\[Computer Name]\Documents\Paradox Interactive\Crusader Kings II\mod\Personal_castle\common\buildings\00_Personal_castle_buildings.txt
C:\Users\[Computer Name]\Documents\Paradox Interactive\Crusader Kings II\mod\Personal_castle\localisation\personal_castle_buildings.csv
										

The text file contain the code for the new building. The csv file contain the name and description of the building and various languages supported. I only did the English translation.


Mod

My Secret Base

Secret Base is a cheat mod. I wanted my ruler to be overpowered. Maybe in future I'll make it upgradeable so that it wouldn't be instantly overpowered.

I made Secret Passage a prerequisite to the Secret Base. This was pretty easy to figure out. I also adjusted the name and associated description of the building located in the localisation folder as a *.CSV file.

Secret base description

This is existing code for Secret Passages from Nuubialainen's mod.

castle = {
	ca_secret_passages = {
		potential = {
			OR = {
				FROM = { 
					OR = {
						tier = KING
						tier = EMPEROR
						ai = no
					}
					capital_holding = {
						title = FROMFROM
					}
				}
				FROMFROM = {
					has_building = ca_secret_passages
				}
			}
		}
		trigger = { TECH_CONSTRUCTION = 0 }
		desc = ca_secret_passages_desc
		build_cost = 250
		build_time = 650
		ai_creation_factor = 70
		extra_tech_building_start = 100
		add_number_to_name = no
	}

This is my addition of a "Secret Base". I've included additional information about the variables below.

	
	ca_sbase = {
		desc = ca_sbase_desc
		potential = {
			OR = {
				FROM = {
					OR = {
						tier = KING
						tier = EMPEROR
						ai = no
					}
					capital_holding = {
						title = FROMFROM
					}
				}
				FROMFROM = {
					has_building = ca_secret_passages
				}
			}
		}
		trigger = { TECH_CONSTRUCTION = 0 }
		prerequisites = { ca_secret_passages }
		#how much gold it costs to build
		build_cost = 1000
		#how much time it takes to build in days
		build_time = 10
		#no idea what these do
		ai_creation_factor = 50
		extra_tech_building_start = 100
		add_number_to_name = no
		#liege_prestige and liege_piety affects your character score
		liege_prestige = 12
		liege_piety = 12
		#techpoints affect your overall technology level, 8 is maximum
		culture_techpoints = 8
		economy_techpoints = 8
		military_techpoints = 8
		#this affects your spread in percentages, 5 = 500%
		tech_growth_modifier_military = 5
		tech_growth_modifier_economy = 5
		tech_growth_modifier_culture = 5
		#this is bonus monthly prestige/piety/wealth
		monthly_character_prestige = 100
		monthly_character_piety = 100
		monthly_character_wealth = 100
		#this is bonus gold from this building per month
		tax_income = 100
		#this is defensive value of the fort, usually applied to defensive structures, 25 is overkill
		fort_level = 25.0
		#this is size of levy and garrison multiplier in percentages, where 1 = 100% 
		#i disabled these two variables because I was getting massive doomstacks of 10 million troops which breaks the game due to upkeep
		#levy_size = 1
		#garrison_size = 1
		#land morale affects your armies on this province when defending
		land_morale = 20
		#levy reinforcement rate in percentages, where 25 = 2500%
		levy_reinforce_rate = 25
		#these are bonuses of infantry, knights are heavy cavalry and galleys (boats)
		heavy_infantry = 400
		light_infantry = 400
		archers = 300
		pikemen = 300
		light_cavalry = 500
		knights = 250
		galleys = 500
	}
}
					

Going nuts with stupidly large numbers break the game. Initially I gave myself too much money and the game broke. Wealth went into negative figures, which immediately caused all my vassals, middle-class and peasants to riot. The same lesson goes for armies!

The screenshot below shows my overkill levy size and garrison size. These two variables increase the size of the standing armies on your demense as well as your overall kingdom. Lets just say a doomstack of 1.6 million soliders was a bad idea.


Crusader Kings 2
Crusader Kings 2

The battles were glorious!


Crusader Kings 2

This was levy_size and garrison_size set at "1" (100%). 33k was still overkill because this was just the Personal Castle, not including the rest of the demense or kingdom.


Crusader Kings 2

I eventually disabled the levy_size and garrison_size variable altogether! I opted to add additional units directly.

Note: If you use a variable that doesn't exist it will come up in the game as "NONE: numbers". I had garrison_size and levy_size, so I thought retinue_size might affect the cap on retinue (a personal army for the liege) but it didn't work. I know the building "Training Yard" increases the maximum cap for retinue, so I'll have to figure this out later.

back to
GAMES