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

Mcgan

Lt. General
18 Badges
Mar 19, 2020
1.239
1.826
  • Crusader Kings III: Royal Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Stellaris: Nemesis
  • Stellaris: Humanoids Species Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Lithoids
  • Stellaris: Necroids
So I've created new Norse faith using Rite tenet, but for some reason this faith spawned with new religious head anyway, why?
It's a bug:
 
  • 2
Reactions:

void0x00

Captain
19 Badges
Sep 10, 2020
352
590
  • Stellaris: Apocalypse
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Empire of Sin
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Magicka
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
Does the faith creation screen give any feedback on whether or not the Head of Faith will be preserved? I know, for example, if you choose a Spiritual Head of Faith for your religion, it will tell you whether or not one will be created when the faith is created (this requires a holy site, I believe). Seems like it should, if it doesn't.
the message did not consider Rite, if it said will not be created, then the HoF is kept.
if controls enough holy site, it says it will be created and it actually will do it.
 

void0x00

Captain
19 Badges
Sep 10, 2020
352
590
  • Stellaris: Apocalypse
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Empire of Sin
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Magicka
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
It's a bug:
when i test in debug mode, that seems only make that line always true, not affecting the result, it will different if debug is off?
 

Mcgan

Lt. General
18 Badges
Mar 19, 2020
1.239
1.826
  • Crusader Kings III: Royal Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Stellaris: Nemesis
  • Stellaris: Humanoids Species Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Lithoids
  • Stellaris: Necroids
when i test in debug mode, that seems only make that line always true, not affecting the result, it will different if debug is off?
Um... sorry, I have absolutely no idea what you are trying to say.
All I know is that it works when I try it.
 

void0x00

Captain
19 Badges
Sep 10, 2020
352
590
  • Stellaris: Apocalypse
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Empire of Sin
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Magicka
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
Um... sorry, I have absolutely no idea what you are trying to say.
All I know is that it works when I try it.
I tested in debug mode, Rite works if and only if I have less than 2 holy site,
I dont need to fix that NOT = { faith = scope: old_faith.religious_head.faith } as it is just become always true and not affecting the result,
so i wonder if it is because I am in debug mode.
 
Last edited:
  • 1
Reactions:

Mcgan

Lt. General
18 Badges
Mar 19, 2020
1.239
1.826
  • Crusader Kings III: Royal Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Stellaris: Nemesis
  • Stellaris: Humanoids Species Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Lithoids
  • Stellaris: Necroids
I tested in debug mode, Rite works if I have less than 2 holy site,
that NOT = { faith = scope: old_faith.religious_head.faith } just always true and not affecting the result,
so i wonder if it is because I am in debug mode.
I didn't check in debug. I'm checking for facts, I would never trust debug alone. And the fact is, with the original code/script, I always got an error when creating a new faith with the Rite tenet. With my fix, I get the old HoF with the new faith.

For example, here I had exactly 3* holy sites when I reformed Bori:
1654790538068.png

Did you check your error log?
 

void0x00

Captain
19 Badges
Sep 10, 2020
352
590
  • Stellaris: Apocalypse
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Empire of Sin
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Magicka
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
I didn't check in debug. I'm checking for facts, I would never trust debug alone. And the fact is, with the original code/script, I always got an error when creating a new faith with the Rite tenet. With my fix, I get the old HoF with the new faith.

For example, here I had exactly 3* holy sites when I reformed Bori:

Did you check your error log?
i saw the error, but it just continue after the error, and keep the old HoF, maybe debug mode ignores error.
and then if i remove that line, it still give me a new HoF is I had 2 holy site,
so maybe it is due to debug mode , I will test in normal tomorrow
 
Last edited:

Mcgan

Lt. General
18 Badges
Mar 19, 2020
1.239
1.826
  • Crusader Kings III: Royal Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Stellaris: Nemesis
  • Stellaris: Humanoids Species Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Lithoids
  • Stellaris: Necroids
i saw the error, but it just continue after the error, and keep the old HoF
so maybe it is debug mode ignores error
Ah, well I don't know about that. I don't use debug mode often enough. And when I do use it, it's to test my fixes rather than to test the bugs in the base game.

But that could make sense: forcing events to execute entirely while in debug mode to be able to see all the errors rather than just the first one.

Also:
btw, seems there is something not allow Blot to share HoF, as I dont think NOR of 2 same condition make sense.
Code:
            ## Cannibals vs. non-cannibals of any kind.
            custom_description = {
                text = incompatible_tenet_shared_hof_cannibals_vs_non_cannibals
                NOR = {
                    # Cannibal-you doesn't get why your non-cannibal HoF freaks out when you offer them a hand...
                    AND = {
                        flag:tenet_ritual_cannibalism = { is_in_list = selected_doctrines }
                        NOT = {
                            religious_head.faith = { has_doctrine = tenet_ritual_cannibalism }
                        }
                    }
                    # ... or cannibal-HoF thinks you need to chill the hell out whilst they eat this dude.
                    AND = {
                        flag:tenet_ritual_cannibalism = { is_in_list = selected_doctrines }
                        NOT = {
                            religious_head.faith = { has_doctrine = tenet_ritual_cannibalism }
                        }
                    }
                }
            }
            # Some tenet/doctrine configurations are unilaterally exclusive.
            ## HumSac/GruFes are disliked by anyone who doesn't also actively believe in such.
            custom_description = {
                text = incompatible_tenet_shared_hof_world_vs_humsac_grufes
                # Your HoF will not put up with your HumSackery if they don't also go in for it.
                trigger_if = {
                    limit = {
                        OR = {
                            flag:tenet_gruesome_festivals = { is_in_list = selected_doctrines }
                            flag:tenet_human_sacrifice = { is_in_list = selected_doctrines }
                        }
                    }
                    NOR = {
                        religious_head.faith = { has_doctrine = tenet_gruesome_festivals }
                        religious_head.faith = { has_doctrine = tenet_human_sacrifice }
                    }
                }
            }
EDIT:
diff from what the comment said,
seems it only blocks when new and old faith both have blot, but the new faith can have blot and share the HoF who does not.
and for cannibalism, add cannibalism blocks rite, but remove cannibalism wont
Someone made a bug report about those issues:
 

void0x00

Captain
19 Badges
Sep 10, 2020
352
590
  • Stellaris: Apocalypse
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Empire of Sin
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Magicka
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
this time I limited the usage of debug mode by,
1. in normal mode, start as whiteshirt, conquest 2 holy site and reform asatru with HoF
2. save and restart in debug mode
3. kill him and give enough piety to next gen
4. save ans restart in normal mode
5. create new faith with Rite <--- has error, new HoF created
6. load save, grant indenpendience, create new faith with Rite <-- has error, keep old HoF
7. exit and turn on a mod to apply your fix
8. create new faith with Rite <--- no error in that line , new HoF created
9. load save, grant indenpendience, create new faith with Rite <-- no error in that line, keep old HoF

unless using debug mode will corrupt the save, I think the result should be the same, I will continue from the first save anyway, but I dont think it matter
ps. there is another error in line23, I delete that line and try for 3rd time, still the same

do you have other thing supend the auto HoF creation during new faith create?
there is faith_creation.0002 at the end of on_faith_created, in which it calls set_up_dynamic_spiritual_hof_title_effect -> set_up_dynamic_spiritual_hof_title_effect

and...I found unrestricted marriage has the same problem too....blocks Rite if both old faith and new faith has it.....
 
Last edited:
  • 1
Reactions:

Mcgan

Lt. General
18 Badges
Mar 19, 2020
1.239
1.826
  • Crusader Kings III: Royal Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Stellaris: Nemesis
  • Stellaris: Humanoids Species Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Lithoids
  • Stellaris: Necroids
