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

jwalche

Lt. General
16 Badges
Nov 5, 2018
1.607
13
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
So I have been creating my first mod named "My Mod" to automate the mundane task of seduction. The below code is working beta. But I can use some help to improve it.
What it does is, while Auto Seduction option is turned on by the ruler, a new seduction attempts starts with a random women of desirable qualities for easy of seduction and impregnation attempt.

The first modded file is way_of_life_decisions.txt I only added following lines;
Code:
    auto_seduction_on = {
        filter = self

        potential = {
            has_focus = focus_seduction
            NOT = {    has_character_flag = seduction_automated }
        }
     
        effect = {
            hidden_tooltip = {
                set_character_flag = seduction_automated
            }     
        }
        revoke_allowed = { always = no }
        ai_will_do = { factor = 0 }
    }
 
    auto_seduction_off = {
        filter = self
     
        potential = {
            has_character_flag = seduction_automated
        }
     
        effect = {
            hidden_tooltip = {
                clr_character_flag = seduction_automated
            }
        }
        revoke_allowed = { always = no }
        ai_will_do = { factor = 0 }
    }

The second file I modded is wol_seduction_events.txt I made following change to intercept when a seduction event ends;
Code:
# End of Seduction event to clear out flags, etc
character_event = {
    id = WoL.118
#Existing lines....

#Addition Starts
        if {
            limit = { has_character_flag = seduction_automated }
            hidden_tooltip = {
                character_event = { id = WoL.105 }
            }
        }
#Addition Ends.
}
Finally, I added following two events in the same file. And it works pretty nicely.
Code:
#Event implementation of Seduction user input
#Target is randomly selected based on the previous seduction target
character_event = {
    id = WoL.105
    hide_window = yes
    is_triggered_only = yes
  
    immediate = {
        random_realm_character = {
            limit = {      
          
                OR = {
                    religion_group = FROM
                    is_liege_or_above = FROM
                }
              
                is_female = yes  
                is_incapable = no
                is_married = no
                is_consort = no      
                is_marriage_adult = yes
                prisoner = no
#                has_disease = no
#                has_any_symptom = no
                is_pregnant = no
              
                NOT = {
                    distance = { who = FROM value = 200 }
                    character = FROM
                    is_lover = FROM
                    is_former_lover = FROM
                    is_consort = FROM
                    is_close_relative = FROM

                    age = 35
                    num_of_children = 3

                    trait = homosexual
                    trait = eunuch
                    trait = infirm
                    trait = inbred
                    trait = imbecile
                    trait = chaste
                    trait = shy
                    trait = mangled
                    trait = severely_injured
                    trait = celibrate
              
                    trait = clubfooted
                    trait = dwarf  
                    trait = harelip
                    trait = hunchback
                    trait = lisp
                    trait = slow
                    trait = stutter
                    trait = ugly
                    trait = weak
                    trait = giant
                    trait = lefthanded
                  
                    trait = genius
                    trait = strong                  
                }
            }
          
            preferred_limit  = {
                NOT = {    age = 20 }
                trait = lustful

            }
          
            preferred_limit  = {
                NOT = {    age = 25 }
                trait = lustful

            }
          
            preferred_limit  = {
                OR {
                    trait = lustful
                    trait = hedonist
                }
            }
          
            preferred_limit  = {
                OR {
                    trait = midas_touched
                    trait = fortune_builder
                    trait = grey_eminence
                }
            }
  
            preferred_limit  = {
                OR {
                    trait = thrifty_clerk
                    trait = charismatic_negotiator
                    trait = underhanded_rogue
                }
            }
          
            hidden_tooltip = {
                character_event = { id = WoL.106 }
            }
          
        }
    }
}
  
