• 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(133356)

Colonel
2 Badges
Jan 28, 2009
1.072
3
  • Crusader Kings II
  • Victoria 2: A House Divided
I've noticed that several cultures get added types of buildings to provide various benefits, unit types, etc.

For example, parts of western Europe get a building type that produces more heavy cav, as opposed to the handful you get from the standard Stables. Or the building that produces horse archers for some of the steppes cultures.

Using the above as an example, and using Poland as an example since it doesn't appear to have access to any, how would I add a building type that would only be available to provices with Polish culture, and would provide a small number of knights, or horse archers, or whatever?


I can see, looking at the file buildings.txt, where those buildings are, and some of how they work. I'm going to be trying to make it work in the meantime, but any help would be appreciated. I'm also looking at the stickied thread on how to set up a mod.

Thanks.
 

Geredis

Major
122 Badges
Mar 10, 2007
663
325
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Steel Division: Normandy 44
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings Complete
  • Europa Universalis IV: Third Rome
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Steel Division: Normand 44 - Second Wave
You can adjust whatever numbers you want from here, but the following should work - it'd activate for anyone with Polish culture in the same way. The requirements to build this is that your ruler is Polish, and (I believe; though could be wrong) the AI will build this only if Polish and Christian. If anyone more knowledgeable catches something wrong here in my characterisation of what the building does, or in the building I wrote up here (built upon the Squire List building for the German, Frankish, and Occitan cultures), let me know.