this time I limited the usage of debug mode by,
1. in normal mode, start as whiteshirt, conquest 2 holy site and reform asatru with HoF
2. save and restart in debug mode
3. kill him and give enough piety to next gen
4. save ans restart in normal mode
5. create new faith with Rite <--- has error, new HoF created
6. load save, grant indenpendience, create new faith with Rite <-- has error, keep old HoF
7. exit and turn on a mod to apply your fix
8. create new faith with Rite <--- no error in that line , new HoF created
9. load save, grant indenpendience, create new faith with Rite <-- no error in that line, keep old HoF
Ok, so I tried that too but without using debug at any point, and for whatever reason, I get the same result.
I don't really understand why it worked fine with Bori but doesn't with Asatru... maybe I had less than 2 holy sites under my control the 2nd time I created a faith and never realized.

ps. there is another error in line23
Yeah I saw that too, I don't know how to fix it properly though.

do you have other thing supend the auto HoF creation during new faith create?
No, I don't.
there is faith_creation.0002 at the end of on_faith_created, in which it calls set_up_dynamic_spiritual_hof_title_effect -> set_up_dynamic_spiritual_hof_title_effect
You're right, the triggers for that event don't exclude new faith with Rite.
I'll have to test, but maybe just adding a trigger to make sure the event can't fire if there's already a HoF would be enough.

Edit: Another thing that's wrong with Rite is that it never filters gender doctrines. So if the old HoF is male, but the new faith is female dominated... actually, I'm not sure what happens then. then you keep the male HoF anyway.