# Event implementation of Seduce Decision
character_event = {
    id = WoL.106
    hide_window = yes
    is_triggered_only = yes

    immediate = {
        hidden_tooltip = {
            FROM = {
          
          
                    opinion = {
                        who = ROOT
                        modifier = opinion_seducing
                        years = 1000
                    }
                  
                    if = {
                        limit = {
                            is_close_relative = ROOT
                            NOT = { religion = messalian }
                            NOT = { religion = zoroastrian }
                        }
                        character_event = { id = WoL.102 days = 1 } # Warning - Incest scandal risk
                        break = yes
                    }
                  
                    if = {
                        limit = {
                            same_sex = ROOT
                        }
                        character_event = { id = WoL.104 days = 1 } # Warning - Homosexual scandal risk
                        break = yes
                    }
                  
                    if = {
                        limit = {
                            religion_group = christian
                            OR = {
                                is_priest = yes
                                is_ascetic_trigger = yes
                                ROOT = { is_priest = yes }
                                ROOT = { is_ascetic_trigger = yes }
                            }
                        }
                        character_event = { id = WoL.103 days = 1 } # Warning - Priest scandal risk
                        break = yes
                    }
                  
                    if = {
                        limit = {
                            age_diff = {
                                who = ROOT
                                years = 25
                            }
                        }
                        character_event = { id = WoL.101 days = 1 } # Warning - Age scandal risk
                        break = yes
                    }
                  
                    character_event = { id = WoL.100 days = 1 } # No warning - Let the chase begin!
      
              
              
            }
        }
    }
}
 
Last edited:
My first question is, why the commented out lines
Code:
#                has_disease = no
#                has_any_symptom = no
cause error if uncommented?

My second question is, is there anyway to put some condition in the Event Wol.105? What I want to do is making conditional preferred_limit so that,

If the seducer is a Master Seducer and the seduced is under age 25, trait lustful is required for seduced candidates.

Also, I would like to give scores for various desirable / undesirable traits, and select a seduced candidate with highest score.

Any help or direction would be highly appreciated!
 
My Auto Seduction Second Beta is working better now. Still learning. Any suggestions?

quality_of_life_decisions.txt
Code:
targetted_decisions = {

    auto_seduction_on = {
        filter = self

        potential = {
            has_focus = focus_seduction
            NOT = {    has_character_flag = seduction_automated }
        }
      
        effect = {
            hidden_tooltip = {
                set_character_flag = seduction_automated
            }      
        }
        revoke_allowed = { always = no }
        ai_will_do = { factor = 0 }
    }
  
    auto_seduction_off = {
        filter = self
      
        potential = {
            has_character_flag = seduction_automated
        }
      
        effect = {
            hidden_tooltip = {
                clr_character_flag = seduction_automated
            }
        }
        revoke_allowed = { always = no }
        ai_will_do = { factor = 0 }
    }
}

wol_seduction_event.txt
Code:
#
# Edited by jwalche
# New events: WoL.105, WoL.106
# Edited events: Wol.118, WoL.306
#
#########################################################