As to where you copy/paste this...just tag it on at the end of the Castle section, between the Russian section and the start of the Citys (# City) in buildings.txt

Code:
ca_culture_polish_1 = {
		potential = {
			FROM = {
				OR = {
					culture = polish
				}
			}
		}
		prerequisites = { ca_wall_2 }
		build_cost = 200
		build_time = 730
		knights = 15
		light_cavalry = 10
		horse_archers = 15
		ai_creation_factor = 101
		
		start = {
			AND = {
				FROM = { religion_group = christian }
				year = 1125
				has_building = ca_stable_1
			}
		}
	}
	ca_culture_polish_2 = {
		potential = {
			FROM = {
				OR = {
					culture = polish
				}
			}
		}
		trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
		upgrades_from = ca_culture_polish_1
		build_cost = 300
		build_time = 1095
		knights = 20
		light_cavalry = 15
		horse_archers = 20
		ai_creation_factor = 100
		
		start = {
			AND = {
				FROM = { religion_group = christian }
				year = 1140
				has_building = ca_stable_1
			}
		}
	}
	ca_culture_polish_3 = {
		potential = {
			FROM = {
				OR = {
					culture = frankish
					culture = occitan
					culture = norman
					culture = german
				}
			}
		}
		trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
		upgrades_from = ca_culture_polish_2
		build_cost = 400
		build_time = 2190
		knights = 25
		light_cavalry = 25
		horse_archers = 25
		
		start = {
			AND = {
				FROM = { religion_group = christian }
				year = 1180
				has_building = ca_stable_1
			}
		}
	}
	ca_culture_polish_4 = {
		potential = {
			FROM = {
				OR = {
					culture = frankish
					culture = occitan
					culture = norman
					culture = german
				}
			}
		}
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_culture_frank_norman_german_3
		build_cost = 500
		build_time = 2190
		knights = 30
		light_cavalry = 30
		horse_archers = 30
		ai_creation_factor = 98
		
		start = {
			AND = {
				FROM = { religion_group = christian }
				year = 1250
				has_building = ca_stable_1
			}
		}
	}
 

unmerged(133356)

Colonel
2 Badges
Jan 28, 2009
1.072
3
  • Crusader Kings II
  • Victoria 2: A House Divided
Should those culture lines that list off all the Frankish, German, etc, be replaced by one line for Polish in each upgrade?
 

Geredis

Major
122 Badges
Mar 10, 2007
663
325
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Steel Division: Normandy 44
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings Complete
  • Europa Universalis IV: Third Rome
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Steel Division: Normand 44 - Second Wave
Yeah; sorry I missed those in the list - I didn't mean to leave them in.
 

unmerged(133356)

Colonel
2 Badges
Jan 28, 2009
1.072
3
  • Crusader Kings II
  • Victoria 2: A House Divided
It works, now I just need to figure out how to make it show a name in the game... it shows up as "ca_culture_polish_1" on the build list.
 

Geredis

Major
122 Badges
Mar 10, 2007
663
325
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Steel Division: Normandy 44
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings Complete
  • Europa Universalis IV: Third Rome
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Steel Division: Normand 44 - Second Wave
Need to add a localization. It's not that hard really and quite self explanatory if you look in the localisation files.
 

unmerged(133356)

Colonel
2 Badges
Jan 28, 2009
1.072
3
  • Crusader Kings II
  • Victoria 2: A House Divided
Thanks.

I've done a lot with savegame editing on Paradox games, but not much on modding until CKII.


EDIT: found the lines in #3, and it worked without a hitch.
 
Last edited:

unmerged(133356)

Colonel
2 Badges
Jan 28, 2009
1.072
3
  • Crusader Kings II
  • Victoria 2: A House Divided
Someday I'll figure out how to make this into a mod so that I don't have to keep swapping out files if I want to play MP with someone...
 

Meneth

Crusader Kings 3 Programmer
153 Badges
Feb 9, 2011
10.056
5.378
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Hearts of Iron IV: Expansion Pass
  • Steel Division: Normand 44 Sign-up
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Way of Life
  • Mount & Blade: With Fire and Sword
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: El Dorado
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Surviving Mars: Digital Deluxe Edition
  • BATTLETECH: Flashpoint
  • Crusader Kings II: Conclave
  • Surviving Mars
  • Cities: Skylines Industries
  • Stellaris: Galaxy Edition
  • BATTLETECH
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Stellaris: Humanoids Species Pack
  • Prison Architect
  • Crusader Kings II: The Old Gods
  • Cities: Skylines - Campus
  • Hearts of Iron IV: No Step Back
  • BATTLETECH - Digital Deluxe Edition
  • Crusader Kings Complete
  • Cities: Skylines - Parklife
  • Europa Universalis IV
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Cradle of Civilization
  • 500k Club
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis III Complete
  • Cities: Skylines - Mass Transit
  • Europa Universalis III Complete
  • Cities: Skylines - Green Cities
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Rule Britannia
Someday I'll figure out how to make this into a mod so that I don't have to keep swapping out files if I want to play MP with someone...
Make a folder in the mod folder.
Make a file of the same name, ending with .mod.
In that file, put this:
Code:
name = "Name" # name of your mod, shown in launcher
path = "mod/name" # location of your mod files 
user_dir = "Name" # optional. creates a sub directory where settings/map cache/savegames etc can be safely written for your mod and not get mixed up
Only bother with the last one if the mod is save-game incompatible.

Now put all files you've modded in the mod-folder you made, and preserve the original structure (E.G., anything you've modded in "common" goes in a "common" folder in your mod-folder). You'll now be able to enable the mod through the launcher.
 

unmerged(133356)

Colonel
2 Badges
Jan 28, 2009
1.072
3
  • Crusader Kings II
  • Victoria 2: A House Divided
Going to try doing this, since the last patch evidently overwrote my changes, despite the buildings.txt file not being on the list of altered files for the patch.


EDIT: it worked. :cool:

Next question -- does a modded file that only adds lines need to have the entire contents of the basic file, or will CKII combine the contents when it loads, allowing only the additional lines to be in the file for the mod?
 
Last edited:

unmerged(133356)

Colonel
2 Badges
Jan 28, 2009
1.072
3
  • Crusader Kings II
  • Victoria 2: A House Divided
Bump -- see question above. Thanks.