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

Perotin1160

Corporal
18 Badges
Jun 12, 2021
26
1
  • Europa Universalis IV
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 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: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
Hi all, I've been trying to write an event chain that follows the following steps: 1. Player expresses dissatisfaction with foreign occupation (lowers opinion with liege) 2. Liege gets angry and writes letter to player, threatening exile and removal of titles if they continue on their rebellious path 3. Player becomes landless, creating a titular title and recruiting volunteers.

So far I've been unable to get it to work. The second event won't trigger so the rest of the chain stops in its tracks. Furthermore, I'm fairly certain the rest of the chain is flawed as I'm new to modding and it's all quite experimental for me. If any one can take a look at my code and let me know how I could fix it, I'd be more than grateful!

Code:
#Character grows restless under colonial control#
namespace = RB
character_event = {
    id = RB.100
    desc = EVTDESCRB.100
    picture = "GFX_evt_council"

    capable_only = yes
    prisoner = no
    min_age = 16

    mean_time_to_happen = {
        months = 1
    }
    
    trigger = {
        AND = {
            culture = welsh
            trait = ambitious
            martial >= 20
            learning >= 10
        }
        liege = {
            NOT = {
                culture = welsh
            }
        }
    }
    option = {
        name = EVTOPTARB.1001
        set_character_flag = british_supremacy
        opinion = {
            modifier = de_jure_liege
            who = liege
            years = 20
            inherit = yes
        }
        character_event = { id = RB.101 days = 7 }
    }
    option = {
        name = EVTOPTBRB.1001
        set_character_flag = no_uprising
    }
}
#Liege gets angry#
character_event = {
    id = RB.101
    desc = "EVTDESCRB.101"
    picture = "GFX_evt_council"

    is_triggered_only = yes

    trigger = {
        PREV = {
            any_vassal = {
                limit = {
                    has_character_flag = british_supremacy
                }
            }
        }   
    }
    option = {
        name = "EVTOPTARB.1011"
        letter_event = { id = RB.102 days = 7 }
    }
}
#Liege sends letter to player#
letter_event = {
    id = RB.102
    desc = "EVTDESCRB.102"
    picture =
    border =

    capable_only = yes
    prisoner = no
    is_ruler = yes
    ai = no
    min_age = 16
    is_triggered_only = yes

    immediate = {
        ROOT = {
            any_demesne_title = {
                set_title_flag = surrendered_title
            }
        }
    }
    option = {
        name = EVTOPTARB.1021
        create_title = {
            tier = KING
            landless = yes
            name = british_warband
            holder = ROOT
            culture = ROOT
            add_pressed_claim = {
            k_england
            }
        }
        liege = {
            character_event = { id = RB.103 days = 1 }
        }
    }
    option = {
        name = EVTOPTBRB.1022
        set_character_flag = no_british_uprising
        clr_character_flag = british_supremacy
    }
}
#Character becomes independent and landless and recruits volunteers#
character_event = {
    id = RB.103
    desc = "EVTDESCRB.103"
    picture = "GFX_event_letter_frame_religion"

    is_triggered_only = yes

    immediate = {
        FROM = {
            any_demesne_title = {
                limit = { has_title_flag = surrendered_title }
                grant_title_no_opinion = ROOT
            }
        }
    }
    option = {
        name = "EVTOPTARB.1031"
        spawn_unit = {
            owner = FROM
            province = {
                ROOT = {
                    location
                }
            }
            home = {
                ROOT = {
                    location
                }
            }
            match_character = {
                k_england = {
                    holder_scope
                }
            }
            match_mult = 0.5
            reinforces = yes
            reinforce_rate_multiplier = 0.33
        }
    }
}
 
The second event's trigger is malformed. There is no PREV, so that returns ROOT again, so it's checking if the restless vassal has a restless vassal. You need to send the second event to the first character's liege instead, and check FROM instead of PREV, cutting out any_vassal in the process.