#Event implementation of Seduction user input
#Target is randomly selected based on the previous seduction target
character_event = {
    id = WoL.105
  
    #We want to do this work siliently.
    hide_window = yes
  
    #It can only happen when triggered.
    is_triggered_only = yes
  
    #No need for pre-triggers, triggers, or MTTH.
    #This event only runs when called directly
    option = {  
        name = WoL.105_option1
  
        #Let's choose a good target to impregnate      
        random_character = {
            limit = {      
          
                #Only females can be pregnanted. Duh! Half Population is out. Narrow down the selection big time.
                is_female = yes      

                #Age range that can be pregnanted.
                is_marriage_adult = yes
                age < 45
              
                #Should meet either of the conditions below or we can't seduce her.
                OR = {
                    religion_group = FROM
                    is_liege_or_above = FROM
                }
              
                #With the addition of sick_incapable in RD, it's important to use this conditional instead of checking for trait = incapable.
                is_incapable = no
                is_ill = no              
              
                #Leave the prisoners alone
                prisoner = no
              
                #Farther and seduction gets slowed
                NOT = { distance = { who = FROM value = 200 } }
              
                #Haters are not lovers              
                #Either she likes us, or will like us after paying her
                personal_opinion = { who = FROM    value = 10 }
                  
                #Limiting conditions
                NOR = {
                    #Seduction impossible
                    character = FROM
                    is_lover = FROM
                    is_former_lover = FROM
                    is_consort = FROM
                  
                    #We can't seduce spouse. And avoid incest
                    is_close_relative = FROM
                  
                    #These people are no no.
                    trait = homosexual
                    trait = eunuch
                    trait = incapable
                    trait = infirm
                    trait = inbred
                    trait = imbecile
                    trait = chaste
                    trait = celibrate
                }

                #Health conditions
                NOR = {
                    #They can wait to be healed or cured
                    trait = mangled
                    trait = severely_injured
                    trait = stressed
                    trait = depressed
                    trait = is_malnourished
                  
                    #has_disease doesn't work. Has to do this manually
                    #has_disease = no
                    trait = has_aztec_disease
                    trait = has_typhus
                    trait = cancer
                    trait = has_tuberculosis
                    trait = has_tuberculosis
                    trait = dancing_plague
                    trait = dysentery
                    trait = flu
                    trait = food_poisoning
                    trait = gout
                    trait = syphilitic
                    trait = has_typhoid_fever
                    trait = leper
                    trait = has_measles
                    trait = pneumonic
                    trait = rabies
                    trait = scurvy
                    trait = sickly
                    trait = has_small_pox
                    trait = has_bubonic_plague
                  
                    #has_any_symptom doesn't work. Has to do this manually
                    #has_any_symptom = no
                    trait = abdominal_pain
                    trait = chest_pain
                    trait = cough
                    trait = cramps
                    trait = diarrhea
                    trait = fatigue
                    trait = fever
                    trait = headache
                    trait = infection
                    trait = malaise
                    trait = rash
                    trait = vomiting
                }  
                  
                #Undesirable genetic traits
                NOR = {
                    #is_pregnant is cheating since it can check pregnancy immediately. Has to do this manually
                    #is_pregnant = no          
                    trait = clubfooted
                    trait = dwarf  
                    trait = harelip
                    trait = hunchback
                    trait = lisp
                    trait = slow
                    trait = stutter
                    trait = ugly
                    trait = weak
                    trait = giant
                    trait = lefthanded
                }      

                #Busy target
                NOR = {
                    trait = on_hajj
                    trait = on_pilgrimage
                    trait = in_hiding
                    in_command = yes
                    has_character_modifier = in_meditation
                    has_character_modifier = doing_penance
                    AND = {
                        OR = {
                            has_character_modifier = in_seclusion
                            FROM = { has_character_modifier = in_seclusion }
                        }
                        NOT = { at_location = FROM }
                    }
                }

              
                #If our ruler's a court tomcat, we don't want to seduce a married women and get the child stolen.
                OR = {
                    #Either our ruler is not a court tomcat
                    NOT = {    FROM = { has_character_modifier = wol_court_tomcat } }
                    #or the target is not married in any way.
                    NOR = {
                        is_married = yes
                        is_consort = yes
                    }      
                }

                #We need to be able to seduce the target in some way
                OR = {
                    #Master seducer could just blow into her ears.
                    FROM = { trait = seducer }
                  
                    #Lustful. Our favorite. Speak Lewd. 1125:100
                    AND = {
                        trait = lustful
                      
                        #She will be fine if she is either not screwed up or has a cure
                        NOT = { trait = shy }    #Shy girls a re hopeless. Chance x 0.25
                        OR = {
                            #Having all these traits are bad
                            AND {
                                trait = zealous        #Chance x 0.75
                                trait = honest        #Chance x 0.75
                                trait = kind        #Chance x 0.75
                            }  
                            #But can be cured with some good traits
                            trait = hedonist    #Chance x 2
                            trait = gregarious    #Chance x 2
                            trait = deceitful    #Chance x 1.5
                            #Or if our ruler is skilled.
                            FROM = { has_character_modifier = wol_seducer_2 }
                        }
                    }
                  
                    #Not lustful. But young.
                    AND = {
                        NOR = {
                            age = 25
                            trait = lustful
                        }  
                      
                        OR = {
                            AND = { #Confess Love. 750:100
                                #These ttraits are nasty
                                NOR = {
                                    trait = cynical        #Chance x 0.25
                                    trait = paranoid    #Chance x 0.25
                                    AND = {
                                        trait = gregarious    #Chance x 0.5
                                        trait = deceitful    #Chance x 0.5
                                    }
                                }
                              
                                #Having only either gregarious or deceitful can be acceptable
                                OR = {
                                    NOR = {
                                        trait = gregarious    #Chance x 0.5
                                        trait = deceitful    #Chance x 0.5
                                    }
                                    trait = trusting    #Chance x 2
                                    trait = shy            #Chance x 1.5
                                    trait = zealous        #Chance x 1.5
                                    AND {
                                        trait = honest    #Chance x 1.25
                                        trait = kind    #Chance x 1.25
                                    }
                                    FROM = { has_character_modifier = wol_seducer_2 }                              
                                }
                            }
                          
                            OR = { #Or read a poetry
                                trait = poet        #Chance x 10
                                trait = scholar        #Chance x 5
                                trait = mastermind_theologian    #Chance x 4
                                trait = scholarly_theologian    #Chance x 4
                                trait = mystic        #Chance x 3
                                AND = {
                                    learning = 5
                                    age = 25
                                    calc_true_if = {
                                        amount = 2
                                        learning = 10        #Chance x 1.5
                                        learning = 15        #Chance x 2.25
                                        trait = detached_priest        #Chance x 2
                                        trait = martial_cleric        #Chance x 2
                                    }
                                }
                            }
                        }                          
                    }

                    #Not lustful or young, but some lewd boost.
                    AND = {
                        age = 25       
                        NOT = { trait = lustful }  
                      
                        #Speak Lewd. 375:100
                        AND = {
                            #Can't afford any bad trait
                            NOR = {
                                trait = shy         #Chance x 0.25
                                trait = zealous        #Chance x 0.75
                                trait = honest        #Chance x 0.75
                                trait = kind        #Chance x 0.75
                            }
                            #Also gotta have some boost
                            OR = {
                                trait = hedonist    #Chance x 2
                                trait = gregarious    #Chance x 2
                                trait = deceitful    #Chance x 1.5
                                #Or if our ruler is skilled.
                                FROM = { has_character_modifier = wol_seducer_2 }
                            }
                        }
                    }

                    #Star lovers
                    AND = {
                        FROM = { society_member_of = hermetics }
                        OR = {
                            trait = mystic
                            trait = erudite
                            trait = scholar
                            society_member_of = hermetics
                            FROM = { society_rank >= 3 }
                            FROM = { has_character_modifier = wol_seducer_2 }
                        }              
                    }
                }
              
                #Pregnancy conditions
                NOR = {
                    #is_pregnant is cheating since it can check pregnancy immediately. Has to do this manually
                    #is_pregnant = no          
                    trait = pregnant
                    #instead, give her a break if she was recently tumbled even if she might not be pregnant
                    has_character_modifier = recently_tumbled_by_player
                    num_of_children = 4 #4 is plenty. It also reduces impregnation chance.
                }
              
                #Give a break if recently given up without tumbling
                NOT = { has_character_modifier = recently_seduced_by_player }
              
                #End of Target Seducibility
            }
          
            preferred_limit  = {
                NOT = {    age = 20 }
                trait = lustful
            }
          
            preferred_limit  = {
                NOT = {    age = 25 }
                trait = lustful
            }
          
            preferred_limit  = {
                OR {
                    trait = lustful
                    trait = hedonist
                }
            }
          
            preferred_limit  = {
                OR {
                    trait = midas_touched
                    trait = fortune_builder
                    trait = grey_eminence
                }
            }
  
            preferred_limit  = {
                OR {
                    trait = thrifty_clerk
                    trait = charismatic_negotiator
                    trait = underhanded_rogue
                }
            }
          
            hidden_tooltip = {
                character_event = { id = WoL.106 }
            }          
        }
    }
}
  
