• 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 have tried that now and made a DNA file, but it seems you can't spawn characters like that, no matter what I put into the dna line, even the stock guys, it doesn't work.

I've been having similar issues, still not completely sure why the game is so finicky when it comes to generating new characters, but I've had a bit more success by putting the dna key in quotations:
Perl:
###### = {
    name = "my_name"
    dna = "my_dna_key"
    ...etc

So far I haven't been able to generate more than the character and it's spouse successfully though, adding additional family (parents, etc) is still screwing everything up.
 
Does anyone see what I'm doing wrong? For context I'm trying to recreate the CB from CK2 that allowed you to depose a ruler of the wrong gender. And the issue is that the below script isn't working at all.

Code:
        # If the beneficiary list isn't empty, sort it, usurp all defender's titles and hand them to the beneficiary.
        if = {
            limit = {
                random_in_list = {
                    list = dragatus_PCB_sexist_beneficiary_list
                    exists = this
                }
                ordered_in_list = {
                    list = dragatus_PCB_sexist_beneficiary_list
                    order_by = {
                        value = {
                            add = 1
                            # if official heir is on the list, favor them above all else
                            if = {
                                limit = {
                                    is_heir_of = scope:defender
                                }
                                add = 1000
                            }
                            # several other bonuses go here
                        }
                    }
                    save_scope_as = PCB_sexist_beneficiary_scope
                }
                scope:defender = {
                    every_held_title = {
                        change_title_holder = {
                                holder = scope:PCB_sexist_beneficiary_scope
                                change = scope:change
                        }
                    }            
                }
            }
        }

I tried moving the title change part into the ordered_in_list but that had no effect. I do know for a fact that the random_in_list is detecting that the list isn't empty though because if the list was empty the attacker usurps all titles and that's not happening when I test. I'm confident the various "if limit add" parts are fine because all the {} are closed and if they failed I should still get a random character selected.

My best guess is that there's some problem with saving and then using the scope, but I can't figure out what it would be.
 
Does anyone see what I'm doing wrong? For context I'm trying to recreate the CB from CK2 that allowed you to depose a ruler of the wrong gender. And the issue is that the below script isn't working at all.

All this is in the limit, so nothing is ever executed.
 
  • 1
Reactions:
All this is in the limit, so nothing is ever executed.

Thank you for pointing it out. I feel like such an idiot now. :D

zZgaoSL.jpg
 
Code:
children_bestowed_by_gods_decision = {
    picture = "gfx/interface/illustrations/decisions/decision_personal_religious.dds"

    is_shown = {
        is_female = yes
    }

    is_valid = {
        age >= 60
        prestige_level >= 5
        piety_level >= 5
        NOT = { has_trait = pregnant}
    }

    effect = {
        custom_tooltip = children_bestowed_by_gods_decision_effect_tooltip
        scope:actor = {
            make_pregnant = {
                father = scope:recipient
            }
        }
    }
    ai_check_interval = 0
}
This is my code, of course, It's not work.
As my plan, I want to add a decision for those warmonger。
Due to war, sometimes they may forget to arrange a spouse to their mc. The decision can help them.
The child, as the decision' s name, is a gift when your ruler pray to the god, but the god can't reply everyone, the one want to reply must has enough glory and piety, so the god will pleased their chosen champion, and more people will fight for the god.
But I fail……maybe the effect code has some unknown problems, I try to find it, and correct it for many times……
The most suspicious place is "make_pregnant", I think.
Now I want to do is correct it, and add a judge code for "has spouse or not".
As a new modder, I want help.
 
Last edited:
I think you should be able to use potential = { } blocks to enable/disable a trait entirely based on game rules. So you can make two separate giant traits, one "good" and one "bad", and use game rules to make it so only one of them can appear. Of course you'd have to modify all events/etc for giants so they check for either trait.
I'll look into that -- it might or might not work for what I've got in mind, but it's better than nothing. Thanks for the suggestion!
 
Code:
children_bestowed_by_gods_decision = {
    picture = "gfx/interface/illustrations/decisions/decision_personal_religious.dds"

    is_shown = {
        is_female = yes
    }

    is_valid = {
        age >= 60
        prestige_level >= 5
        piety_level >= 5
        NOT = { has_trait = pregnant}
    }

    effect = {
        custom_tooltip = children_bestowed_by_gods_decision_effect_tooltip
        scope:actor = {
            make_pregnant = {
                father = scope:recipient
            }
        }
    }
    ai_check_interval = 0
}
This is my code, of course, It's not work.
As my plan, I want to add a decision for those warmonger。
Due to war, sometimes they may forget to arrange a spouse to their mc. The decision can help them.
The child, as the decision' s name, is a gift when your ruler pray to the god, but the god can't reply everyone, the one want to reply must has enough glory and piety, so the god will pleased their chosen champion, and more people will fight for the god.
But I fail……maybe the effect code has some unknown problems, I try to find it, and correct it for many times……
The most suspicious place is "make_pregnant", I think.
Now I want to do is correct it, and add a judge code for "has spouse or not".
As a new modder, I want help.
What does the error log say?
 