Further on in your events you're doing things that are also wrong. Carefully check the wiki on how various effects should be used and don't stray from it, or the game won't know what to do with your events.
 
The second event's trigger is malformed. There is no PREV, so that returns ROOT again, so it's checking if the restless vassal has a restless vassal. You need to send the second event to the first character's liege instead, and check FROM instead of PREV, cutting out any_vassal in the process.

Further on in your events you're doing things that are also wrong. Carefully check the wiki on how various effects should be used and don't stray from it, or the game won't know what to do with your events.
Do you mean like this?

Code:
#Character grows restless under colonial control#
namespace = RB
character_event = {
    id = RB.100
    desc = EVTDESCRB.100
    picture = "GFX_evt_council"

    capable_only = yes
    prisoner = no
    min_age = 16

    mean_time_to_happen = {
        months = 1
    }
    
    trigger = {
        AND = {
            culture = welsh
            trait = ambitious
            martial >= 20
            learning >= 10
        }
        liege = {
            NOT = {
                culture = welsh
            }
        }
    }
    option = {
        name = EVTOPTARB.1001
        set_character_flag = british_supremacy
        opinion = {
            modifier = de_jure_liege
            who = liege
            years = 20
            inherit = yes
        }
        liege = {
            character_event = { id = RB.101 days = 7 }
        }
    }
    option = {
        name = EVTOPTBRB.1001
        set_character_flag = no_uprising
    }
}
#Liege gets angry#
character_event = {
    id = RB.101
    desc = "EVTDESCRB.101"
    picture = "GFX_evt_council"

    is_triggered_only = yes

    trigger = {
        FROM = {
              limit = {
                has_character_flag = british_supremacy
               }
           }
    }   
    option = {
        name = "EVTOPTARB.1011"
        FROM = {
            letter_event = { id = RB.102 days = 7 }
        }
    }
}
#Liege sends letter to player#
letter_event = {
    id = RB.102
    desc = "EVTDESCRB.102"
    picture =
    border =

    capable_only = yes
    prisoner = no
    is_ruler = yes
    ai = no
    min_age = 16
    is_triggered_only = yes

    immediate = {
        ROOT = {
            any_demesne_title = {
                set_title_flag = surrendered_title
            }
        }
    }
    option = {
        name = EVTOPTARB.1021
        create_title = {
            tier = KING
            landless = yes
            name = british_warband
            holder = ROOT
            culture = ROOT
        }
        add_pressed_claim = {
            k_england
        }
        FROM = {
            character_event = { id = RB.103 days = 1 }
        }
    }
    option = {
        name = EVTOPTBRB.1022
        set_character_flag = no_british_uprising
        clr_character_flag = british_supremacy
    }
}
#Character becomes independent and landless and recruits volunteers#
character_event = {
    id = RB.103
    desc = "EVTDESCRB.103"
    picture = "GFX_event_letter_frame_religion"

    is_triggered_only = yes

    immediate = {
        FROM = {
            any_demesne_title = {
                limit = { has_title_flag = surrendered_title }
                grant_title_no_opinion = ROOT
            }
        }
    }
    option = {
        name = "EVTOPTARB.1031"
        spawn_unit = {
            owner = FROM
            province = {
                ROOT = {
                    location
                }
            }
            home = {
                ROOT = {
                    location
                }
            }
            match_character = {
                k_england = {
                    holder_scope
                }
            }
            match_mult = 0.5
            reinforces = yes
            reinforce_rate_multiplier = 0.33
        }
    }
}

I'm not sure if the second event is triggering and the third definitely isn't.
 
Remove limit. It's not needed here (and indeed wrong), since it's already in a trigger context.
As a result, the second event still is not firing, but it should once it is gone.
 
Remove limit. It's not needed here (and indeed wrong), since it's already in a trigger context.
As a result, the second event still is not firing, but it should once it is gone.
Thanks very much for all your help. I see that you've replied to a lot of questions from newbies like myself and it's really great that you do. You're a true legend mate.
 
Remove limit. It's not needed here (and indeed wrong), since it's already in a trigger context.
As a result, the second event still is not firing, but it should once it is gone.
Also (last one I promise!!) my final event automatically triggers after 10 in-game days then and triggers twice when eventually fired by the previous event in the chain, first immediately after the last event then 7 days later. Do you know why that might be? Also, for some reason the options for the last event are no longer appearing. I'm not sure what that's about. Here's my updated file:

Code:
#Character grows restless under colonial control#
namespace = RB
character_event = {
    id = RB.100
    desc = EVTDESCRB.100
    picture = "GFX_evt_council"

    capable_only = yes
    prisoner = no
    min_age = 16

    mean_time_to_happen = {
        months = 1
    }
    
    trigger = {
        AND = {
            culture = welsh
            trait = ambitious
            martial >= 20
            learning >= 10
        }
        liege = {
            NOT = {
                culture = welsh
            }
        }
    }
    option = {
        name = EVTOPTARB.1001
        set_character_flag = british_supremacy
        opinion = {
            modifier = de_jure_liege
            who = liege
            years = 20
            inherit = yes
        }
        liege = {
            character_event = { id = RB.101 days = 7 }
        }
    }
    option = {
        name = EVTOPTARB.1001
        set_character_flag = no_uprising
    }
}
#Liege gets angry#
character_event = {
    id = RB.101
    desc = "EVTDESCRB.101"
    picture = "GFX_evt_council"

    is_triggered_only = yes

    trigger = {
        FROM = {
            has_character_flag = british_supremacy
           }
    }   
    option = {
        name = "EVTOPTARB.1011"
        FROM = {
            letter_event = { id = RB.102 days = 7 }
        }
    }
}
#Liege sends letter to player, player becomes landless#
letter_event = {
    id = RB.102
    desc = "EVTDESCRB.102"
    picture =
    border =

    capable_only = yes
    prisoner = no
    is_ruler = yes
    ai = no
    min_age = 16
    is_triggered_only = yes

    immediate = {
        any_demesne_title = {
            set_title_flag = surrendered_title
        }
    }
    option = {
        name = EVTOPTARB.1021
        create_title = {
            tier = KING
            landless = yes
            name = british_warband
            holder = ROOT
            culture = ROOT
        }
           character_event = { id = RB.103 days = 7 }
           set_character_flag = rebellious_briton
           ROOT = {
            any_demesne_title = {
                IF = {
                    limit = { has_title_flag = surrendered_title }
                    grant_title_no_opinion = FROM
                }
               }
        }
    }
    option = {
        name = EVTOPTARB.1022
        set_character_flag = no_british_uprising
        clr_character_flag = british_supremacy
    }
}
#Character recruits volunteers#
character_event = {
    id = RB.103
    desc = "EVTDESCRB.103"
    picture =

    is_triggered_only = yes

    option = {
        name = "EVTOPTARB.1031"
        spawn_unit = {
            owner = ROOT
            province = location
            home = location
            match_character = FROMFROM
            match_mult = 0.5
            can_toggle_looting = yes
            reinforces = yes
            reinforce_rate_multiplier = 0.33
        }
    }
    option = {
        name = "EVTOPTARB.1032"
        clr_character_flag = british_supremacy
        clr_character_flag = rebellious_briton
    }
}
 
Thanks very much for all your help. I see that you've replied to a lot of questions from newbies like myself and it's really great that you do. You're a true legend mate.

My pleasure. We all have to start somewhere and I remember what it was like at the start. You've made a good effort getting started, so I'm more than happy to help get things working.

Also (last one I promise!!) my final event automatically triggers after 10 in-game days then and triggers twice when eventually fired by the previous event in the chain, first immediately after the last event then 7 days later. Do you know why that might be? Also, for some reason the options for the last event are no longer appearing. I'm not sure what that's about. Here's my updated file:

Try filling these lines, since the game doesn't like = without something to parse on the right hand side:

Code:
picture =
border =