Edit2: Ok so I tested it a bit, and it seems adjusting faith_creation.0002 was enough to fix it. I kept it simple:
Code:
faith_creation.0002 = {
    hidden = yes

    trigger = {
        faith = {
            has_doctrine = doctrine_spiritual_head
            can_create_spiritual_head_of_faith_title_trigger = yes
            NOT = { exists = religious_head }
        }

Did the same with faith_creation.0001 too.
 
Last edited:
  • 1
Reactions:

YellowPress

Banned
1 Badges
Apr 26, 2022
1.685
2.782
  • Victoria 3 Sign Up
I didn't check in debug. I'm checking for facts, I would never trust debug alone. And the fact is, with the original code/script, I always got an error when creating a new faith with the Rite tenet. With my fix, I get the old HoF with the new faith.

For example, here I had exactly 3* holy sites when I reformed Bori:

Did you check your error log?
How did you get 4 tenents? I thought you could only get 3?
this time I limited the usage of debug mode by,
1. in normal mode, start as whiteshirt, conquest 2 holy site and reform asatru with HoF
2. save and restart in debug mode
3. kill him and give enough piety to next gen
4. save ans restart in normal mode
5. create new faith with Rite <--- has error, new HoF created
6. load save, grant indenpendience, create new faith with Rite <-- has error, keep old HoF
7. exit and turn on a mod to apply your fix
8. create new faith with Rite <--- no error in that line , new HoF created
9. load save, grant indenpendience, create new faith with Rite <-- no error in that line, keep old HoF

unless using debug mode will corrupt the save, I think the result should be the same, I will continue from the first save anyway, but I dont think it matter
ps. there is another error in line23, I delete that line and try for 3rd time, still the same

do you have other thing supend the auto HoF creation during new faith create?
there is faith_creation.0002 at the end of on_faith_created, in which it calls set_up_dynamic_spiritual_hof_title_effect -> set_up_dynamic_spiritual_hof_title_effect

and...I found unrestricted marriage has the same problem too....blocks Rite if both old faith and new faith has it.....
So in summary no holy sites should mean shared head of faith? I guess that can make sense in that you're not contesting but just making slight differences
 

void0x00

Captain
19 Badges
Sep 10, 2020
352
590
  • Stellaris: Apocalypse
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Empire of Sin
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Magicka
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
How did you get 4 tenents? I thought you could only get 3?

So in summary no holy sites should mean shared head of faith? I guess that can make sense in that you're not contesting but just making slight differences
I will say it is a bug as it is after Rite do its job to preserve the HoF, then a new HoF is auto created and replace him.
so the trick is prevent the auto creation by not meeting the requirement of create HoF: own 2 holy site and have devotion level Faithful.

I haven't check the required devotion level of reform/create faith, as it usually wont be low after gaining so much piety for it.
but if it has no requirement on devotion level, there maybe another workaround by drop the devotion by criminal
(are there anyway to drop it efficiently? I tried hard to become Sinner for Era Zaharrak but failed, wait someone to discover my criminal is too slow that I gain a level in between, make me can't test it)
 
Last edited:

YellowPress

Banned
1 Badges
Apr 26, 2022
1.685
2.782
  • Victoria 3 Sign Up
I will say it is a bug as it is after Rite do its job to preserve the HoF, then a new HoF is auto created and replace him.
so the trick is prevent the auto creation by not meeting the requirement of create HoF: own 2 holy site and have devotion level Faithful.

I haven't check the required devotion level of reform/create faith, as it usually wont be low after gaining so much piety for it.
but if it has no requirement on devotion level, there maybe another workaround by drop the devotion by criminal
(are there anyway to drop it efficiently? I tried hard to become Sinner for Era Zaharrak but failed, wait someone to discover my criminal is too slow that I gain a level in between, make me can't test it)
Everytime you announce you have a bastard you lose a faith tier I think
 
  • 1Like
Reactions:

Mcgan

Lt. General
18 Badges
Mar 19, 2020
1.239
1.826
  • Crusader Kings III: Royal Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Stellaris: Nemesis
  • Stellaris: Humanoids Species Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Lithoids
  • Stellaris: Necroids
How did you get 4 tenents? I thought you could only get 3?
Whoever posted the screenshot of having four tenets, that seems like an obvious bug.
I was testing potential fixes, in other words using a mod. There is no "4 tenets" bug, don't worry. 3 Tenets just feels ridiculously low to me.
 
  • 3
Reactions:

void0x00

Captain
19 Badges
Sep 10, 2020
352
590
  • Stellaris: Apocalypse
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Empire of Sin
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Magicka
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
Everytime you announce you have a bastard you lose a faith tier I think
announce bastard expose adultery, then I imprison and execute him for kidslayer and lost another.
reform/create faith do not have devotion level requirement, so being dutiful works.

furthermore, since the check is after the faith formed, so if the holy site is granted to someone who will not convert with you, HoF wont be created,
but the message of creating HoF in the create faith window do not check the devotion level and this either.
 
  • 2
Reactions:

Amjeerih

Recruit
Jul 29, 2022
3
2
*snip*

Edit2: Ok so I tested it a bit, and it seems adjusting faith_creation.0002 was enough to fix it. I kept it simple:
Code:
faith_creation.0002 = {
    hidden = yes

    trigger = {
        faith = {
            has_doctrine = doctrine_spiritual_head
            can_create_spiritual_head_of_faith_title_trigger = yes
            NOT = { exists = religious_head }
        }

Did the same with faith_creation.0001 too.

Thank you for this. I was having the same problem.

IMO, a better fix is to change the line:

Code:
NOT = { exists = religious_head }

to

Code:
NOT = { has_doctrine = tenet_rite }

...so that is checking make sure the new faith does not have the Rite doctrine rather than whether it has an existing head.

This makes the full trigger block:

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

    }

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. I don't know if the devs read this but maybe it will help them make a quick fix, too.
 

Mcgan

Lt. General
18 Badges
Mar 19, 2020
1.239
1.826
  • Crusader Kings III: Royal Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Stellaris: Nemesis
  • Stellaris: Humanoids Species Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Lithoids
  • Stellaris: Necroids
...so that is checking make sure the new faith does not have the Rite doctrine rather than whether it has an existing head.
Ok, I imagine that would work too, but I don't understand: how is that better, exactly?

Let's take a simple example: mods. In a game like this, mods should be considered as much as possible (seriously, I would never have bought CK3 if it didn't have mods). If someone makes a mod that adds a new tenet, which also uses the "maintains_head_of_faith_on_creation" parameter, they will face the same bug.
With your solution, they would still need to mod faith_creation.0002 to include their new tenet.

This could also be a problem with creating a new HoF title for faiths with Rite ( create_head_of_faith_title_effect ) if it ever came to it, but I can't take think of any event leading to that situation, so I'm not too worried about it.

But what am I missing? What makes it better?
 
  • 1Like
Reactions:

Amjeerih

Recruit
Jul 29, 2022
3
2
Ok, I imagine that would work too, but I don't understand: how is that better, exactly?

Let's take a simple example: mods. In a game like this, mods should be considered as much as possible (seriously, I would never have bought CK3 if it didn't have mods). If someone makes a mod that adds a new tenet, which also uses the "maintains_head_of_faith_on_creation" parameter, they will face the same bug.
With your solution, they would still need to mod faith_creation.0002 to include their new tenet.

This could also be a problem with creating a new HoF title for faiths with Rite ( create_head_of_faith_title_effect ) if it ever came to it, but I can't take think of any event leading to that situation, so I'm not too worried about it.

But what am I missing? What makes it better?

I see what you mean, and I hadn't considered that. Thanks for the feedback. I can tell you have more experience with CK's code than I do.

In this case, I recommend changing the relevant line to:

Code:
NOT = { has_doctrine_parameter = maintains_head_of_faith_on_creation }

I tested it and this also works.

As for why this is better, I admit that it is a bit subjective. Checking whether the spiritual head happens to exist seems a little hacky to me, since that is not actually the semantic condition we are trying to represent. I would like the check to be more transparent, with the code straightforwardly representing the result of choosing the Rite tenet.

Thoughts?
 
Last edited:
  • 1Like
Reactions:

Mcgan

Lt. General
18 Badges
Mar 19, 2020
1.239
1.826
  • Crusader Kings III: Royal Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Stellaris: Nemesis
  • Stellaris: Humanoids Species Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Lithoids
  • Stellaris: Necroids
I can tell you have more experience with CK's code than I do.
I don't know about that, I just got this whole thing in particular wrong before so I'm more careful about it now.

In this case, I recommend changing the relevant line to:

Code:
NOT = { has_doctrine_parameter = maintains_head_of_faith_on_creation }
I tested it and this also works.
Yeah, I think this is better than your previous solution.

As for why this is better, I admit that it is a bit subjective. Checking whether the spiritual head happens to exist seems a little hacky to me, since that is not actually the semantic condition we are trying to represent. I would like the check to be more transparent, with the code straightforwardly representing the result of choosing the Rite tenet.

Thoughts?
Ah, I see what you mean. Well, then there must be a lot you would consider hacky in this game. But usually, for the hacky parts, there would be comments next to them to explain their purpose.

To be honest, I'm not too concerned about hacky, just about "does it work all the time".
faith_creation.0001 and faith_creation.0002 are each called only twice in the entire game, and each time, it is to setup a HoF. So it felt ridiculous to me that it never checks whether the faith already has one.

Well, maybe it's not that surprising, considering that before they added shared HoF, there would never be a situation where the faith already had a HoF at the time those events are called.

So, with all of that in mind, this is how I would write it in the end:
Code:
# Fired when you make a faith. Spiritual rel head setup
faith_creation.0002 = {
    hidden = yes

    trigger = {
        faith = {
            has_doctrine = doctrine_spiritual_head
            NOT = { exists = religious_head }    # 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 }
    }
}
I saw you cared about efficiency in your previous post, but I still think has_doctrine = doctrine_spiritual_head needs to be the first line no matter what, as this will filter out temporal and no HoF faiths.

I would do pretty much the same for faith_creation.0001, but I've been worried that it might not be enough in some situations because of the special way HoF sharing happens for Islamic temporal faiths. I still need to look more into it.

Alternatively, you could also use:
Code:
            NAND = {
                has_doctrine_parameter = maintains_head_of_faith_on_creation
                exists = religious_head
            }
to make sure you can still create a new HoF if you somehow ended up with a faith with Rite but no HoF. Just an idea, I don't know if that's actually better in the end.