[RESOURCE] Events
I've been thinking about creating events, but I keep getting stuck as I'm unsure about what the game can do. So I've started to work on lists of what the eventsystem can do by semi-automatically parsing parts of the events which come with the game. I've started with what triggers I can see in a character_event.
Before I begin with the examples I need to talk a bit about event scope. Basically you will declare the starting event scope by your event's first line of either character_event or province_event. A character event means that all your triggers start working on the character who is being assessed for the event. So if your trigger says culture = English, then that means your event will check to ensure that the person getting the event is english. However the same line in a province event would mean you want the province getting the event to be English. Many triggers (like trait = ambitious) only work on people or provinces.
You can then change the scope by using some of the triggers below, for example to ensure that in a character event the character getting the event's mother is alive you would say "mother = { is_alive = yes }". However in a province event something similar can be done by saying "owner = { mother = { is_alive = yes } }". These can end up getting very complex to read if you don't think through every step of the way.
These are examples of various triggers which apply to a character:
Here are the triggers which transfer the scope to another character, or characters:
here are the triggers which transfer the scope to a province or provinces
These triggers transfer scope from a character to a title
And onto province events:
These triggers will work on provinces
This moves the scope to province(s)
These move the scope back to a character or characters
These move the scope to a title
Triggers can be run on titles with these commands
Here are some other generic triggers
Sometimes the examples make more sense in context so you should be able to search for most of these in the event files. However above I have combined some longer statements into one line.
If you notice I've missed something (or have come across something in a mod which isn't in the main game), please let me know and I'll add it.
I've been thinking about creating events, but I keep getting stuck as I'm unsure about what the game can do. So I've started to work on lists of what the eventsystem can do by semi-automatically parsing parts of the events which come with the game. I've started with what triggers I can see in a character_event.
Before I begin with the examples I need to talk a bit about event scope. Basically you will declare the starting event scope by your event's first line of either character_event or province_event. A character event means that all your triggers start working on the character who is being assessed for the event. So if your trigger says culture = English, then that means your event will check to ensure that the person getting the event is english. However the same line in a province event would mean you want the province getting the event to be English. Many triggers (like trait = ambitious) only work on people or provinces.
You can then change the scope by using some of the triggers below, for example to ensure that in a character event the character getting the event's mother is alive you would say "mother = { is_alive = yes }". However in a province event something similar can be done by saying "owner = { mother = { is_alive = yes } }". These can end up getting very complex to read if you don't think through every step of the way.
These are examples of various triggers which apply to a character:
age = 60
ai = no
at_location = ROOT
base_health = 4
can_change_religion = yes
check_variable = {which = test_variable value = 1.0 }
controls_religion = yes
culture = english
demesne_size = 1
diplomacy = 10
fertility = 0.3
had_character_flag = { flag = flag_promised_marriage days = 365 }
has_called_crusade = yes
has_character_flag = ugly_doll
has_character_modifier = holding_large_feast
has_epidemic = no
has_guardian = no
has_job_action = action_oversee_construction
has_job_title = job_treasurer
has_landed_title = e_golden_horde
has_landed_title = no
has_lover = yes
has_law = succ_feudal_elective
has_minor_title = title_regent
has_nickname = no
has_objective = no
has_objective = obj_become_chancellor
health = 6
imprisoned_days = 14
in_battle = yes
in_command = yes
in_siege = no
independent = no
intrigue = 9
is_abroad = no
is_alive = yes
is_betrothed = no
is_councillor = yes
is_female = no
is_feudal = yes
is_heretic = yes
is_ill = yes
is_liege_of = FROM
is_married = no
is_parent_religion = FROM
is_plot_active = no
is_pregnant = yes
is_priest = yes
is_primary_heir = yes
is_republic = yes
is_ruler = no
is_theocracy = yes
job_chancellor = { diplomacy = 10 }
job_marshal = { martial = 10 martial = ROOT }
job_spiritual = { learning = 10 }
job_spymaster = { has_job_action = no OR = { trait = ambitious trait = diligent } }
job_treasurer = { has_job_action = no }
learning = 10
lifestyle_traits = 1
martial = 9
month = 2
num_of_children = 3
num_of_claims = 1
num_of_friends = 1
num_of_king_titles = 1
num_of_plot_backers = 1
num_of_prisoners = 1
num_of_rivals = 1
num_of_vassals = 5
num_traits = 4
personality_traits = 6
piety = 50
prisoner = yes
realm_intrigue = 15
religion = FROM
religion = orthodox
religion_authority = 0.35
religion_group = christian
same_realm = fromfrom
scaled_wealth = 0.5
stewardship = 8
tier = count
trait = ambitious
treasury = 70
vassal_of = FROM
war = yes
wealth = 20
year = 1350
ai = no
at_location = ROOT
base_health = 4
can_change_religion = yes
check_variable = {which = test_variable value = 1.0 }
controls_religion = yes
culture = english
demesne_size = 1
diplomacy = 10
fertility = 0.3
had_character_flag = { flag = flag_promised_marriage days = 365 }
has_called_crusade = yes
has_character_flag = ugly_doll
has_character_modifier = holding_large_feast
has_epidemic = no
has_guardian = no
has_job_action = action_oversee_construction
has_job_title = job_treasurer
has_landed_title = e_golden_horde
has_landed_title = no
has_lover = yes
has_law = succ_feudal_elective
has_minor_title = title_regent
has_nickname = no
has_objective = no
has_objective = obj_become_chancellor
health = 6
imprisoned_days = 14
in_battle = yes
in_command = yes
in_siege = no
independent = no
intrigue = 9
is_abroad = no
is_alive = yes
is_betrothed = no
is_councillor = yes
is_female = no
is_feudal = yes
is_heretic = yes
is_ill = yes
is_liege_of = FROM
is_married = no
is_parent_religion = FROM
is_plot_active = no
is_pregnant = yes
is_priest = yes
is_primary_heir = yes
is_republic = yes
is_ruler = no
is_theocracy = yes
job_chancellor = { diplomacy = 10 }
job_marshal = { martial = 10 martial = ROOT }
job_spiritual = { learning = 10 }
job_spymaster = { has_job_action = no OR = { trait = ambitious trait = diligent } }
job_treasurer = { has_job_action = no }
learning = 10
lifestyle_traits = 1
martial = 9
month = 2
num_of_children = 3
num_of_claims = 1
num_of_friends = 1
num_of_king_titles = 1
num_of_plot_backers = 1
num_of_prisoners = 1
num_of_rivals = 1
num_of_vassals = 5
num_traits = 4
personality_traits = 6
piety = 50
prisoner = yes
realm_intrigue = 15
religion = FROM
religion = orthodox
religion_authority = 0.35
religion_group = christian
same_realm = fromfrom
scaled_wealth = 0.5
stewardship = 8
tier = count
trait = ambitious
treasury = 70
vassal_of = FROM
war = yes
wealth = 20
year = 1350
- any_backed_character = { OR = { has_objective = plot_gain_title has_objective = plot_succ_seniority has_objective = plot_succ_primogeniture has_objective = plot_succ_gavelkind has_objective = plot_succ_feudal_elective has_objective = plot_lower_crown_authority has_objective = plot_kill_character has_objective = plot_kill_spouse } is_plot_active = no NOT = { has_character_flag = event7040 } }
- any_child = { age = 13 is_abroad = no prisoner = no OR = { trait = craven trait = paranoid } }
- any_courtier = { age = 16 ai = yes family = no is_councillor = no }
- any_current_enemy = { culture = ROOT }
- any_dynasty_member = { NOT = { num_of_children = 1 } age = 35 demesne_size = 2 NOT = { has_law = succ_feudal_elective } is_feudal = yes NOT = { any_demesne_title = { claimed_by = root} } }
- any_friend = { has_character_flag = nofriends_friend }
- any_independent_ruler = { religion = catholic rightful_religious_head = ROOT trait = kinslayer piety = 100 reverse_opinion = { who = ROOT value = 0 } has_character_flag = kinslaying_offered }
- any_liege = { any_child = { is_female = no had_character_flag = { flag = impregnated_vassal_daughter days = 60 } } }
- any_playable_ruler = { religion = catholic rightful_religious_head = ROOT NOT = { has_character_flag = pope_dislikes_heathen_employed } any_courtier = { prisoner = no OR = { religion_group = muslim religion_group = pagan_group } OR = { has_job_title = job_chancellor has_job_title = job_marshal has_job_title = job_treasurer has_job_title = job_spymaster has_job_title = job_spiritual } } }
- any_realm_character = { has_character_flag= we_are_evil_assasinator prisoner = no }
- any_realm_lord = { is_theocracy = yes }
- any_rival = { is_female = no war = no in_command = no prisoner = no age = 16 same_liege = ROOT NOT = { age = 60 } NOT = { trait = wounded } NOT = { trait = maimed } NOT = { has_character_flag = duel_rival } }
- any_sibling = { is_female = no is_alive = yes NOT = { martial = 8 } }
- any_vassal = { age = 16 not = { opinion = { who = ROOT value = 0 } } }
- any_ward = { prisoner = no age = 6 NOT = { age = 16 } OR = { trait = shy trait = craven trait = kind trait = trusting } }
- enemy = { religion_group = pagan }
- father = { is_alive = yes }
- father_even_if_dead = { is_alive = no prestige = 100 }
- father_of_unborn = { spouse = { character = ROOT } }
- FROM = { is_alive = yes }
- guardian = { NOT = { religion = ROOT} }
- host = { religion = catholic }
- liege = { age = 16 trait = incapable }
- lover = { is_married = yes }
- mother = { is_alive = no }
- religion_head = { NOT = { reverse_opinion = { who = ROOT value = 10 } } NOT = { reverse_has_opinion_modifier = { who = ROOT modifier = show_true_humility } } }
- ROOT = { is_female = yes }
- spouse = { has_lover = no }
- spouse_even_if_dead = { is_alive = no is_female = yes }
- top_liege = { dynasty = root war = no }
765 = {...} # transfers to a province ID
any_demesne_province = { has_disease = yes }
any_realm_province = { religion = catholic }
b_athlith = { has_holder = no } #transfers to a barrony
capital_scope = { TECH_NOBLE_CUSTOMS = 4 }
crusade_target = { is_located_in = ROOT }
location = { is_heresy_of = ROOT } #character's location
any_demesne_province = { has_disease = yes }
any_realm_province = { religion = catholic }
b_athlith = { has_holder = no } #transfers to a barrony
capital_scope = { TECH_NOBLE_CUSTOMS = 4 }
crusade_target = { is_located_in = ROOT }
location = { is_heresy_of = ROOT } #character's location
primary_title = { higher_tier_than = COUNT }
primary_title = { tier = BARON }
primary_title = { title = d_teutonic_order }
primary_title = { title = e_golden_horde holder_scope = { religion = tengri_pagan NOT = { trait = zealous } } }
primary_title = { tier = BARON }
primary_title = { title = d_teutonic_order }
primary_title = { title = e_golden_horde holder_scope = { religion = tengri_pagan NOT = { trait = zealous } } }
And onto province events:
These triggers will work on provinces
controlled_by = e_rebels
culture = saxon
has_disease = yes
has_global_flag = possible_province_defection
has_higher_tech_than = ROOT
has_province_modifier = thieves_guild
is_capital = yes
is_heresy_of = ROOT
is_heretic = no
is_land = yes
is_located_in = ROOT
num_of_settlements = 7
province_id = 333
port = yes
religion = ROOT
religion_group = ROOT
revolt_risk = 2
TECH_NOBLE_CUSTOMS = 4 # I assume other tech can be used too.
culture = saxon
has_disease = yes
has_global_flag = possible_province_defection
has_higher_tech_than = ROOT
has_province_modifier = thieves_guild
is_capital = yes
is_heresy_of = ROOT
is_heretic = no
is_land = yes
is_located_in = ROOT
num_of_settlements = 7
province_id = 333
port = yes
religion = ROOT
religion_group = ROOT
revolt_risk = 2
TECH_NOBLE_CUSTOMS = 4 # I assume other tech can be used too.
any_neighbor_province = { is_land = yes }
any_province_lord = { is_feudal = yes }
any_province_character = {...}
owner = { demesne_efficiency = 1.0 prisoner = no }
any_province_character = {...}
owner = { demesne_efficiency = 1.0 prisoner = no }
duchy = { holder_scope = { top_liege = { ROOT = { owner = { top_liege = { character = REVPREVPREV } } } } } }
kingdom = { OR = { title = k_lithuania title = k_finland } }
kingdom = { OR = { title = k_lithuania title = k_finland } }
Triggers can be run on titles with these commands
higher_tier_than = COUNT
holder_scope = { top_liege = { ROOT = { owner = { top_liege = { character = PREVPREVPREV } } } } }
tier = BARON
title = d_teutonic_order
title = e_golden_horde
holder_scope = { top_liege = { ROOT = { owner = { top_liege = { character = PREVPREVPREV } } } } }
tier = BARON
title = d_teutonic_order
title = e_golden_horde
Here are some other generic triggers
had_global_flag = { flag = il_khanate_arrival days = 3650 }
has_global_flag = ck2_tutorial
is_title_active = d_teutonic_order
opinion = { who = top_liege value = 0 }
opinion_levy_raised_days = { who = liege days = 73 }
reverse_opinion = { who = FROM value = -75 }
siege = { is_attacker = yes }
OR = { trait = zealous trait = diligent trait = ambitious }
NOT = {trait = wounded}
AND = { trait = zealous trait = diligent trait = ambitious } #default is AND, so that rarely gets used except inside OR statements
has_global_flag = ck2_tutorial
is_title_active = d_teutonic_order
opinion = { who = top_liege value = 0 }
opinion_levy_raised_days = { who = liege days = 73 }
reverse_opinion = { who = FROM value = -75 }
siege = { is_attacker = yes }
OR = { trait = zealous trait = diligent trait = ambitious }
NOT = {trait = wounded}
AND = { trait = zealous trait = diligent trait = ambitious } #default is AND, so that rarely gets used except inside OR statements
Sometimes the examples make more sense in context so you should be able to search for most of these in the event files. However above I have combined some longer statements into one line.
If you notice I've missed something (or have come across something in a mod which isn't in the main game), please let me know and I'll add it.
Last edited:
- 4