Is it possible to create a unique building that is "type = regular" and limited to a single, specific barony? As in, say I want to add building A and B to the barony of London, but if they are both special_buildings then I can only add one per holding, so I want to make building B regular to get around it. How do I do it? From what I've tried, it seems like you can only add a unique regular building to a province if it's already present there from day 1, like the Theodosian Walls (it's a duchy_capital building but it works roughly the same). But if I try to add it so that I can build it myself in the game (like Cologne Cathedral), it simply doesn't show up on the list.
Is it true or is there a way to get around it? Maybe something like the line "special_building_slot = building_name" that you can put in history/provinces
I've noticed that duchy buildings can do that (by cancelling the line "duchy_capital_building = theodosian_walls_01" in history/provinces, it will appear unbuilt as I want it) but I haven't found a way to make it work for regular buildings too.
 
Does anyone know the code that makes a character court physician at the outset of a game. I know the code for councilors, but not for minor titles. It's not the same as the old CK2 code either which didn't seem to work.

Also is there a way to set a specific character as House/Dynasty head. I've heard the game gives it to the most powerful character, but this doesn't always seem to be the case and is currently working on a matter of seniority.

I've also noticed that cadet branches set up in the game history don't have the same highlights as those created in game so distinguishing them from the main house is a bit difficult. Does anyone know a fix for this yet? It seems like whatever creates this distinction isn't generated at world creation.

Also anyone know what files deal with raiding? I'm trying to change who can and can't raid.

Not really a mod question, but does anyone know of an in game way to set up Theocracies?
 
So I have a bit of an issue that I can't quite pin down. The error log when certain dynasty trees are open (specifically Capet/Robertine) get's spammed to oblivion with this error

Code:
[01:19:42][jomini_script_system.cpp:169]: Script system error!
  Error: Trying to use link on a null object
  Script location: file: common/customizable_localization/00_mottos.txt line: 6
[01:19:42][jomini_script_system.cpp:169]: Script system error!
  Error: house.house_head.faith trigger [ Failed context switch ]
  Script location: file: common/customizable_localization/00_mottos.txt line: 6
[01:19:42][jomini_script_system.cpp:169]: Script system error!
  Error: Trying to use link on a null object
  Script location: file: common/customizable_localization/00_mottos.txt line: 19
[01:19:42][jomini_script_system.cpp:169]: Script system error!
  Error: house.house_head.faith trigger [ Failed context switch ]
  Script location: file: common/customizable_localization/00_mottos.txt line: 19
[01:19:42][jomini_script_system.cpp:169]: Script system error!
  Error: Trying to use link on a null object
  Script location: file: common/customizable_localization/00_mottos.txt line: 28
[01:19:42][jomini_script_system.cpp:169]: Script system error!
  Error: house.house_head.faith trigger [ Failed context switch ]
  Script location: file: common/customizable_localization/00_mottos.txt line: 28
[01:19:42][jomini_script_system.cpp:169]: Script system error!
  Error: Trying to use link on a null object
  Script location: file: common/customizable_localization/00_mottos.txt line: 40
[01:19:42][jomini_script_system.cpp:169]: Script system error!
  Error: house.house_head.faith trigger [ Failed context switch ]
  Script location: file: common/customizable_localization/00_mottos.txt line: 40
[01:19:42][pdx_data_localize.cpp:60]: Data error in loc key 'motto_custom_loc_god'

Nothing about my mod has changed religions and has nothing to do with motto's so I'm at a loss as to what would cause this. Doesn't occur with vanilla though the random motto Capet gets in vanilla is different than what they end up with my mod.

I worked around it by just forcing Capet and Robertine to have a custom motto but still would be good to know if this is something I may have caused or if this is just a script error the game in the base game.
 
Last edited:
@Greaper1024

I think the problem is in your scopes. I checked several decision files and none of them used scope:actor or scope:recipient. Those two scopes are used in interactions instead. I haven't tested it, so I might be off, but I expect the scope to use in decisions would be root. Not scope:root, mind you. Just root. That one gets used a couple times. It's the scope you use when you try to target the character taking the decision.

Decisions also automatically scope to the character taking the decision too, so scoping to scope:actor wouldn't be necessary even if that was the proper scope. As for scope:recipient, that one is probably empty. What you'd want to do instead is scope to the spouse of root, which you do with root.primary_spouse.

Try changing the effect to this:
Code:
    effect = {
        custom_tooltip = children_bestowed_by_gods_decision_effect_tooltip
        make_pregnant = {
                father = root.primary_spouse
        }
    }
}

Also try adding this to the conditions:
Code:
exists root.primary_spouse

That should make sure there actually is a husband available to be the father of the queen's children. You might also want to lower the age limit to 50 or so in order to avoid having a decade where the woman can't get natural babies, but also can't get babies gifted by the gods.
 
This is an incredibly stupid question, but how do I get the ID numbers to work instead of the names? For example, I can get the "set_culture = culture:irish" to work just fine, but if I use the ID of 60 for Irish, it just says "<Name> adopts the Culture."

To extend that, why can't I get set_house to work with either? I have the House name from the Explorer, and that doesn't work like set_culture. I thought maybe the ID would be better, but I can't even get that to work with set_culture.

Thanks for any help. I'm just missing something simple I think.
 
@roadkill_rodney

Where are you getting these supposed ID numbers from? In all my CK2 and Stellaris modding I've never come across using ID numbers to refer to anything and I don't think CK3 is any different. I don't think the game recognizes any ID numbers because it isn't intended to. In my experience the PDX way is to refer to things exclusively with a name string.

What exactly do you mean by getting the House name from the Explorer? What house name specifically were you trying to use?