• 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.
I'm just adding pagan reformation to my mod. I've added duke-tier reformed religious head titles that exactly follow the pattern in vanilla. But when I start a game playing as an unreformed pagan, the reformed religious head already exists, and is shown as my religious head. (I checked; the title is defined in the files as both having and controlling the reformed religion. The playable character has the unreformed religion, and the auto-generated head has the reformed version.)

Is there a startup event or something that deactivates religious heads who don't exist when the game begins? I haven't found anything yet.

nd
 
I'm just adding pagan reformation to my mod. I've added duke-tier reformed religious head titles that exactly follow the pattern in vanilla. But when I start a game playing as an unreformed pagan, the reformed religious head already exists, and is shown as my religious head. (I checked; the title is defined in the files as both having and controlling the reformed religion. The playable character has the unreformed religion, and the auto-generated head has the reformed version.)

Is there a startup event or something that deactivates religious heads who don't exist when the game begins? I haven't found anything yet.

nd

You'll have to write a history file and include "active=no" on some date before 769. Vanilla does it on 20.1.1. See the vanilla history files for reference, such as d_norse_pagan_reformed.txt
 
Is it possible to set up a chain of decisions/events for rulers controlling great works that are inactive because of incorrect religion (e.g. controlling a cathedral when you're Muslim) to repurpose the building for their own faith?
 
Is it possible to set up a chain of decisions/events for rulers controlling great works that are inactive because of incorrect religion (e.g. controlling a cathedral when you're Muslim) to repurpose the building for their own faith?

It should be reasonably straightforward; look up how vanilla handles Hagia Sophia.
 
Here's a somewhat messy government problem I'd like some help with:

I have three different government types that essentially have the same potential blocks, with the relevant difference being whether a law is set to A, B, or C, with A being the default. The desirable behaviour is that you only get the government type that matches your law. However, some weird things sometimes happen.

- If I start as a character who has the law for their primary title set as B or C in the title history file, the relevant government type is applied. This works as expected.

- If I change the law, a convoluted workaround using set_government_type is necessary to get any government type that isn't A (at least if my primary title is a viceroyalty), even if I change the law to B or C. This is an annoyance I can live with.

- If I lose a random county (tested with the console), the government type doesn't change. This works as expected.

- If my liege changes, I get to keep my government type. This works as expected.

- If I lose my primary title while still alive, the government type and law change to A, at least if my new primary has a lower tier. This is something of a problem.

- If I'm granted a viceroyalty that's a higher tier than my current title, I get the law and the government type the viceroyalty had when held by the last holder that isn't my liege (the liege in question doesn't use the relevant laws or governments, so it shouldn't depend on his laws). This is undesirable.

- If I die as a viceroy, my government type and law change to whatever it was before I got the viceroyalty (A if I started from a save or fresh campaign with the law set on the viceroyalty). This is a bit of a problem.

- If I inherit a title, I get to keep my government type. This works as expected.

- If I create or conquer a title as a viceroy, the government type (but not the law) changes to A. This is a rather big problem.

- If I save the game with the law set to B or C and reload, I get government B or C in accordance with the law, even if the government changed to A (as in the above scenario) before the save. This isn't a problem, but it is rather weird.

- If I'm granted a viceroyalty (at least when not having one), my government becomes whatever the government of the viceroyalty was before it was inherited by my liege.

My questions:

- Any idea how I can avoid having the government type change if I create or conquer a title as a viceroy?

- Any idea how I can avoid having the government type and law change if I lose my last primary tier title?


Edit: I did not manage to get it to work with laws, but I figured out a way to make it work using traits, with some maintenance events to ensure that the trait is correctly inherited and that gaining/losing a title doesn't cause issues (at least not as far as I've been able to determine, using roughly the same tests as before).
 
Last edited:
I'm looking for general advice on best practices for decisions when it comes to limiting performance drops.

What are the biggest performance impacts? When is it advisable to set the ai_check_interval to a high value (60 or 120)?

Intuitively, it would seem that complex potential clauses where many conditions are true for many characters could be detrimental enough to warrant a high ai_check_interval. But too high ai_check_interval can severely hinder the AI - especially if the allow clause contains easily failed conditions (such as war = no).

I'm also under the impression that the effect clause is only calculated when the decision is taken (not including generating tooltips for players) so I assume that it doesn't hurt general performance too much.

Are any of these assumptions accurate?
 
I'm looking for general advice on best practices for decisions when it comes to limiting performance drops.
A big one is make sure your potential sections are structured so that the easiest failure conditions are first so it doesnt bother evaluating tons of stuff before hitting a failure.

I believe pre triggers are supported in descions now similar to events which are even better.

When is it advisable to set the ai_check_interval to a high value (60 or 120)?
No idea to be honest.

I'm also under the impression that the effect clause is only calculated when the decision is taken (not including generating tooltips for players) so I assume that it doesn't hurt general performance too much.
Yep
 
I created a new government in the feudal governments with a unique title_prefix which is correctly applied to all tiers and shows up ingame except for baronies, they are using vanilla title_prefix apparently. Is title_prefix in modded governments not applied to baronies? Preferred holding type for my modded government is city. Does that have something to do with it?
 
Why can't I edit Chinese commander traits to be visible in ruler designer? I have this code written in 02_traits.txt but it doesn't work.

Code:
master_of_flame = { # Way of the Dragon
   leader = yes
   customizer = yes
 
   potential = {
       OR = {
           culture = han
           has_character_flag = taught_chinese_strategy
           has_character_flag = originated_from_chinese_court
       }
   }
 
   command_modifier = {
       damage = 0.2
       morale_offence = 0.2
   }
 
   ruler_designer_cost = 0
}
 
is there a quick way to hunt for compatibility issues between mods? I don't get crashes, just unexpected behavior.
 
is there a quick way to hunt for compatibility issues between mods? I don't get crashes, just unexpected behavior.

It is hard to answer in the general case, since the issue could vary quite a bit for any particular combination of mods that don't cause a crash. I'd probably start by checking any files with the same name that exist in both mods (e.g. if both have modified 00_cb_types.txt, compare them) and checking any changes/additions to on_actions (and, even if the vanilla on_action files themselves haven't been touched, checking the events fired from there might be a good idea, as the could fire follow-up events that cause issues).
 
Thanks a lot!
A big one is make sure your potential sections are structured so that the easiest failure conditions are first so it doesnt bother evaluating tons of stuff before hitting a failure.

I believe pre triggers are supported in descions now similar to events which are even better.
Are certain conditions more costly to check than others? In vanilla decisions, there are multiple potential sections that start with conditions encompassing multiple characters (such as religion_group = christian) while upcoming conditions are likely to narrow it down more effectively.

Example: Mend the Schism:

Code:
        potential = {
            has_dlc = "Legacy of Rome"
            is_playable = yes
            is_adult = yes
            prisoner = no
            independent = yes
            NOT = { trait = incapable }
            OR = {
                religion = orthodox
                religion = paulician
                religion = monothelite
                religion = iconoclast
            }
            OR = {
                has_landed_title = e_byzantium
                has_landed_title = e_roman_empire
            }
            is_heretic = no
            NOT = { has_global_flag = schism_mended }
            k_papal_state = {
                holder_scope = {
                    is_heretic = no # If the Pope (and thus Catholicism) is heretical, mending the schism is no longer possible
                }
            }
            NOT = {
                has_alternate_start_parameter = { key = religion_names value = random }
            }
        }

Are has_dlc, is_playable, and the rest less expensive than the much more explicit has_landed_title? Or would this decision be more efficient with has_landed_title moved to the very top, and potentially moving has_global_flag and is_playable to the pre-trigger section?
 
Are certain conditions more costly to check than others? In vanilla decisions, there are multiple potential sections that start with conditions encompassing multiple characters (such as religion_group = christian) while upcoming conditions are likely to narrow it down more effectively.
Frankly I don't think performance was really thought of when writing most decisions in the base game. They also haven't been revisited with newer features like pre triggers as you noticed.

potentially moving has_global_flag and is_playable to the pre-trigger section?
has_global_flag is not valid pre trigger