# Event implementation of Seduce Decision
character_event = {
    id = WoL.106
    hide_window = yes
    is_triggered_only = yes

    immediate = {
        hidden_tooltip = {
            FROM = {
    
                    opinion = {
                        who = ROOT
                        modifier = opinion_seducing
                        years = 1000
                    }
                  
                    if = {
                        limit = {
                            is_close_relative = ROOT
                            NOT = { religion = messalian }
                            NOT = { religion = zoroastrian }
                        }
                        character_event = { id = WoL.102 days = 1 } # Warning - Incest scandal risk
                        break = yes
                    }
                  
                    if = {
                        limit = {
                            same_sex = ROOT
                        }
                        character_event = { id = WoL.104 days = 1 } # Warning - Homosexual scandal risk
                        break = yes
                    }
                  
                    if = {
                        limit = {
                            religion_group = christian
                            OR = {
                                is_priest = yes
                                is_ascetic_trigger = yes
                                ROOT = { is_priest = yes }
                                ROOT = { is_ascetic_trigger = yes }
                            }
                        }
                        character_event = { id = WoL.103 days = 1 } # Warning - Priest scandal risk
                        break = yes
                    }
                  
                    if = {
                        limit = {
                            age_diff = {
                                who = ROOT
                                years = 25
                            }
                        }
                        character_event = { id = WoL.101 days = 1 } # Warning - Age scandal risk
                        break = yes
                    }
                  
                    character_event = { id = WoL.100 days = 1 } # No warning - Let the chase begin!
      
              
              
            }
        }
    }
}

