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

Gigick

Recruit
Apr 28, 2023
4
0
Is it possible and how to set up an innate property in the game files in such a way that the probability of its occurrence depends on the dynasty of the character? That is, for example, in all dynasties, the property of gigantism was transmitted as usual with a probability of 25%, and in, for example, the Umayyads with a probability of 5%.
 
Could you write an example of such code, with any trate? If it's not too much trouble
Unfortunately I have never modified specific dynasties so I don't know the relevant trigger for that.

But if you want to reduce the heritability chance look something like this:
Code:
on_birth_child = {
    on_actions = {
        name_of_your_new_on_action
    }
}


name_of_your_new_on_action = {
    effect = {
        hidden_effect = {
            scope:child = {
                if = {
                    limit = {
                        has_dynasty = yes
                        # Specific dynasty check goes here
                        has_trait = giant
                        OR = {
                            AND = {
                                exists = father
                                father = { has_trait = giant }
                            }
                            AND = {
                                exists = mother
                                mother = { has_trait = giant }
                            }
                        }
                    }
                    random = {
                        chance = 0.8
                        remove_trait = giant
                    }
                }
            }
        }
    }
}

If you want to increase the heritability it will look something like this:
Code:
on_birth_child = {
    on_actions = {
        name_of_your_new_on_action
    }
}


name_of_your_new_on_action = {
    effect = {
        hidden_effect = {
            scope:child = {
                if = {
                    limit = {
                        has_dynasty = yes
                        # Specific dynasty check goes here
                        NOT = { has_trait = giant }
                        OR = {
                            AND = {
                                exists = father
                                father = { has_trait = giant }
                            }
                            AND = {
                                exists = mother
                                mother = { has_trait = giant }
                            }
                        }
                    }
                    random = {
                        chance = # Put the increased chance you want the dynasty to inherit the trait
                        add_trait = giant
                    }
                }
            }
        }
    }
}

Both of them just need the relevant trigger for a specific dynasty. I assume there is such a trigger, but I personally haven't come across it.
 
  • 1
Reactions:
Checking the wiki, there's something called potential.

potential = {
exists = dynasty.dynast
}

You can use this for faith too.

Try using that. Of course, this might make it so that all children of the dynasty get the trait... but I imagine that it can be combined with on_birth_child.
 
  • 1
Reactions:
Checking the wiki, there's something called potential.

potential = {
exists = dynasty.dynast
}

You can use this for faith too.

Try using that. Of course, this might make it so that all children of the dynasty get the trait... but I imagine that it can be combined with on_birth_child.
Can you write code examples for both files?) For both "traits" and "on_birth_child"? I understood the principle that the person from above wrote to me, for which I thank him very much, but I still don't fully understand what exactly to implement it.
 
Unfortunately I have never modified specific dynasties so I don't know the relevant trigger for that.

But if you want to reduce the heritability chance look something like this:
Code:
on_birth_child = {
    on_actions = {
        name_of_your_new_on_action
    }
}


name_of_your_new_on_action = {
    effect = {
        hidden_effect = {
            scope:child = {
                if = {
                    limit = {
                        has_dynasty = yes
                        # Specific dynasty check goes here
                        has_trait = giant
                        OR = {
                            AND = {
                                exists = father
                                father = { has_trait = giant }
                            }
                            AND = {
                                exists = mother
                                mother = { has_trait = giant }
                            }
                        }
                    }
                    random = {
                        chance = 0.8
                        remove_trait = giant
                    }
                }
            }
        }
    }
}

If you want to increase the heritability it will look something like this:
Code:
on_birth_child = {
    on_actions = {
        name_of_your_new_on_action
    }
}


name_of_your_new_on_action = {
    effect = {
        hidden_effect = {
            scope:child = {
                if = {
                    limit = {
                        has_dynasty = yes
                        # Specific dynasty check goes here
                        NOT = { has_trait = giant }
                        OR = {
                            AND = {
                                exists = father
                                father = { has_trait = giant }
                            }
                            AND = {
                                exists = mother
                                mother = { has_trait = giant }
                            }
                        }
                    }
                    random = {
                        chance = # Put the increased chance you want the dynasty to inherit the trait
                        add_trait = giant
                    }
                }
            }
        }
    }
}

Both of them just need the relevant trigger for a specific dynasty. I assume there is such a trigger, but I personally haven't come across it.
Hi, sorry for necroing this thread, but I'm new to modding and I also have the problem as OP. I understand the general concept of this code, but I don't quite understand how to trigger this for a specific dynasty, or a custom dynasty. Have you come across a solution to this in particular?
 
Hi, sorry for necroing this thread, but I'm new to modding and I also have the problem as OP. I understand the general concept of this code, but I don't quite understand how to trigger this for a specific dynasty, or a custom dynasty. Have you come across a solution to this in particular?
I still have never modded dynasties, but I have learned a bit more since I originally made my post. So below are some examples of what could go in the "# Specific dynasty check goes here" section of the code.

To do any dynasty defined in the common/dynasties folder just use the dynasty id. For example the Karling dynasty check would be:
Code:
dynasty = dynasty:25061

If by custom dynasty, you mean one created in game, rather than one that is predefined, then I'm still not sure. Though if you just want the player's custom dynasty then there is a work around:
Code:
any_player = {
    dynasty ?= prev.dynasty
}
 
  • 1
Reactions:
I still have never modded dynasties, but I have learned a bit more since I originally made my post. So below are some examples of what could go in the "# Specific dynasty check goes here" section of the code.

To do any dynasty defined in the common/dynasties folder just use the dynasty id. For example the Karling dynasty check would be:
Code:
dynasty = dynasty:25061

If by custom dynasty, you mean one created in game, rather than one that is predefined, then I'm still not sure. Though if you just want the player's custom dynasty then there is a work around:
Code:
any_player = {
    dynasty ?= prev.dynasty
}
Thank you for responding, I appreciate you taking the time to write this out. I will certainly try this out, and see what happens! Have a good day, happy Easter :)
 
  • 1Like
Reactions: