• 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 want to have a triggered modifier everytime the ruler of a specific religion gets a piety or prestige reduction, when he is not married to his marriable daughter.

I will try this one:

Code:
nicht_verheiratet = {
    potential = {
        is_ruler = yes
        is_adult = yes
    }
  
    trigger = {
        religion = atheisten
        has_living_children = yes
        OR = {
            AND = {
                is_female = no
                any_child = {
                    is_female = yes
                    is_marriage_adult = yes
                    NOT = { is_married = ROOT }
                    NOT = { is_consort = ROOT }
                }
            }
            AND = {
                is_female = yes
                any_child = {
                    is_female = no
                    is_marriage_adult = yes
                    NOT = { is_married = ROOT }
                    NOT = { is_consort = ROOT }
                }
            }
        }
    }
  
    icon = 36
  
    piety = -0.25
  
    active = no
}

For performance, it's better to use a periodically-triggering event to set such modifiers than to use triggered modifiers, which are (as mentioned above) quite heavy in their performance cost.
 
How about this event?

Code:
# Nicht verheiratet mit der Tochter
character_event = {
    id = 190060
    desc = EVTDESC190060
    picture = GFX_evt_Whispering_in_ear
   
    only_rulers = yes

    trigger = {
#        is_ruler = yes
        is_adult = yes
        religion = atheisten
        has_living_children = yes
        OR = {
            AND = {
                is_female = no
                any_child = {
                    is_female = yes
                    is_marriage_adult = yes
                    NOT = { is_married = ROOT }
                    NOT = { is_consort = ROOT }
                }
            }
            AND = {
                is_female = yes
                any_child = {
                    is_female = no
                    is_marriage_adult = yes
                    NOT = { is_married = ROOT }
                    NOT = { is_consort = ROOT }
                }
            }
        }
    }
   
    mean_time_to_happen = {
        months = 3
       
#        modifier = {
#            factor = 0.25
#            trait = lustful
#        }
    }
   
    option = {
        name = EVTOPTA190060 # Ich heirate meine Tochter!
            trigger = {
                is_female = no
                NOT = { num_of_spouses = 2 }
            }
        random_child = {
            limit = {
                is_female = yes
                is_marriage_adult = yes
                NOT = { is_married = ROOT }
                NOT = { is_consort = ROOT }
            }
            add_spouse = ROOT
        }
        prestige = 100
        piety = 50
    }
    option = {
        name = EVTOPTB190060 # Ich heirate meinen Sohn!
            trigger = {
                is_female = yes
                NOT = { num_of_spouses = 1 }
            }
        random_child = {
            limit = {
                is_female = no
                is_marriage_adult = yes
                NOT = { is_married = ROOT }
                NOT = { is_consort = ROOT }
            }
            add_spouse_matrilineal = ROOT
        }
        prestige = 100
        piety = 50
    }
    option = {
        name = EVTOPTC190060 # Sie wird meine Konkubine
            trigger = {
                is_female = no
                NOT = { num_of_consorts = 4 }
            }
        random_child = {
            limit = {
                is_female = no
                is_marriage_adult = yes
                NOT = { is_married = ROOT }
                NOT = { is_consort = ROOT }
            }
            father = { add_consort = THIS }
        }
        prestige = 50
        piety = 100
    }
}
 
In the attached mod, I've reduced the map to two provinces--#1, Iceland (land), and #2, Coast of Iceland (sea). However, a port isn't being generated for Iceland.
blah.PNG
I copied both provinces' positions.txt values directly from those of vanilla's provinces #1 (Vestisland) and #982 (Coast of Iceland), so the port should be in a correct location. What did I do wrong?


Is there a way to see ingame, if the triggers are set right?
Use the testevent console command.
 

Attachments

  • HISTM.zip
    123,1 KB · Views: 0
Last edited:
Now it works:

Code:
character_event = {
    id = 190059
    desc = EVTDESC190059
    picture = GFX_evt_whispers
 
    hide_window = yes

    trigger = {
        mother = {
            religion = atheisten
            NOT = { has_character_modifier = Kind_heiratbar_modifier }
            NOT = { is_married = ROOT }
            NOT = { is_consort = ROOT }
            is_ruler = yes
        }
        NOT = {
            spouse = { is_close_relative = yes }
        }
        is_female = no
        is_marriage_adult = yes     
    }
 
    mean_time_to_happen = {
        months = 3
     
#        modifier = {
#            factor = 0.25
#            trait = lustful
#        }
    }
 
    option = {
        name = EVTOPTA190060
        save_event_target_as = Kind_heiratbar
        mother = {
            narrative_event = { id = 190061 }
        }
    }
}

character_event = {
    id = 190060
    desc = EVTDESC190060
    picture = GFX_evt_whispers
 
    hide_window = yes

    trigger = {
        father = {
            religion = atheisten
            NOT = { has_character_modifier = Kind_heiratbar_modifier }
            NOT = { is_married = ROOT }
            NOT = { is_consort = ROOT }
            is_ruler = yes
        }
        NOT = {
            spouse = { is_close_relative = yes }
        }
        is_female = yes
        is_marriage_adult = yes     
    }
 
    mean_time_to_happen = {
        months = 3
     
#        modifier = {
#            factor = 0.25
#            trait = lustful
#        }
    }
 
    option = {
        name = EVTOPTA190060
        save_event_target_as = Kind_heiratbar
        father = {
            narrative_event = { id = 190061 }
        }
    }
}

# Nicht verheiratet mit der Tochter bzw. Sohn
character_event = {
    id = 190061
    desc = EVTDESC190061
    picture = GFX_evt_whispers
 
    only_rulers = yes

    is_triggered_only = yes

    immediate = {
        # FROM = target, ROOT = player
        FROM = { save_event_target_as = Kind_heiratbar }
    }
 
#    mean_time_to_happen = {
#        months = 3
#     
#        modifier = {
#            factor = 0.25
#            trait = lustful
#        }
#    }
 
    option = {
        name = EVTOPTA190061 # Ich heirate meine Tochter!
            trigger = {
                is_female = no
                NOT = { num_of_spouses = 2 }
            }
        event_target:Kind_heiratbar = {
            add_spouse = ROOT
        }     
        add_spouse = FROM
        prestige = 100
        piety = 50
    }
    option = {
        name = EVTOPTB190061 # Ich heirate meine Tochter!
            trigger = {
                is_female = no
                NOT = { num_of_spouses = 2 }
            }
        event_target:Kind_heiratbar = {
            add_spouse_matrilineal = ROOT
        }     
        add_spouse_matrilineal = FROM
        prestige = 100
        piety = 50
    }
    option = {
        name = EVTOPTC190061 # Ich heirate meinen Sohn!
            trigger = {
                is_female = yes
                NOT = { num_of_spouses = 1 }
            }
        event_target:Kind_heiratbar = {
            add_spouse_matrilineal = ROOT
        }     
        add_spouse_matrilineal = FROM
        prestige = 100
        piety = 50
    }
    option = {
        name = EVTOPTD190061 # Sie wird meine Konkubine
            trigger = {
                is_female = no
                NOT = { num_of_consorts = 4 }
            }
        event_target:Kind_heiratbar = {
            add_consort = ROOT
        }
        prestige = 50
        piety = 100
    }
    option = {
        name = EVTOPTE190061
        add_character_modifier = {
            modifier = Kind_heiratbar_modifier
            duration = 180
        }
        prestige = -5
        piety = -5
    }
}
 
In the attached mod, I've reduced the map to two provinces--#1, Iceland (land), and #2, Coast of Iceland (sea). However, a port isn't being generated for Iceland.
The problem fixed itself after I added a second sea province (#3, North Atlantic). I guess the game assumes that a sea tile that adjoins no other sea tiles is a lake and doesn't generate ports.
 
Last edited:
I can't put newly generated Characters into my chosen Dynasty. If I use create_character, they spawn perfectly fine, except they get a random dynasty, instead of being put into the one I indicate. Does anyone know why this might be?

Edit : Having done a quick test, I can move them into the intended Dynasty afterwards by scoping to them and using "dynasty =", so it seems its just when using create_character that it does not work.
 
Last edited:
I can't put newly generated Characters into my chosen Dynasty. If I use create_character, they spawn perfectly fine, except they get a random dynasty, instead of being put into the one I indicate. Does anyone know why this might be?

Edit : Having done a quick test, I can move them into the intended Dynasty afterwards by scoping to them and using "dynasty =", so it seems its just when using create_character that it does not work.
It *should* work. Vanilla has numerous events that do just that. Make sure you don't have any typos in the create_character.
 
I created a mod, which is already in steam, changing the bonuses of the traces, I just copied the file 00_traits.txt and 02_traits.txt to the mod folder (all right).
But after I just left it on 00_traits.txt:

Code:
impaler = {
    lifestyle = yes
   
    potential = {
        NOT = { religion = jain }
    }

    intrigue = 2
    learning = 1
   
    same_opinion = 10
   
    ai_honor = -15
   
    command_modifier = {
        morale_offence = 0.2
    }
   
    male_insult = INSULT_TORTURER
    female_insult = INSULT_TORTURER
    male_insult_adj = INSULT_EVIL
    female_insult_adj = INSULT_EVIL
    child_insult_adj = INSULT_WICKED
   
    ruler_designer_cost = 10
}

hunter = {
    lifestyle = yes

    potential = {
        NOT = { religion = jain }
    }
   
    martial = 2
    diplomacy = 1
   
    command_modifier = {
        pursue = 0.2
    }
   
    same_opinion = 10
   
    ruler_designer_cost = 10
   
    male_compliment = COMPL_HUNTMASTER
}

patient = {
    personality = yes
    opposites =  {
        wroth
    }
   
    virtue = yes
   
    diplomacy = 1
    intrigue = 1
    stewardship = 1
    learning = 1
    opposite_opinion = -5
   
    ai_rationality = 10
   
    command_modifier = {
        defence = 0.4
    }
   
    male_insult = INSULT_SPIDER
    female_insult = INSULT_SPIDER
    child_insult = INSULT_DONKEY
}

craven = {
    personality = yes
    opposites =  {
        brave
    }
   
    vassal_opinion = -5
   
    martial = -2
    combat_rating = -1
   
    command_modifier = {
        morale_defence = -0.5
    }
   
    male_insult = INSULT_COWARD
    male_insult_adj = INSULT_CRAVEN
    female_insult_adj = INSULT_WUSSY
    child_insult_adj = INSULT_WUSSY
}

brave = {
    personality = yes
    opposites =  {
        craven
    }
   
    vassal_opinion = 5
    opposite_opinion = -5
    same_opinion = 5
   
    martial = 2
    combat_rating = 1
   
    command_modifier = {
        morale_defence = 0.3
    }
   
    male_compliment_adj = COMPL_BRAVE
    female_compliment_adj = COMPL_BRAVE
}

cruel = {
    personality = yes
    opposites =  {
        kind
    }
   
    intrigue = 1
    diplomacy = -1
   
    vassal_opinion = -5
    ai_honor = -5
    ai_greed = 5
   
    command_modifier = {
        morale_offence = 0.3
    }
   
    male_insult = INSULT_BRUTE
    female_insult = INSULT_FIEND
    child_insult = INSULT_TROLL
    male_insult_adj = INSULT_CRUEL
    female_insult_adj = INSULT_CALLOUS
    child_insult_adj = INSULT_WICKED
}

light_foot_leader = {
    leader = yes
   
    command_modifier = {
        light_infantry = 0.5
    }
}

heavy_infantry_leader = {
    leader = yes
   
    command_modifier = {
        heavy_infantry = 0.5
    }
}

cavalry_leader = {
    leader = yes
   
    command_modifier = {
        cavalry = 0.5
    }
}

inspiring_leader = {
    leader = yes
   
    command_modifier = {
        morale_offence = 0.5
        morale_defence = 0.5
    }
}

trickster = {
    leader = yes
   
    command_modifier = {
        random = 0.6
    }
}

organizer = {
    leader = yes
   
    command_modifier = {
        speed = 0.5
        retreat = 0.3
    }
}

defensive_leader = {
    leader = yes
   
    command_modifier = {
        defence = 0.55
        damage = -0.3
    }
}

experimenter = {
    leader = yes
   
    command_modifier = {
        center = 0.5
    }
}

flanker = {
    leader = yes
   
    command_modifier = {
        flank = 0.5
    }
}

aggressive_leader = {
    leader = yes
   
    command_modifier = {
        pursue = 0.55
        damage = 0.3
        defence = -0.3
    }
}

siege_leader = {
    leader = yes
   
    command_modifier = {
        siege = 0.7
    }
}

when I went to test the mod, only a few traits were changed according to the mod, for example, Heavy_Infantry_leader was giving the 50% bonus to Heavy Infantry, but the defensive _leader trait had the vanilla attributes of 20% and 10% not 55% and 30% of the mod, what's the problem?
 
Hey all - I want to make it harder for christians and muslims to declare holy wars by adding a piety requirement, but I'm really not sure on how to go about that. I've figured out how to disable their ability all together, but it's not really what I'm looking for - hope someone can help :)
 
Hey all - I want to make it harder for christians and muslims to declare holy wars by adding a piety requirement, but I'm really not sure on how to go about that. I've figured out how to disable their ability all together, but it's not really what I'm looking for - hope someone can help :)

Add the following to the can_use block:

Code:
ROOT = {
   OR = {
       NOR = {
           religion_group = christian
           religion_group = muslim
       }
       piety = XYZ
   }
}
If you also want the war declaration to cost piety (as opposed to only requring that you have it), add the following to the CB:

Code:
on_add = {
   if = {
       limit = {
           ROOT = {
               OR = {
                   religion_group = christian
                   religion_group = muslim
               }
           }
       }
       ROOT= {
          piety = -ABC
       }
   }
}
 
Hey guys, I made a separate forum post for this question but I thought I'd add it here as well in case people are watching this thread but not looking for new posts.

I recently decided to dive into doing some modding of the game so I can create the experience I want. One thing I've noticed in the past about the base game immortality trait is that it doesn't stop aging. You can correct that by modifying the save game and setting the immortality flag to the age you wish aging to stop (immortality = 20 for example).

Is it possible to set this with a trait? I can enable immortality within a secondary trait but I don't see a way to change the way it affects aging. If not directly changing this, is there a way to trigger an even to set the immortality age for a character like I mentioned above?

I'll still keep digging but I thought I'd ask here since I didn't see an obvious way to go about it yet.

Original Post: https://forum.paradoxplaza.com/foru...g-and-the-immortality-trait-question.1050664/
 
Hey, I wanted to get back with working on my mod, but when i try to launch my mod it just shuts down the launcher. I'm guessing it has something to do with updates. How do I go about fixing something like this? e.g. where do I look for what could be causing the issue?

It's worth noting I'm a total novice with CK2 Mod development, but did you run it through the validator (https://ck2.paradoxwikis.com/The_Validator)?
 
It's worth noting I'm a total novice with CK2 Mod development, but did you run it through the validator (https://ck2.paradoxwikis.com/The_Validator)?

Lol, thanks, it's been such a long time that I totally forgot about the validator's existence :p

Now when running the latest validator version, I get a crapton of errors that seem replace_path related to me.
Since my mod is a total conversion mod, this did the job pre M&M etc..

Code:
name = "Nimeria"
path = "mod/Nimeria"
user_dir = "Nimeria"
replace_path = "history/characters"
replace_path = "history/diplomacy"
replace_path = "history/provinces"
replace_path = "history/titles"
replace_path = "history/wars"
replace_path = "history/technology"
replace_path = "history/eu4_converter"
replace_path = "common/cultures"
replace_path = "common/religions"
replace_path = "common/dynasties"
replace_path = "common/landed_titles"
replace_path = "common/trade_routes"
replace_path = "common/province_setup"
replace_path = "events"
replace_path = "music"
replace_path = "tutorial"

Could someone tell me which replace_path's are required nowadays to get a total conversion mod running again?
I could run through 1000 errors on the validator, but... it's probably easier if anyone over here knows.