• 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.

theferd

Recruit
11 Badges
Jun 9, 2022
2
10
  • Crusader Kings III
Short summary of your issue
Rite creating new HoF instead of using old one

Game Version
1.6

What OS are you playing on?
Windows

What platform are you using?
Steam

What DLC do you have installed?
Royal Court,

Do you have mods enabled?
No

Have you tried verifying your game files (Steam only)?
Yes

How much "pain" is this causing you?
10

Please explain the issue you experienced in the most condensed way possible
Upon creating a new heresy while using the Rite tenet, a new head of faith title is created instead of retaining the original if the creator holds two or more holy sites. This is likely due to how the game creates a head of faith immediately upon faith creation if the appropriate number of holy sites are held but then rite cannot overwrite the new hof generated.

Please explain how to reproduce the issue
Be catholic and hold any two catholic holy sites. Create a heresy with rite. A new pope is generated instead of using the existing catholic pope.

Is there anything else you think could help us identify/replicate the issue?
This issue occurs with any heresy and the minimum amount of holy sites to create a head of faith on the creation of the heresy. If only one holy site is held or no holy sites are held, rite acts as intended.

I have attached a save game
No

Upload Attachment
File(s) attached
 

Attachments

  • test1.png
    test1.png
    1,5 MB · Views: 0
  • test2.png
    test2.png
    579,4 KB · Views: 0
  • test3.png
    test3.png
    785,9 KB · Views: 0
  • testwo1.png
    testwo1.png
    900,5 KB · Views: 0
  • testwo2.png
    testwo2.png
    754,8 KB · Views: 0
  • 2Like
  • 1
Reactions:
@theferd

I've seen this issue mentioned elsewhere - it appears to stem from confusion around using the Rite tenet (which I really feel ought to be a doctrine rather than a tenet, as it's pretty useless).

It looks like your problem is you're creating a heresy with the Rite tenet, as opposed to creating one starting with the Rite tenet.

Try picking a faith that has Rite as a starting tenet (Mozarabic or Insular) and creating a new heresy - it should work.

I can understand the confusion, and the description for the tenet should be updated. I also think it should be restricted to faiths that already start with it (or their spin-off faiths made using it), like the Mystical Ancestors cultural tradition.
 
  • 3
Reactions:
@theferd

I've seen this issue mentioned elsewhere - it appears to stem from confusion around using the Rite tenet (which I really feel ought to be a doctrine rather than a tenet, as it's pretty useless).

It looks like your problem is you're creating a heresy with the Rite tenet, as opposed to creating one starting with the Rite tenet.

Try picking a faith that has Rite as a starting tenet (Mozarabic or Insular) and creating a new heresy - it should work.

I can understand the confusion, and the description for the tenet should be updated. I also think it should be restricted to faiths that already start with it (or their spin-off faiths made using it), like the Mystical Ancestors cultural tradition.

I tried to do it from Insular and mozarabic. New faith still receives hostile treatment. And I did not change any tenet or doctrine.
 
@theferd

I've seen this issue mentioned elsewhere - it appears to stem from confusion around using the Rite tenet (which I really feel ought to be a doctrine rather than a tenet, as it's pretty useless).

It looks like your problem is you're creating a heresy with the Rite tenet, as opposed to creating one starting with the Rite tenet.

Try picking a faith that has Rite as a starting tenet (Mozarabic or Insular) and creating a new heresy - it should work.

I can understand the confusion, and the description for the tenet should be updated. I also think it should be restricted to faiths that already start with it (or their spin-off faiths made using it), like the Mystical Ancestors cultural tradition.
incorrect.

here are more examples using catholic and insular. It 100% has to do something with holding holy sites.

testiwith.png
testiwith2.png


testcathwithout1.png
testcathwithout2.png



Additionally here is an example with a reformed pagan religion and a its heresy
Base reformed Bidiasm
bidaic.PNG


Heresy formed without any holy sites
testbidiacwithout.PNG
testbidiacwithout2.PNG


Heresy formed with only 1 holy site

test bidaic only 1.PNG
testbidiaconly2.PNG


Heresy created with 2 holy sites.

testbidiacwith.PNG
testbidiacwith2.PNG
 
  • 4Like
  • 3
Reactions:
Simply preventing the creation of a new spiritual head of faith if one exists seems to do the trick. I don't recall any cases where you'd create a new spiritual head of faith when one already exists so this is a potentially usable solution.

Modify this file: Crusader Kings III\game\common\scripted_triggers\00_religious_triggers.txt

Replace this
Code:
can_create_spiritual_head_of_faith_title_trigger = {
    num_realm_holy_sites_faithful_holders = {
        COUNT = holy_sites_to_create_spiritual_head_of_faith
        CHARACTER = ROOT
    }
    root = { piety_level >= medium_piety_level }
}

With this
Code:
can_create_spiritual_head_of_faith_title_trigger = {
    NOT =  { exists = religious_head }
    num_realm_holy_sites_faithful_holders = {
        COUNT = holy_sites_to_create_spiritual_head_of_faith
        CHARACTER = ROOT
    }
    root = { piety_level >= medium_piety_level }
}
 
  • 3
  • 1
Reactions:
A better fix, in my opinion, is to change the faith_creation.002 setup as suggested by McGan in the thread "Need help figuring out rite tenet." I tried to post a link but its getting flagged as spam, I think.

I suggested an improvement to his code. Change faith_creation.002 in "game\events\religious_events\faith_creation_events.txt":

Code:
# Fired when you make a faith. Spiritual rel head setup
faith_creation.0002 = {
    hidden = yes

    trigger = {
        faith = {
            NOT = { has_doctrine = tenet_rite }
            has_doctrine = doctrine_spiritual_head
            can_create_spiritual_head_of_faith_title_trigger = yes
        }

    }

    immediate = {
        set_up_dynamic_spiritual_hof_title_effect = { CREATOR = root }
    }
}

This inserts a check in the trigger for the Rite doctrine. I tested creating a new religion from Insularism both with and without the Rite doctrine, and now it works as expected. Having two holy sites no longer matters, nor does your level of devotion.
 
  • 1
Reactions:
The fix I've found to work. Also adds ecumenism where vanilla fails to:
EDIT: I had some unrelated problems with my on_faith_creation on_action which modding the event effect also fixed, but isn't relevant to the vanilla problem.
EDIT2: Fixed a scope for the trigger if you want to do it the event way.
Code:
# Fired when you make a faith. Spiritual rel head setup
faith_creation.0002 = {
    hidden = yes
  
    trigger = {
        faith = {
            has_doctrine = doctrine_spiritual_head
            #Moved so Rite Tenet faiths will get the old HoF even if they don't control holy sites
            #can_create_spiritual_head_of_faith_title_trigger = yes
        }
    }
  
    immediate = {
        if = {
            limit = {
                NAND = {
                    faith = {
                        has_doctrine = tenet_rite
                    }
                    exists = scope:old_faith.religious_head
                }
               faith = { can_create_spiritual_head_of_faith_title_trigger = yes }
            }
            set_up_dynamic_spiritual_hof_title_effect = { CREATOR = root }
        }
        if = {
            limit = {
                faith = {
                    has_doctrine = tenet_rite
                }
                exists = scope:old_faith.religious_head
            }
            faith = {
                set_religious_head_title = scope:old_faith.religious_head.primary_title
            }
            if = {
                limit = {
                    faith = {
                        religion_tag = christianity_religion
                    }
                    scope:old_faith = {
                        has_doctrine = special_doctrine_ecumenical_christian
                    }                  
                }
                faith = {
                    add_doctrine = special_doctrine_ecumenical_christian
                }
            }
        }
    }
}
 
Last edited:
  • 1
Reactions:
faith_creation.0002 is an event to create a HoF Title, it can be called outside of faith creation. Having it mess with adding / removing doctrines seems weird. And in some cases, scope:old_faith wouldn't exist and it would generate an error.

