Jump to content

Help request from a total modding noob


Recommended Posts

Well, I want to make a simple religion mod, based mostly in what i usually reform, but in total honesty I have no idea how to start coding and i have not found any tutorial to mod (or at least while i looked, but people pretty much always say that i'm blind).

 

So,

There's any tutorial to start modding (in general) or religion? How do you make a place a holy site for your religion?

 

Thanks for looking at this thread, and many thanks if you could help me :D

 

PS: English is not my native languaje, so sorry if there's any ortographic horror

Link to comment

There is not a lot of written help for modding yet. The starting point would be the CK3 wiki which has a modding section providing you with the basics.

Start out with making a simple event and expand from there. Any time you get stuck try and find an example in the vanilla files. Use the Notepad  and if you don't understand what part of the code does, use the search function to find in which other vanilla folders it is present and what it does. I learnt my very modest modding skills with CK2 in this manner. It takes time and a lot of trial and error. I also found that in general the contributors to forums like this are always willing to help if you get stuck.

 

Link to comment

I've been working on my own religion mod, and I'm new myself. The best tools I've found besides the wiki is the Carnalitas Discord and just looking at other mods on this site to see what needs to be modded for different effects. Carnalitas Dei, Harem King, and the Adroit religion mods specifically, plus the vanilla game folders. Just remember to save backup files or copy files you want to edit into your mod folder and edit there - never save over a vanilla game file. 

Link to comment

I think that it is easier to mod existing aspects of a game, like religions, if you look at what the game does with that system normally. That way your mod is more of an edit of what was already there, rather than trying to make a whole new thing.

 

Religion are found within of file of their faith (e.g. 00_christianity for Christian religions). This sets their holy sites, tenets and various doctrines. You can make a new faith as well for your religion if you want but that can be more complicated. You will need to edit 00_holy_sites if your chosen site is not already used by a religion. You can even add custom tenets by modifying 00_core_tents if you want.

 

It is easier to mod in a religion if you base it off another one already present as it serves as a good outline of what a important factors you need to add and then you can just edit what you need to. You can use the mod Carnalities Dei as additional guidance for custom religions as this adds a new faith.

 

If you have any questions then I would be happy to help with what I can.

Link to comment

As SoCal says above, one of the best ways to learn modding is to look at other mods and how they piece together stuff. I didn't really understand how religion modding worked until I took a look at other mods from the Steam Workshop and on Loverslab ad starting messing with them and getting results in-game.

 

As far as Holy Sites go, if I recall you define them in "yourmod/common/religion/holy_sites". I just copied over the file "00_holy_sites" from the vanilla files, renamed the file to something different so it didn't overwrite anything, and deleted all but one of the entries. Afterwards I named everything inside said entry to whatever I needed or wanted.

 

As an example for holy sites:

socotra = {  #name used to refer to this holy site in code, as seen in the religion's file, near the bottom
    county = c_socotra #Name of the title of the county, found under "history/titles/k_nameofkingdom.txt"

    character_modifier = { #Applies any buff or debuff to the character
        name = holy_site_socotra_effect_name #optional localization, defined in localization files at "localization/english/" (not sure if inside the Religion folder or Modifiers folder, not properly localized this myself)
        diplomacy = 1
        martial = 1
  }

Link to comment
2 hours ago, VynalDerp said:

As SoCal says above, one of the best ways to learn modding is to look at other mods and how they piece together stuff. I didn't really understand how religion modding worked until I took a look at other mods from the Steam Workshop and on Loverslab ad starting messing with them and getting results in-game.

 

As far as Holy Sites go, if I recall you define them in "yourmod/common/religion/holy_sites". I just copied over the file "00_holy_sites" from the vanilla files, renamed the file to something different so it didn't overwrite anything, and deleted all but one of the entries. Afterwards I named everything inside said entry to whatever I needed or wanted.

 

As an example for holy sites:

socotra = {  #name used to refer to this holy site in code, as seen in the religion's file, near the bottom
    county = c_socotra #Name of the title of the county, found under "history/titles/k_nameofkingdom.txt"

    character_modifier = { #Applies any buff or debuff to the character
        name = holy_site_socotra_effect_name #optional localization, defined in localization files at "localization/english/" (not sure if inside the Religion folder or Modifiers folder, not properly localized this myself)
        diplomacy = 1
        martial = 1
  }

This.

 

Recently had an issue with my religion's localization that I couldn't figure out: it wasn't displaying the name of the religion anywhere or it's description, just the tenets and doctrines. The only way I found the cause of the problem was to copy a known good religion under the heading of my religion in the 00_christianity.txt file, which fixed the issue, then changing it line by line back to the settings I wanted and making sure it worked after each  line until it didn't. Turns out the game didn't like me trying to set c_bagrewand (site of the real Mt. Ararat) as a holy site so I had to change it to a different one. 

Link to comment
2 hours ago, SoCalExile said:

This.

 

Recently had an issue with my religion's localization that I couldn't figure out: it wasn't displaying the name of the religion anywhere or it's description, just the tenets and doctrines. The only way I found the cause of the problem was to copy a known good religion under the heading of my religion in the 00_christianity.txt file, which fixed the issue, then changing it line by line back to the settings I wanted and making sure it worked after each  line until it didn't. Turns out the game didn't like me trying to set c_bagrewand (site of the real Mt. Ararat) as a holy site so I had to change it to a different one. 

Do you know the reason why you typically try and copy over? The reason is cuz of encoding, most of the game's files use UTF-8-BOM encoding, which you can change in Notepad++ if you use it (located with the other top dropdown menus). Not sure about other programs, but without the encoding even code written correctly often won't work in-game. Can sometimes be the fix of issues without needing to rewrite everything after copying over.

Link to comment
4 hours ago, VynalDerp said:

Do you know the reason why you typically try and copy over? The reason is cuz of encoding, most of the game's files use UTF-8-BOM encoding, which you can change in Notepad++ if you use it (located with the other top dropdown menus). Not sure about other programs, but without the encoding even code written correctly often won't work in-game. Can sometimes be the fix of issues without needing to rewrite everything after copying over.

 

The encoding on my localization issue was good. Everything was displaying fine except what was coming from the 00_christianity.txt file. I just had to narrow down what line was causing the issue. 

Or maybe adding an entry for c_bagrewand to the localization file might've solved it also?

Link to comment

From the game launcher, go to Mod Tools> Create New Mod
That will create the .mod files and the main mod folder you want.
So now there should be a directory in your documents folder, so something like \Documents\Paradox Interactive\Crusader Kings III\mod\<your mod>

Inside that folder, create a directory <your mod>\common\religion\religions
Look for where you have CK3 installed. Should be "Steam\SteamApps\common\Crusader Kings III\game"

Make sure the structure (\common\religion\religions) exactly matches what is in your CK3 folder.

Copy the file from there matching the religion you want to edit (For example: 00_hellenism.txt) and paste it into your mod directory.

Open that file and find where it says "faiths = {"

Copy any faith after that. Down to the bracket that closes the one that opens after the name of the faith.

So: if you are following along with the Hellenic example, you should have copied (and pasted), so that you now have two of:

		hellenic_pagan = {
			color = { 0.6 0.1 0.1 }
			icon = hellenic
			reformed_icon = hellenic_reformed

			holy_site = rome
			holy_site = athens
			holy_site = sparta
			holy_site = alexandria
			holy_site = carthage

			doctrine = unreformed_faith_doctrine

			doctrine = tenet_astrology
			doctrine = tenet_communal_identity
			doctrine = tenet_esotericism
		}

 

In the new copy of the faith, give it a new name and change it to whatever doctrines and laws you want. So, for an example, edit the second to something like:

 

		bacchism = { # new
			color = { 0.6 0.3 0.3 }
			icon = hellenic
			reformed_icon = hellenic_reformed

			holy_site = baalbek
			holy_site = rome
			holy_site = korinthos
			holy_site = thebes
			holy_site = ionia

			#Main Group
			doctrine = doctrine_gender_equal
			doctrine = doctrine_theocracy_lay_clergy

			#Marriage
			doctrine = doctrine_consanguinity_unrestricted

			#Crimes
			doctrine = doctrine_adultery_men_accepted
			doctrine = doctrine_adultery_women_accepted
			doctrine = doctrine_kinslaying_shunned
			doctrine = doctrine_deviancy_accepted

			#Clerical Functions
			doctrine = doctrine_clerical_gender_female_only

			doctrine = unreformed_faith_doctrine

			doctrine = tenet_carnal_exaltation
			doctrine = tenet_ritual_hospitality
			doctrine = tenet_hedonistic
		}

 

That was the important part! If you go into the game now, and load your mod, you should be able to see your religion! But we can make it better.

 

The Holy Sites aren't working yet. 

So, go back and create a folder for <your mod>\common\religion\holy_sites

Make sure it matches the structure that is in your CK3 directory still!

In your lovely new holy_sites folder, create a new text file. It doesn't actually matter what you name it.... but let's go with bacchic_holy_sites.txt just to make it clear what it is.

In that .txt file, add the names, locations, and details of the holy sites you want. For example: 

ionia = {
	county = c_ionia
	
	character_modifier = {
		name = holy_site_ionia_effect_name
		fertility = 0.1
		health = 0.1
	}
}

korinthos = {
	county = c_korinthos
	barony = b_corinth
	
	character_modifier = {
		name = holy_site_korinthos_effect_name
		monthly_tyranny = -0.1
		tyranny_gain_mult = -0.2
	}
}

thebes = {
	county = c_attica
	barony = b_thebeshellas

	character_modifier = {
		name = holy_site_thebes_effect_name
		clergy_opinion = 5
		personal_scheme_power_mult = 0.1
	}
}

 

The names you put (ie: "ionia") have to match exactly in both your files.

If you don't put a barony (like I did with Ionia), the holy site will always be in the capital of the county.

If you don't know the names used in code for baronies and counties, look in "Steam\SteamApps\common\Crusader Kings III\game\localization\english\titles_l_english.yml" That is the file that gives the "in game" name that matches each "in code" name.
Now your holy sites will work.

 

But we can make this have the right text in game.

Make a folder for <your mod>\localization\english\religion

And in there, make a file for your religion's name and description.

It will be a text file with the extension .yml

Or just copy any .YML file from CK3 into the directory and rename it and delete the text inside if you aren't sure how best to create your own.

 

In that file put: 

l_english:

 bacchism:0 "Bacchic mysteries"
 bacchism_adj:0 "Bacchic"
 bacchism_adherent:0 "Bacchant"
 bacchism_adherent_plural:0 "Bacchants"
 bacchism_desc:0 "Bacchic mysteries celebrate the god Bacchus and combine elements of the older Greek Dionysian mysteries with those of the Roman Aventine Triad."

 bacchism_old:0 "Old Bacchism"
 bacchism_old_adj:0 "Old Bacchic"
 bacchism_old_adherent:0 "Old Bacchant"
 bacchism_old_adherent_plural:0 "Old Bacchants"

 holy_site_ionia_name:0 "Ionia"
 holy_site_ionia_effect_name:0 "From [holy_site|E] #weak ($holy_site_ionia_name$)#!"
 holy_site_korinthos_name:0 "Corinth"
 holy_site_korinthos_effect_name:0 "From [holy_site|E] #weak ($holy_site_korinthos_name$)#!"
 holy_site_thebes_name:0 "Thebes"
 holy_site_thebes_effect_name:0 "From [holy_site|E] #weak ($holy_site_thebes_name$)#!"

 

*VERY IMPORTANT* save this as UTF-8 with BOM. You don't need to know what that means, but your text editor probably has a option to "save with encoding" or has an option for encoding under "save as" or something like that.

CK3 will probably not recognize the file unless it is UTF-8 with BOM. And your text editor probably doesn't default to saving in that style.

 

So, that Localization is how your text will appear in game.

Of course, you can put it in a language other that English, if you want. Replace the <english> in the folder name with the name of the language you want, and replace 'english in the "l_english:" at the start of the file with your language.

 

So, anyways: consider that a quick intro to adding faiths and holy sites!

And hopefully you can figure out how to translate all of that to make your own faiths.

Edited by coffees
Link to comment
  • 3 weeks later...
On 5/31/2021 at 5:45 PM, coffees said:

From the game launcher, go to Mod Tools> Create New Mod
That will create the .mod files and the main mod folder you want.
So now there should be a directory in your documents folder, so something like \Documents\Paradox Interactive\Crusader Kings III\mod\<your mod>

Inside that folder, create a directory <your mod>\common\religion\religions
Look for where you have CK3 installed. Should be "Steam\SteamApps\common\Crusader Kings III\game"

Make sure the structure (\common\religion\religions) exactly matches what is in your CK3 folder.

Copy the file from there matching the religion you want to edit (For example: 00_hellenism.txt) and paste it into your mod directory.

Open that file and find where it says "faiths = {"

Copy any faith after that. Down to the bracket that closes the one that opens after the name of the faith.

So: if you are following along with the Hellenic example, you should have copied (and pasted), so that you now have two of:


		hellenic_pagan = {
			color = { 0.6 0.1 0.1 }
			icon = hellenic
			reformed_icon = hellenic_reformed

			holy_site = rome
			holy_site = athens
			holy_site = sparta
			holy_site = alexandria
			holy_site = carthage

			doctrine = unreformed_faith_doctrine

			doctrine = tenet_astrology
			doctrine = tenet_communal_identity
			doctrine = tenet_esotericism
		}

 

In the new copy of the faith, give it a new name and change it to whatever doctrines and laws you want. So, for an example, edit the second to something like:

 


		bacchism = { # new
			color = { 0.6 0.3 0.3 }
			icon = hellenic
			reformed_icon = hellenic_reformed

			holy_site = baalbek
			holy_site = rome
			holy_site = korinthos
			holy_site = thebes
			holy_site = ionia

			#Main Group
			doctrine = doctrine_gender_equal
			doctrine = doctrine_theocracy_lay_clergy

			#Marriage
			doctrine = doctrine_consanguinity_unrestricted

			#Crimes
			doctrine = doctrine_adultery_men_accepted
			doctrine = doctrine_adultery_women_accepted
			doctrine = doctrine_kinslaying_shunned
			doctrine = doctrine_deviancy_accepted

			#Clerical Functions
			doctrine = doctrine_clerical_gender_female_only

			doctrine = unreformed_faith_doctrine

			doctrine = tenet_carnal_exaltation
			doctrine = tenet_ritual_hospitality
			doctrine = tenet_hedonistic
		}

 

That was the important part! If you go into the game now, and load your mod, you should be able to see your religion! But we can make it better.

 

The Holy Sites aren't working yet. 

So, go back and create a folder for <your mod>\common\religion\holy_sites

Make sure it matches the structure that is in your CK3 directory still!

In your lovely new holy_sites folder, create a new text file. It doesn't actually matter what you name it.... but let's go with bacchic_holy_sites.txt just to make it clear what it is.

In that .txt file, add the names, locations, and details of the holy sites you want. For example: 


ionia = {
	county = c_ionia
	
	character_modifier = {
		name = holy_site_ionia_effect_name
		fertility = 0.1
		health = 0.1
	}
}

korinthos = {
	county = c_korinthos
	barony = b_corinth
	
	character_modifier = {
		name = holy_site_korinthos_effect_name
		monthly_tyranny = -0.1
		tyranny_gain_mult = -0.2
	}
}

thebes = {
	county = c_attica
	barony = b_thebeshellas

	character_modifier = {
		name = holy_site_thebes_effect_name
		clergy_opinion = 5
		personal_scheme_power_mult = 0.1
	}
}

 

The names you put (ie: "ionia") have to match exactly in both your files.

If you don't put a barony (like I did with Ionia), the holy site will always be in the capital of the county.

If you don't know the names used in code for baronies and counties, look in "Steam\SteamApps\common\Crusader Kings III\game\localization\english\titles_l_english.yml" That is the file that gives the "in game" name that matches each "in code" name.
Now your holy sites will work.

 

But we can make this have the right text in game.

Make a folder for <your mod>\localization\english\religion

And in there, make a file for your religion's name and description.

It will be a text file with the extension .yml

Or just copy any .YML file from CK3 into the directory and rename it and delete the text inside if you aren't sure how best to create your own.

 

In that file put: 


l_english:

 bacchism:0 "Bacchic mysteries"
 bacchism_adj:0 "Bacchic"
 bacchism_adherent:0 "Bacchant"
 bacchism_adherent_plural:0 "Bacchants"
 bacchism_desc:0 "Bacchic mysteries celebrate the god Bacchus and combine elements of the older Greek Dionysian mysteries with those of the Roman Aventine Triad."

 bacchism_old:0 "Old Bacchism"
 bacchism_old_adj:0 "Old Bacchic"
 bacchism_old_adherent:0 "Old Bacchant"
 bacchism_old_adherent_plural:0 "Old Bacchants"

 holy_site_ionia_name:0 "Ionia"
 holy_site_ionia_effect_name:0 "From [holy_site|E] #weak ($holy_site_ionia_name$)#!"
 holy_site_korinthos_name:0 "Corinth"
 holy_site_korinthos_effect_name:0 "From [holy_site|E] #weak ($holy_site_korinthos_name$)#!"
 holy_site_thebes_name:0 "Thebes"
 holy_site_thebes_effect_name:0 "From [holy_site|E] #weak ($holy_site_thebes_name$)#!"

 

*VERY IMPORTANT* save this as UTF-8 with BOM. You don't need to know what that means, but your text editor probably has a option to "save with encoding" or has an option for encoding under "save as" or something like that.

CK3 will probably not recognize the file unless it is UTF-8 with BOM. And your text editor probably doesn't default to saving in that style.

 

So, that Localization is how your text will appear in game.

Of course, you can put it in a language other that English, if you want. Replace the <english> in the folder name with the name of the language you want, and replace 'english in the "l_english:" at the start of the file with your language.

 

So, anyways: consider that a quick intro to adding faiths and holy sites!

And hopefully you can figure out how to translate all of that to make your own faiths.

thank you very much for the answer, it served a lot!!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use