# End of Seduction event to clear out flags, etc
character_event = {
    id = WoL.118
...
        if {
            limit = { has_character_flag = seduction_automated }
            FROMFROMFROMFROM = {
                add_character_modifier = { name = recently_seduced_by_player days = 30 }
            }
            hidden_tooltip = {
                character_event = { id = WoL.105 days = 1 }
            }
        }
    }
}

character_event = {
    id = WoL.306
...
        # Player should know who he tumbled
        if = {
            limit = { has_character_flag = seduction_automated }
            add_character_modifier = { name = recently_tumbled_by_player days = 70 }
        }
...
 
Last edited:
I'm no modder, btw your mod will be super useful!
I can only suggest you check trait = celibate because there is a typo: "celibrate". Please publish the final version :D
 
First at all i have to give you thanks for the mod, in my games i tend to have every castle ruled by someone of my dynasty, having more than 80 childrens per ruler in each gameplay make the first decades a constant pause and run (very boring and troublesome since one want to be conquering, revoking titles or doing other stuff) Since my experience in modding is only edit other mods and do simple stuff for myself I couldn't give you any suggestion about the scripting, but i suggest 3 simple things based on my gameplay experience and for my commoditie(perhaps you have an different focus for the mod)
1 - Maintain the seduction in the player court, in my case i dont want childrens in the court of other ruler, even if they are my vassal
2 - The girl must be of the player culture since the child will be a vassal on the future and the different culture is an opinion malus and a possible limitation for him if the player is norse or similar
3 - Have the "opinion_seduced_refused" in the limit, bypass that could be considered cheating
 
First at all i have to give you thanks for the mod, in my games i tend to have every castle ruled by someone of my dynasty, having more than 80 childrens per ruler in each gameplay make the first decades a constant pause and run (very boring and troublesome since one want to be conquering, revoking titles or doing other stuff) Since my experience in modding is only edit other mods and do simple stuff for myself I couldn't give you any suggestion about the scripting, but i suggest 3 simple things based on my gameplay experience and for my commoditie(perhaps you have an different focus for the mod)
1 - Maintain the seduction in the player court, in my case i dont want childrens in the court of other ruler, even if they are my vassal
2 - The girl must be of the player culture since the child will be a vassal on the future and the different culture is an opinion malus and a possible limitation for him if the player is norse or similar
3 - Have the "opinion_seduced_refused" in the limit, bypass that could be considered cheating
Actually #1 and #2 are easy. I only have to remove some functions that I already have. But then, there are situations that you just want to seduce anyone.

To solve it, I somehow need to introduce a way to choose target range. I am thinking of two methods, and I can't easily decide one. Also I wonder if there is a better way.

The first method is using a serious of dialog. Choose age range, culture, same realm or court, etc etc.

The second method would be setting range based on the first girl seduced after choosing the auto_seduction_on decision. If the girl is from my court, then subsequently choose only girls from my court, etc.

Any input?