I had already posted a fix for this, but honestly, I don't remember where, and I haven't updated it anyway.
So I'm taking this opportunity to post the current fix I'm using for most Rite and faith / HoF creation related problems, which should also work with mods:
common\on_action\religion_on_actions.txt
Changes to on_faith_created
Code:
on_faith_created = {
    effect = {
        scope:old_faith = {
            if = {
                limit = { has_doctrine_parameter = unreformed }
                set_variable = { name = has_been_reformed }
            }

            root = { play_music_cue = "mx_cue_faith_conversion" }
        }
        set_variable = {
            name = has_created_a_faith
        }
        # Set original faith this one was based on
        # if = {    # Not working, set variable to faith instead
            # limit = {
                # exists = scope:old_faith.founder
                # scope:old_faith.founder = { has_variable = foundational_faith }
            # }
            # set_variable = {
                # name = foundational_faith
                # value = scope:old_faith.founder.var:foundational_faith
            # }
        # }
        # else = {
            # set_variable = {
                # name = foundational_faith
                # value = scope:old_faith
            # }
        # }
        faith = {    # Old system is used in: fp2_struggle_faith_is_mozarabic_trigger fp2_other_decisions.0700 bhakti_foundational_faith_trigger (religious_decision.0101)
            if = {    # All of them need to be updated
                limit = {
                    scope:old_faith = { has_variable = foundational_faith }
                }
                set_variable = {
                    name = foundational_faith
                    value = scope:old_faith.var:foundational_faith
                }
            }
            else = {
                set_variable = {
                    name = foundational_faith
                    value = scope:old_faith
                }
            }
        }
        check_for_equal_doctrine_effect = yes
        # Set up diff-faith HoFs.
        faith = {
            # If we have a diff-faith HoF, we want to account for that.
            ## Islamic use-case: we want same-Mohammad's Succession faiths to keep following their appropriate caliphs.
            if = {
                limit = {
                    # Are we in the correct religion?
                    religion = religion:islam_religion
                    # Faiths with no HoF or a spiritual head aren't relevant for these calculations.
                    has_doctrine = doctrine_temporal_head
                }
                # Grab a scope for tooltip loc, since they complain about root.
                root = { save_scope_as = reformer }
                # Sunni path.
                if = {
                    limit = { has_doctrine = muhammad_succession_sunni_doctrine }
                    root = { trigger_event = head_of_faith.0001 }
                }
                # Shia path.
                else_if = {
                    limit = { has_doctrine = muhammad_succession_shia_doctrine }
                    root = { trigger_event = head_of_faith.0011 }
                }
                # Muhakkima path.
                else_if = {
                    limit = { has_doctrine = muhammad_succession_muhakkima_doctrine }
                    root = { trigger_event = head_of_faith.0021 }
                }
                # Zandaqa path.
                else_if = {
                    limit = { has_doctrine = muhammad_succession_zandaqa_doctrine }
                    root = { trigger_event = head_of_faith.0031 }
                }
            }
            ## Faiths with the Rite tenet get to keep their old HoF.
            else_if = {
                limit = {
                    # Need the appropriate doctrine parameter.
                    has_doctrine_parameter = maintains_head_of_faith_on_creation
                    # Assuming they exist. What? More like assuming it's not the same faith...
                    NOT = { this = scope:old_faith.religious_head.faith }    # In what case is this necessary?
                    # scope:old_faith = { exists = religious_head }            # Should always exist by that point, if it doesn't, will show an error in log
                }
                set_religious_head_title = scope:old_faith.religious_head_title
            }
            ## Otherwise, everyone else should lose their HoF, so we don't need to do anything.
            # Christian faiths with the appropriate doctrine parameter get to keep ecumenism.
            if = {
                limit = {
                    religion = religion:christianity_religion
                    has_doctrine_parameter = ecumenical_christians_keep_ecumenism
                    scope:old_faith = { has_doctrine = special_doctrine_ecumenical_christian }
                }
                add_doctrine = special_doctrine_ecumenical_christian
            }
        }
        # Achievements.
        root = {
            add_achievement_flag_effect = { FLAG = achievement_its_not_a_cult_flag }
        }
        if = {
            limit = {
                scope:old_faith = {
                    religion_tag = west_african_religion
                    has_doctrine_parameter = unreformed
                }
            }
            add_achievement_global_variable_effect = {
                VARIABLE = achievement_mother_of_us_all_siguic
                VALUE = yes
            }
        }
        if = {
            limit = {
                scope:old_faith = {
                    religion_tag = west_african_orisha_religion
                    has_doctrine_parameter = unreformed
                }
            }
            add_achievement_global_variable_effect = {
                VARIABLE = achievement_mother_of_us_all_orisha
                VALUE = yes
            }
        }
        if = {
            limit = {
                scope:old_faith = {
                    religion_tag = west_african_bori_religion
                    has_doctrine_parameter = unreformed
                }
            }
            add_achievement_global_variable_effect = {
                VARIABLE = achievement_mother_of_us_all_bori
                VALUE = yes
            }
        }
        if = {
            limit = {
                scope:old_faith = {
                    religion_tag = west_african_roog_religion
                    has_doctrine_parameter = unreformed
                }
            }
            add_achievement_global_variable_effect = {
                VARIABLE = achievement_mother_of_us_all_roog_sene
                VALUE = yes
            }
        }
        if = {
            limit = {
                scope:old_faith = {
                    religion_tag = akom_religion
                    has_doctrine_parameter = unreformed
                }
            }
            add_achievement_global_variable_effect = {
                VARIABLE = achievement_mother_of_us_all_akom
                VALUE = yes
            }
        }
        if = {
            limit = {
                scope:old_faith = {
                    religion_tag = kushitism_religion
                    has_doctrine_parameter = unreformed
                }
            }
            add_achievement_global_variable_effect = {
                VARIABLE = achievement_mother_of_us_all_kushitism
                VALUE = yes
            }
        }
        if = {
            limit = {
                scope:old_faith = {
                    religion_tag = waaqism_religion
                    has_doctrine_parameter = unreformed
                }
            }
            add_achievement_global_variable_effect = {
                VARIABLE = achievement_mother_of_us_all_waaqism
                VALUE = yes
            }
        }
    }

    events = {
        faith_conversion.0001 # Convert capital county
        faith_conversion.0003 # Convert close family
        faith_creation.0001 # Temporal rel head setup
        faith_creation.0002 # Spiritual rel head setup
        faith_creation.0003 # Faith flags
        faith_creation.1000 # Notification event
    }
}

