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

Seraron

Private
32 Badges
Sep 3, 2019
19
31
  • Crusader Kings II
  • Magicka 2
  • Surviving Mars
  • Crusader Kings II: Horse Lords
  • Knights of Pen and Paper 2
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Tyranny: Archon Edition
  • Crusader Kings II: Monks and Mystics
  • Pillars of Eternity
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Crusader Kings II: Holy Fury
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • War of the Roses
  • Warlock: Master of the Arcane
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Leviathan: Warships
  • Magicka
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
Title says it all really. I'm wondering if it's possible to add a condition that makes it so certain characters or types of characters can't get certain traits. (This is all part of a larger learning exercise for me since I'm new to modding CK2). As an example, say, if I wanted to make it so that women cannot get the bastard trait, or say that members of a certain faith are immune to smallpox?

This is a follow-up to a previous thread about removing traits under certain conditions, so I'm aware that I could do this by finding all events that give X trait and then add exclusions to all the triggers. But that seems to me like it's a) an awfully tedious way of doing what I want, and b) probably more resource intensive since the game will have to check for all those extra triggers every time. Better, imo, that the event which grants the trait triggers normally: and then it either gets instantly removed because that triggers a new condition, or it just make it so it cannot be added at all. Or would this crash the game because of some weird contradiction?

I've already looked over the modifiers, conditions, and events pages on the CK2 wiki for information about this but haven't found much. Maybe I just missed something.

Thanks in advance for any advice offered.
 
Yep that should be doable. Edit: Does not work for events! Just for random distribution.
Consider this vanilla trait:
Code:
#Catholic
secretly_catholic = {

    potential = {
        NOT = {
            religion = catholic
        }
    }
    ...
}
The potential section states that this trait can NOT be gained by characters that are actually Catholic (because it wouldn't make sense for them to practice Catholicism in secret).
You could expanded on this system to a large degree, such as setting flags on people by event, and then checking for their existence in the potential section of the trait, or check something else entirely.
Vanilla has several examples:
Code:
#Zodiac Signs
zodiac_aquarius = {
    potential = {
        OR = {
            religion = hellenic_pagan
            religion = hellenic_pagan_reformed
            has_religion_feature = religion_astrology
        }
    }
...
Or you can do something as simple as dividing by gender:
Code:
monk = {
    potential = {
        is_ruler = no
        is_female = no
    }
...
Code:
nun = {
    potential = {
        is_ruler = no
        is_female = yes
    }
...
Looking at vanilla files can be overwhelming, but it is the next best thing to get insight after reading the wiki. You just need some idea of what you are looking for, and where that could be located in the files.

Edit: It should be added, this does NOT prevent them from getting the trait via event. I forgot that. I'm afraid it's not so easy to prevent that :(
 
Last edited:
Ah okay! So that's what that means.

Thank you again Lord Peter :0
Still, it does not work for events as you asked. Forgot it at first, so "potential" is not that useful after all.
But there's no easy way to do it except edit all the events that give the trait, or add a maintenance event that removes the trait on ineligible characters.
 
It seems strange to me that something that obvious (in my mind) is missing. But then, maybe it's also rare enough in the base game that it wasn't a consideration and hand-written exceptions sufficed.
 
Well a lot of code is still somewhat "legacy". CK2 was originally not designed for a lifetime of 7+ years, so many features that would have been helpful for an every increasing codebase were simply not considered important back then. A lot of helpful stuff was added over time to help with maintaining, such as scripted triggers/effects (before these you had to spell everything out every time!).
In the very beginning, there were maybe like a tenth of the current number of events, and just hand-correcting things for traits was still viable. So that one is still missing a helful automated option, yes. Not sure if the devs will be able to mod such a system in for CK2 (I doubt it), but for the newer games such as Stellaris or Imperator these things are likely taken into account.
 
If it's disease traits specifically that you're looking to prevent, you can add conditions in the disease's on_character_infection block in its definition to prevent infection, as is used by the vanilla immunity flags
 
  • 2
Reactions: