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

DougyFresh

Private
Feb 12, 2020
11
0
Hey Modding community, I'm looking for help/advice with a mod that ties a trait to a religious doctrine or feature. to be specific I want to make a trait that will replace the inbred trait when the child is born from a divine marriage. for example, you're playing as a Zoroastrian or a reformed pagan with the divine marriage doctrine, and marry and have a child with your sibling, instead of the child being born with the inbred trait, they will get a new trait which I plan on calling the "Purebred" trait. I'm having trouble figuring out how to link the trait to a doctrine.

I have considered making an event that will do the replacement, but I,m fairly new to modding and think it will be easier to just add conditions to the trait.

Any advice, tips, and suggestions would be appreciated.
Thanks
 
I can give you some mod manuscript,
save following scripts as "99_on_actions.txt", under "common/on_actions"
Code:
#character (at 2 months)
on_pregnancy = {
   events = {
         23777
     }
}
# character
on_birth = {
   events = {
       23778
   }
}
save following scripts as "purebred.txt", under "events"
Code:
character_event = {
   id = 23777
 
   is_triggered_only = yes
 
   hide_window = yes
 
   trigger = {
       OR = {
           AND = {
               is_married_matrilineally = yes
               OR = {
                   has_religion_feature = religion_holy_family
                   has_religion_feature = religion_feature_zun
                   religion = zoroastrian
                   religion = messalian
               }
               spouse = {
                   is_close_relative = ROOT
               }
           }
           AND = {
               is_married_matrilineally = no
               spouse = {
                   is_close_relative = ROOT
                   OR = {
                       has_religion_feature = religion_holy_family
                       has_religion_feature = religion_feature_zun
                       religion = zoroastrian
                       religion = messalian
                   }
               }
           }
       }
   }

   immediate = {
       set_character_flag = bearing_purebred
   }
}
# On-action event: On Birth - hidden - purebred
character_event = {
   id = 23778
 
   is_triggered_only = yes
 
   hide_window = yes
 
   trigger = {
       mother = {
           has_character_flag = bearing_purebred
           OR = { # check again so avoiding religion converted
               has_religion_feature = religion_holy_family
               has_religion_feature = religion_feature_zun
               religion = zoroastrian
               religion = messalian
           }
       }
       father_even_if_dead = { # Cockold Kings II, let's not using real_father_even_if_dead
           OR = { # check again so avoiding religion converted
               has_religion_feature = religion_holy_family
               has_religion_feature = religion_feature_zun
               religion = zoroastrian
               religion = messalian
           }
       }
       NOT = { trait = bastard } # If the child already known as a bastard in event 312, this will not trigger
   }
  
   fail_trigger_effect = { # clean up
      mother = {
           clr_character_flag = bearing_purebred
       }
   }

   immediate = {
       mother = {
           clr_character_flag = bearing_purebred
       }
       add_trait = fair # replace this with your new trait, just do not mess it up
       random_list = { # lower the chance of inbred and lunatic
           10 = {
           }
           90 = {
               remove_trait = inbred
               remove_trait = lunatic
           }
       }
   }
}
*These script have yet tested so you might need debug yourself if not working fine

They are events you need for a "pureborn" child on birth. As for adding new trait in your mod, see Trait Modding.
 
Last edited:
Thanks for the help, the mod is working, but it seems to be conflicting with holy fury somehow and is causing this weres graphical bug.
Capture.PNG
 
Event scripts of mine will never screw up the graphic stuff. It's ill modification from other mods or your attempt broke it. Go check your own codes related to "interface/portrait_properties" and "interface/portraits"
 
I started a playthrough with this mod and the Dark world reborn mod, and am getting the "purebred" trait on children my ruler would have with some of the characters Dark world creates, any idea on why this may be happening?