events\religion_events\faith_creation_events.txt
Changes to faith_creation.0001, faith_creation.0002, faith_creation.0011 and faith_creation.0012

Code:
# Fired when you make a faith (Well yes, but actually, not only). Temporal rel head setup
faith_creation.0001 = {
    hidden = yes

    trigger = {
        faith = {
            has_doctrine = doctrine_temporal_head
            NOT = { exists = religious_head_title }
            can_create_temporal_head_of_faith_title_trigger = yes
        }
    }

    immediate = {
        set_up_dynamic_temporal_hof_title_effect = { NEW_HOLDER = root }
    }
}

# Fired when you make a faith (Well yes, but actually, not only). Spiritual rel head setup
faith_creation.0002 = {
    hidden = yes

    trigger = {
        faith = {
            has_doctrine = doctrine_spiritual_head
            NOT = { exists = religious_head_title }    # If the faith has Rite, it will already have a HoF at this point
            can_create_spiritual_head_of_faith_title_trigger = yes
        }

    }

    immediate = {
        set_up_dynamic_spiritual_hof_title_effect = { CREATOR = root }
    }
}

Code:
# Temporal Head of Faith re-creation event
faith_creation.0011 = {
    hidden = yes

    trigger = {
        faith = {
            has_doctrine = doctrine_temporal_head
            can_create_temporal_head_of_faith_title_trigger = yes

            # Title must exist but not be held by anyone.
            exists = religious_head_title
            NOT = { exists = religious_head_title.holder }
        }
    }

    immediate = {
        faith = {
            religious_head_title = {
                save_scope_as = my_hof_title
            }
        }

        create_title_and_vassal_change = {
            # type = created    # no title is created
            type = granted        # but one is granted
            save_scope_as = change
            add_claim_on_loss = no
        }
        scope:my_hof_title = {
            change_title_holder = {
                holder = root
                change = scope:change
            }
        }
        resolve_title_and_vassal_change = scope:change
    }
}

# Spiritual Head of Faith re-creation event
faith_creation.0012 = {
    hidden = yes

    trigger = {
        faith = {
            has_doctrine = doctrine_spiritual_head
            can_create_spiritual_head_of_faith_title_trigger = yes

            # Title must exist but not be held by anyone.
            exists = religious_head_title
            NOT = { exists = religious_head_title.holder }
        }
    }

    immediate = {
        faith = {
            religious_head_title = {
                save_scope_as = my_hof_title
            }
        }

        create_title_and_vassal_change = {
            # type = created    # no title is created
            type = granted        # but one is granted
            save_scope_as = change
            add_claim_on_loss = no
        }

        if = {
            limit = {
                any_theocratic_vassal = {
                    faith = root.faith
                }
            }
            ordered_theocratic_vassal = {
                limit = {
                    faith = root.faith
                }
                order_by = head_of_faith_selection_weight
                save_scope_as = new_religious_head
            }
        }
        else = {
            create_character = {
                location = root.capital_province
                age = { 30 50 }
                gender_female_chance = root_faith_clergy_gender_female_chance
                trait = education_learning_4
                faith = root.faith
                culture = root.culture
                learning = { 14 22 }
                save_scope_as = new_religious_head
            }
        }

        scope:my_hof_title = {
            change_title_holder = {
                holder = scope:new_religious_head
                change = scope:change
            }
        }
        resolve_title_and_vassal_change = scope:change
    }
}

For newly created temporal faiths
localization\english\event_localization\religion_events\faith_creation_events_l_english.yml
Code:
 faith_creation.1001.desc.temporal:0 "\n\n[reformed_hof.GetFirstNameNoTooltip] was chosen to personally lead this burgeoning [reformed_faith.GetAdjectiveNoTooltip] movement and has assumed the title of [reformed_faith.ReligiousHeadName|U], an exalted position that [reformed_hof.GetSheHe] is expected to pass down to [reformed_hof.GetHerHis] heir."
This fixes:
- Rite creating new HoF instead of using old one / Reforming a non-Catholic Christian faith that has Rite before and after does not keep the Pope as Head of Faith
- Creating the Mozarabic Head of Faith title consumes gold but doesn't create the title / Cant create a mozarabic head of faith (works for all faiths now)
- Text after new Muslim faith creation wrongly stating that the player's ruler is a new Caliph
- Eventual bugs for mods re-using existing doctrine parameters used by Rite
- Other minor things that didn't have an effect on gameplay, but fed the error log.

So far I haven't had any problem with this, but there are 3 2 things to note:

- I barely tested the fix for temporal faiths (seemed fine but can't say for sure)
- I still don't know how to fix the damn "Set original faith this one was based on" part
- I didn't include the fix I saw before somewhere for mods that allow creating a HoF title without holding any holy site

Edit: Figured out how to fix "Set original faith this one was based on", but it requires a few other changes to make it useful. Might post later.
 
Last edited:
  • 1
Reactions:
I had a separate problem with the on_action that I didn't realise, hence why the on_action fixes weren't working for me.

But I wouldn't be timid in using triggers within effects that are called from in multiple instances. You can make effects walk and chew gum at the same time, do two or more things at once, by using if/limit to distinguish the different origin instance the effect is used in. It can be handy because vanilla often calls the same effect from multiple different instances, and being able to distingush each instance within the effect itself and apply different effects depending on the instance it's called from saves you from having to mod each origin instance, meaning you only have to overwrite one effect, and can increase compatibility.

Because the scope:old_faith only exists in on_faith_creation instance, the event effects in that if-block will only apply when called from the on_faith_creation instance, and not when called on in other instances. It means you could mod what on_faith_creation does without having to mod on_faith_creation.

I don't think it would cause a entry in the error log if the scope didn't exist, and if it did, then that's the intent; that its non-existance determine that effect-block not be applied. The error log is there as a guide.
 
  • 1Like
Reactions:
But I wouldn't be timid in using triggers within effects that are called from in multiple instances. You can make effects walk and chew gum at the same time, do two or more things at once, by using if/limit to distinguish the different origin instance the effect is used in. It can be handy because vanilla often calls the same effect from multiple different instances, and being able to distingush each instance within the effect itself and apply different effects depending on the instance it's called from saves you from having to mod each origin instance, meaning you only have to overwrite one effect, and can increase compatibility.
Oh I agree, it just doesn't seem appropriate in this case. It's an event to setup a HoF, not to alter a faith. I prefer things to be clear and simple, and I feel this would invite more confusion than anything, even though this specific event is only called twice in the entire game right now.
That's my main issue with it honestly, otherwise it's pretty solid.

I also feel like some parts of on_faith_created need to be adjusted and should be "fixed" officially. But I see what you mean now, as a mod, your solution is better for compatibility. Can't argue against that.
You should probably use has_doctrine_parameter = maintains_head_of_faith_on_creation and has_doctrine_parameter = ecumenical_christians_keep_ecumenism instead of has_doctrine = tenet_rite for mods that might use them though.

Because the scope:old_faith only exists in on_faith_creation instance, the event effects in that if-block will only apply when called from the on_faith_creation instance, and not when called on in other instances. It means you could mod what on_faith_creation does without having to mod on_faith_creation.
Yeah. That's what I mean by "pretty solid".

I don't think it would cause a entry in the error log if the scope didn't exist, and if it did, then that's the intent; that its non-existance determine that effect-block not be applied. The error log is there as a guide.
True, I'm not sure either. But if it does, I'd rather they do not add a fix that generates errors in a vanilla situation.
I am pretty sure however, that just adding exists = scope:old_faith before exists = scope:old_faith.religious_head wouldn't generate an error.
But again, that's just my worries for an official fix, not for a mod to be used now.

Unrelated but I hate how there's an additional entry every time an event happens right now. Visible events anyway.
 
Last edited:
  • 1
Reactions:
Hai everyone!
Would anyone be able to provide a recent save from our latest patch 1.7.1 both before creating your own faith with Rite and after the creation of the new faith with the Tenet? I have tried to reproduce this on our latest build and have yet to encounter the issue described both on the original post, and the answers below it.

Kind regards,
TinyTinny
 
Hai everyone!
Would anyone be able to provide a recent save from our latest patch 1.7.1 both before creating your own faith with Rite and after the creation of the new faith with the Tenet? I have tried to reproduce this on our latest build and have yet to encounter the issue described both on the original post, and the answers below it.
I don't have a save for it right now, but the specific conditions for the bug to happen since 1.7 should be:
- Control at least one Holy Site (holder of the county must have the same faith as the reformer)
- Have a Piety Level of at least 2 (Faithful)

Edit: Attaching before and after saves.
 

Attachments

  • Rite_Create_New_HoF_AFTER.ck3
    3,7 MB · Views: 0
  • Rite_Create_New_HoF_BEFORE.ck3
    3,7 MB · Views: 0
Last edited:
  • 1
  • 1
Reactions:
Hai everyone!
Would anyone be able to provide a recent save from our latest patch 1.7.1 both before creating your own faith with Rite and after the creation of the new faith with the Tenet? I have tried to reproduce this on our latest build and have yet to encounter the issue described both on the original post, and the answers below it.

Kind regards,
TinyTinny

Jarl Maria of Palestine. Mozarabic faith.
Prior to faith creation and days afterwards.
No mods.
And it created new HoF.
Nothing changed from Mozarabism.
Only changed icon, name and description.

And now as Nestorian
Jarl Sigurdr of Palestine
No mods
And it created new HoF
Switched out monk tenet to rite.

Also, old faiths thinks the new faiths are hostile
 

Attachments

  • Jarl_Maria_of_Palestine_867_02_03_priorcreate.ck3
    3,9 MB · Views: 0
  • Jarl_Maria_of_Palestine_867_02_10_afterfaithcreate.ck3
    3,9 MB · Views: 0
  • Jarl_Sigurdr_of_Palestine_867_01_01_prior.ck3
    3,5 MB · Views: 0
  • Jarl_Sigurdr_of_Palestine_867_01_11_after.ck3
    3,7 MB · Views: 0
  • 2
  • 1
Reactions: