Conditions

From Crusader Kings II Wiki
Jump to: navigation, search

Conditions or Triggers are used in scripting to restrict events and commands to correct targets.

They appear:

  • In condition blocks (trigger section of events, or equivalent: modifier, can_use_title, potential, allow, ...)
  • In the limit clause of command blocks
  • In scripted triggers, which can be used to group conditions into re-usable macro.
  • At the root of events for pre-triggers used to improve performances

List of conditions[edit]

Available conditions depend on the current scope type.

Condition Used in vanilla Used from scope Value type Description Example Category
adventurer title bool Checks adventurer flag of the title (title that gets destroyed whenever the holder gains another title or when the holder dies). adventurer = yes Titles
age character int The age of a character. Can be any whole number. Characters
age_diff character clause The age difference between two characters age_diff = {who = PREV years = 25} Characters
ai character bool
  • If yes, will only fire for ai characters.
  • If no, will only fire for the player(s).

Can also be used as an event pre-trigger.

Characters
ai_ambition character int Check an AI behavior modifier (based on traits) ai_ambition = 0 Characters
ai_greed X character int Characters
ai_honor character int Characters
ai_rationality X character int Characters
ai_zeal X character int Characters
always any bool Can be used to fail the conditions, without needing to comment/delete the code.

Also used to use scopes as boolean conditions, with pattern:

NOT = {
  some_scope = {
    always = yes
  }
}

If the scope matches nothing, then conditions fails.

Control
among_most_powerful_vassals character int Checks if the character is among the nth most powerful vassals of the realm. It compares the character's powerbase with that of all other direct vassals of the same liege. Also see relative_power. among_most_powerful_vassals = 5 Realm
attribute_diff character clause Checks that currently scoped character has at least value more points in the given attribute, than target character.
attribute_diff = {
  character = FROM
  attribute = martial
  value = 9
}
Characters
at_location character character/province Checks if two characters are in the same location any_courtier = { at_location = ROOT }

NOT = { at_location = 719 }

Provinces
base_health character double Checks for hidden attribute base health base_health = 6 Health
borders_lake province bool Province borders a lake borders_lake = yes Provinces
borders_major_river province bool Province borders a major river borders_major_river = yes Provinces
calc_true_if X any clause Returns true if at least amount of the triggers in it return true.[1] In this example at least 3 of the 5 triggers need to return true:
calc_true_if = {
  amount = 3
  culture = swedish
  religion = catholic
  is_female = no
  is_adult = yes
  age = 50
}
Control
can_be_given_away title bool The title is not occupied, has no holdings being sieged, or contested in war. any_demesne_title = { can_be_given_away = yes } Titles
can_change_religion character bool can_change_religion = yes Religion
can_call_crusade character bool Crusades have been unlocked can_call_crusade = yes Religion
can_copy_personality_trait_from character character ROOT = { can_copy_personality_trait_from = PREV } Traits
can_have_more_leadership_traits character bool Checks the limit of leadership trait based on martial education trait (leadership_traits = N) Traits
can_hold_title character jobTitle/minorTitle Checks the conditions for the specified councillor position or minor title. can_hold_title = job_marshal

can_hold_title = title_commander

Characters
can_marry character bool/character Checks that character has no traits with cannot_marry = yes Marriage
can_swap_job_title character character Checks if a character can get the job position of another character
job_chancellor = {
	NOT = { character = ROOT }
	can_swap_job_title = ROOT
}
character character character/title/int Checks if 2 characters are the same.
any_dynasty_member = { 
  limit = { NOT = { character = ROOT } }
}

character = 1234

Characters
check_variable character/province clause Used in conjunction with change_variable command.
check_variable = { which = "bob_saget" value = 4.5 }
Control
claimed_by title character any_demesne_title = { claimed_by = ROOT } Claims
clan character,title bool Whether character is the head of a nomadic clan, or title is a nomadic clan.
any_vassal = {
	clan = yes
}
Clans
clan_opinion character clause clan_opinion = { who = FROM value = 0 } Opinion
combat_rating character int Checks combat rating modifier combat_rating = 0 Character
combat_rating_diff character clause Tests combat rating modifier difference with another character
combat_rating_diff = {
  character = FROM
  value = 3
}
Character
completely_controls character title Character controls (personally or via a vassal) all the baronies under specified title.

Notes:

  • the title itself doesn't need to exist.
  • completely_controls is true if title name is invalid.
Rulers
completely_controls_region character region Similar to completely_controls completely_controls_region = world_steppe Rulers
conquest_culture title bool/character If yes, only fires if conquest_culture is set (?). Certain CBs set Conquest_Culture (used for cultural conversion events) Culture
continent X province continent Replaced by more flexible region trigger Provinces
controlled_by title/province character/title Checks if province/holding is occupied (war) by another character/realm any_demesne_province = { controlled_by = ROOT } Wars
controls_religion character/title bool If yes, only picks characters who are the head of their religion (holder of a title with a flag controls_religion = <religion>)
religion = catholic
controls_religion = yes
Religion
count int Number of elements matched by a scope. Since patch 2.3 works with all any_ scopes.
any_spouse_even_if_dead = { count = 3 }
Control
culture character/province/title culture/character/province/title Checks if the character has this specific culture Culture
culture_group character/province/title cultureGroup/character/province/title Checks if the character is part of this culture group Culture
defending_against_claimant character clause defending_against_claimant = { character = PREVPREV title = ROOT } Wars
demesne_efficiency X character double Rulers
demesne_garrison_size character int demesne_garrison_size = 500 Warfare
demesne_size character int Checks if the character has a minimum of this demesne size Rulers
de_facto_liege character/title/province character/title ROOT = { de_facto_liege = ROOT } Vassalage
de_jure_liege character/title/province character/title de_jure_liege = e_rajastan Vassalage
de_jure_liege_or_above character/title/province character/title Vassalage
de_jure_vassal_or_below character/title character/title crusade_target = { de_jure_vassal_or_below = FROM } Vassalage
death_reason character deathReason death_reason = death_murder Health
decadence character double decadence = 90 Characters
dynasty character character/int The character's dynasty, indexed by an integer value. Lowborn (no dynasty) match none value. dynasty = none

dynasty = ROOT

Family
difficulty X any int/string The game difficulty Control
diplomacy character int The character's Diplomacy attribute. For state value, see realm_diplomacy Characters
diplomatic_immunity character bool Checks if character has the diplomatic_immunity flag, protecting him from hostile actions. Characters
dislike_tribal_organization character/title bool Checks for dislike_tribal_organization religion flag dislike_tribal_organization = no Religion
distance character/province clause Determines the minimum distance from the scope. If used with NOT, it becomes maximum distance. Distances are pixels within the main map images & positions.txt distance = { who = ROOT value = 100 } Provinces
distance_from_realm character clause distance_from_realm = { who = FROM value = 20 } Provinces
dynasty_realm_power character double top_liege = { dynasty_realm_power = 0.25 } Family
excommunicated_for character character top_liege = { excommunicated_for = ROOT } Religion
faction_exists X character clause faction_exists = { faction = xxx title = xxx thirdparty = xxx} Factions
faction_power character clause faction_power = { faction = faction_succ_seniority power = 1.0 } Factions
family character character/title/bool any_vassal = { family = ROOT } Family
father_of_unborn_known character bool Checks if a pregnant woman's unborn child has a known father. Family
fertility character double The character's fertility value. In-game, can only be seen through the "charinfo" console command. Characters
flank_has_leader battle bool Used in combat tactics Wars
from_ruler_dynasty character bool from_ruler_dynasty = yes Family
gold X character int How much money a character has. Money
government character government Check government type of a character. For checking government groups, see is_feudal, is_republic, etc. government = nomadic_government Government
graphical_culture character culturegfx A character's graphical culture. This is different from the effect set_graphical_culture which takes a culture, not a culturegfx. In-game, can only be seen through the "charinfo" console command. Warning: checking against an invalid culturegfx will cause a CTD. graphical_culture = norsegfx Characters
had_character_flag character clause Note: months and years do not work as parameters, only days does. had_character_flag = { flag = money_from_the_pope days = 730 } Control
had_dynasty_flag X character clause Note: months and years do not work as parameters, only days does. Control
had_global_flag any clause Note: months and years do not work as parameters, only days does. had_global_flag = { flag = crusade_called days = 180 } Control
had_province_flag province clause Note: months and years do not work as parameters, only days does. had_province_flag = { flag = aztec_explorers days = 730 } Control
had_title_flag X title clause Note: months and years do not work as parameters, only days does. had_title_flag = { flag = xxx days = 730 } Control
has_ambition character bool/objective has_ambition = obj_improve_martial Objectives
has_any_opinion_modifier character modifier Similar to has_opinion_modifier. has_any_opinion_modifier = opinion_seducing_concubine Modifiers
has_artifact character artifact has_artifact = necronomicon Artifacts
has_autocephaly character bool Checks for religion autocephaly = yes has_autocephaly = yes Religion
has_blood_oath_with character character has_blood_oath_with = ROOT Clans
has_building title,province building Checks if a holding has the specified building (built or under construction).
family_palace = {
  has_building = fp_mansion_4
}
Holdings
has_called_crusade character bool Religion
has_capital X province bool Province
has_character_flag character string Checks if a character has a specified flag.
Note: "flags" in CKII scripting are not pre-determined or stored anywhere, they are dynamically created in the script. A mistyped flag will not be caught by the Validator, as there are no "invalid" flags.
Control
has_character_modifier character modifier Checks if the character has a modifier has_character_modifier = illumination Modifiers
has_claim character title has_claim = k_papal_state Claims
has_council character bool liege = { has_council = yes } Council
has_concubinage character bool Checks if religion flag max_consorts > 0 has_concubinage = yes Religion
has_crown_law_title title bool Used to check crown laws for a specified title. Is not a condition itself though, it must be used as a scope to check crown laws by category (succession, for instance). Government
has_de_jure_pretension title character any_demesne_title = { has_de_jure_pretension = ROOT } Rulers
has_disease character/province bool
any_courtier = {
  has_disease = yes
}
Health
has_dlc any string Checks if the user has a specified DLC. Values: "The Sword of Islam", "Legacy of Rome", "Sunset Invasion", "The Republic", "The Old Gods", "Sons of Abraham", "Rajas of India", "Charlemagne", "Way of Life", "Horse Lords", "Zeus" or "Conclave" (both are equivalent), "Reapers", or "Mystics". has_dlc = "Charlemagne" Control
has_dynasty_flag character flag has_dynasty_flag = strange_chest Control
has_earmarked_regiments character flag Set via spawn_unit command and earmark parameter. has_earmarked_regiments = conscripted_merchant_ships Control
has_earmarked_regiments_not_raiding character flag Check for earmark & raiding has_earmarked_regiments_not_raiding = tribal_organize_raid Control
has_embargo character character NOT = { has_embargo = FROM } Wars
has_empty_holding province bool
any_demesne_province = {
  has_empty_holding = yes
}
Provinces
has_epidemic character bool Checks for a trait with is_epidemic = yes
any_child = {
  has_epidemic = yes
}
Health
has_feud_with character character has_feud_with = ROOT Clans
has_focus character focus Checks for focuses has_focus = focus_war Objectives
has_game_started any bool has_game_started = yes Control
has_global_flag any flag has_global_flag = found_the_holy_grail Control
has_guardian character bool
any_child = {
  has_guardian = no
}
Guardianship
has_heresies character/province bool Religion
has_higher_tech_than province province/character location = { has_higher_tech_than = ROOT } Provinces
has_holder title bool
any_claim = {
  has_holder = yes
}
Titles
has_holding_modifier title modifier Checks if the holding has the given holding modifier
any_province_holding = {
   has_holding_modifier = recently_burnt_the_land
}
Modifiers
has_horde_culture character bool Check for hord flag from culture definition Culture
has_instances_of_character_modifier X character modifier Checks if the character has a amount of times the given character modifier
has_instances_of_character_modifier = { modifier = x amount = y }
Modifiers
has_instances_of_holding_modifier X title modifier Checks if the holding has a amount of times the given holding modifier
has_instances_of_holding_modifier = { modifier = x amount = y }
Modifiers
has_instances_of_province_modifier X province modifier Checks if the province has a amount of times the given province modifier
has_instances_of_province_modifier = { modifier = x amount = y }
Modifiers
has_job_action character bool/jobAction has_job_action = action_improve_relations Jobs
has_job_title character jobTitle/bool Checks that character is a councillor. has_job_title = job_chancellor Jobs
has_landed_title character bool/title has_landed_title = k_jerusalem Titles
has_law character/title law has_law = succ_feudal_elective

has_law = agnatic_succession

Government
has_liege_enforced_peace character bool Prevents wars, also see will_liege_enforce_peace. has_liege_enforced_peace = no Realm
has_lover character bool Yes if the character has a lover Marriage
has_mercenary_band title bool Checks if character has already created a mercenary band. has_mercenary_band = yes
has_mercenary_maintenance_modifier title modifier Checks for a static modifier added via set_mercenary_maintenance_modifier on scoped mercenary tile. has_mercenary_maintenance_modifier = maintaining_mercenary_band Modifiers
has_minor_title character minorTitle Yes if the character has a minor title has_minor_title = title_court_jester Characters
has_newly_acquired_titles character bool Character holds titles he just recently acquired Titles
has_nickname character bool/nickname Can be used to check for a specific nickname, or the fact of having a nickname. has_nickname = nick_the_bastard

has_nickname = no

Characters
has_non_aggression_pact_with character character Checks if a character a non-aggression pact with another character. has_non_aggression_pact_with = ROOT
has_objective X character objective Deprecated, replaced by has_ambition/has_plot Objectives
has_opinion_modifier character clause Checks if the scoped character has the given opinion modifier towards 'who' character
has_opinion_modifier = { who = ROOT  modifier = i_attempted_murder }
Opinion
has_overseas_holdings character bool Rulers
has_owner province bool
any_neighbor_province = {
  has_owner = yes
}
Rulers
has_plot character plot
any_courtier = {
  has_plot = plot_kill_character
}
Objectives
has_polygamy character bool Checks if religion flag max_wives > 0 has_polygamy = yes Religion
has_position character attitude/character Checks the voting attitude of a councillor, or if same as another character. Also see is_voter. Not to be confused with has_minor_title or has_job_title. has_position = loyalist Council
has_province_flag province flag has_province_flag = heresy_in_province Control
has_province_modifier province modifier Checks if the province has the given province modifier
any_realm_province = {
  has_province_modifier = heretic_stronghold
}
Modifiers
has_raised_levies character character Whether character has some personal levies (vassal levies do not count)
liege = {
  has_raised_levies = ROOT
}
Wars
has_raised_standing_troops title bool
primary_title = {
	NOT = { has_raised_standing_troops = yes }
}
Wars
has_regent character bool liege = { has_regent = no } Titles
has_regiments character bool has_regiments = no Wars
has_settlement_construction province bool Checks if a holding is under construction in the province
NOR = {
	num_of_settlements = 5
	AND = {
		num_of_settlements = 4
		has_settlement_construction = yes
	}
}
Holdings
has_siege title(holding),province bool Whether holding or province is under siege. has_siege = no Wars
has_strong_claim character title Claims
has_terrain_specialization X character terrain/any/bool Checks for traits with terrain command modifiers Traits
has_title_flag X title flag Control
has_trade_post province/title? bool Provinces
has_truce X character character Wars
has_weak_claim character title Claims
health character int A character's health value. In-game, can only be seen through the "charinfo" console command. Health
health_traits character int Number of traits with is_health = yes health_traits = 1 Traits
held_title_rating character character held_title_rating = FROM Titles
higher_real_tier_than X character character/tier Same as higher_tier_than but ignores temporary titles Tier
higher_tier_than character/title character/tier/title primary_title = { higher_tier_than = BARON } Tier
holding_diff character clause
holding_diff = {
	first_type = city
	first_count_vassals = yes
	second_type = none
	value = 1.5
}
Holdings
holding_type title string city / temple / castle / tribal / nomad / family_palace Holdings
holds_favor_on character character Checks if a character holds a favor toward another character. The reverse condition is owes_favor_to. liege = { owes_favor_to = ROOT } holds_favor_on = ROOT
holy_order character/title bool primary_title = { holy_order = no } Religion
imprisoned_days character int any_courtier = { imprisoned_days = 100 } Characters
independent character/title bool Rulers
infamy X character double infamy = 12.5 Wars
intrigue character int A character's Intrigue stat. Characters
in_battle character bool Wars
in_command character bool Character is leading troops. Characters
in_faction character bool/faction in_faction = faction_independence Factions
in_revolt character bool liege = { in_revolt = no } Titles
in_siege character bool in_siege = no Wars
is_abroad character bool Valid if character is 'abroad' (not at liege's court) Characters
is_adult character bool Checks if the character is an adult. Characters
is_alive character bool If yes, will only affect alive characters Health
is_allied_with X character character Expensive calculation, use with care[2] Wars
is_allowed_holding_type title(holding) character Checks if holding type is allowed by the government of specified character is_allowed_holding_type = FROM Government
is_allowed_to_loot character bool Character can raid. is_allowed_to_loot = yes Rulers
is_at_sea character bool Characters
is_attacker siege bool siege = { is_attacker = yes } Wars
is_betrothed character bool If yes, will only affect betrothed characters Marriage
is_capital province/title bool If yes, will only affect the capital HOLDING Titles
is_child_of character character Checks if the scope is a child of another character Family
is_close_relative character character checks if the scope is a close relative of another character Family
is_conquered title bool primary_title = { is_conquered = yes } Titles
is_consort character bool/character Checks if THIS is a concubine, or a concubine or the specified character father_of_unborn = { is_consort = ROOT} Marriage
is_contested title bool If title is already being contested in some form of Claim or Succession War Titles
is_council_content character bool Checks whether the council is content or not. liege = { is_council_content = no } Council
is_councillor character bool Checks if character has a councillor job (chancellor, ...) any_courtier = { is_councillor = yes } Jobs
is_crown_law_title title bool Checks for titles that can have crown laws. is_crown_law_title = yes Titles
is_decision_allowed

is_law_allowed is_targetted_decision_allowed is_title_decision_allowed is_settlement_decision_allowed is_trade_post_decision_allowed is_fort_decision_allowed

? decision Checks if current scope matches the allow block of the given decision Control
is_decision_potential

is_law_potential is_targetted_decision_potential is_title_decision_potential is_settlement_decision_potential is_trade_post_decision_potential is_fort_decision_potential

? decision Checks if current scope matches the potential block of the given decision Control
is_dying character bool Checks if character is about to die. Used for on_actions called just when character dies, such as on_chronicle_owner_change. Characters
is_father character character FROM = { is_father = PREV } Family
is_father_real_father character bool Case of illegitimate bastards. Family
is_female character bool If yes, will only affect female characters. Can also be used as an event pre-trigger. Characters
is_feudal character/title bool Checks if government is part of feudal_governments group. is_feudal = yes Government
is_foe character character Checks if a character is_rival or has an opinion modifier with crime = yes toward another character is_foe = ROOT Relations
is_former_lover character bool is_former_lover = ROOT Marriage
is_friend character character Checks if this character is a friend of the given character is_friend = ROOT Relations
is_government_potential character government Checks if a character matches the potential block of another government. NOT = { is_government_potential = merchant_republic_government } Government
is_guardian character bool/character father = { is_guardian = no } Guardianship
is_heir character bool/character Checks if a character is first in the succession line of a title. any_child = { is_heir = no } Character
is_heresy_of character/province character/province/title/religion any_rival = { is_heresy_of = ROOT } Religion
is_heretic character/province bool Religion
is_holy_site title character Checks if a barony is a holy site of the religion of specified character
any_realm_title = {
  is_holy_site = ROOT
}
Religion
is_ill character bool Checks for traits with is_illness = yes Health
is_ironman character bool Used in achievements.txt Control
is_island X province bool Checks if the province exists in island_region.txt. is_island = yes Provinces
is_land province bool Checks that province is not a sea province Provinces
is_landed character bool Checks that character owns a landed title. Note: landed characters are also rulers (is_ruler = true). Characters
is_landless_type_title title bool Titles
is_liege_of character character/title/province vassal/courtier = { is_liege_or_above = liege } would evaluate to true. host = { is_liege_of = ROOT } Vassalage
is_liege_or_above character/province character/title/province owner = { is_liege_or_above = FROM } Vassalage
is_located_in title character/title crusade_target = { is_located_in = ROOT } Provinces
is_looting X character bool Wars
is_looting_in X character province Wars
is_lover character bool/character Checks if this character is a lover of the given character is_lover = ROOT Marriage
is_lowborn X character bool Warning: works backward, setting it to no will pick out characters that are actually lowborn. Equivalent to dynasty = none is_lowborn = no Characters
is_main_spouse character bool If yes, is primary wife. (Although written gender neutral, there are no multiple-husband polygamies in CK2.) Marriage
is_marriage_adult character bool Marriage
is_married character bool/character Yes, will only affect married characters Marriage
is_married_matrilineally X character bool Marriage
is_merchant_republic character/title bool Checks if character is the doge of a merchant republic or if title is a merchant republic. Government
is_mother character character is_mother = ROOT Family
is_multiplayer_host_character X character bool Whether scoped character is the host in a multiplayer game. is_multiplayer_host_character = yes Control
is_nomadic character bool Checks if character government is part of nomadic_governments group. is_nomadic = yes Government
is_occupied title bool any_demesne_title = { is_occupied = no} Wars
is_older_than character character any_sibling = { is_older_than = ROOT } Characters
is_opposite_sex character character is_opposite_sex = ROOT Characters
is_parent_religion character character/province/title top_liege = { is_parent_religion = ROOT } Religion
is_powerful_vassal character bool Checks if a character wants a seat on the council. Also see among_most_powerful_vassals. is_powerful_vassal Realm
is_patrician character bool Checks if a character is the head of a Merchant Republic patrician family. Can also be used as an event pre-trigger Government
is_playable character bool Only affects playable characters (depending on the loaded DLCs) Characters
is_plot_active character bool In conjunction with leads_faction Objectives
is_plot_target_of character character any_realm_lord = { is_plot_target_of = ROOT } Objectives
is_preferred_holding_type title character Preferred holding type of character, based on its government.
defacto_liege_title = {
	is_preferred_holding_type = FROM
}
Rulers
is_pregnant character bool Characters
is_pretender character/title bool In title scope, checks vs ROOT character.
FROM = { is_pretender = yes }
Titles
is_priest character bool Checks if character is either a Court Chaplain or landed with the Theocracy government type Characters
is_primary_heir character bool/character Heir to primary title (regardless if same dynasty or not) FROM = { is_primary_heir = ROOT } Titles
is_primary_holder_title title bool Rulers
is_primary_holder_title_tier title bool Tier
is_primary_type_title title bool Checks the flag primary of the title, for titles that cannot be held as secondary title. This covers mercenaries, the Pope, Holy Orders, etc. Titles
is_primary_war_attacker character bool Wars
is_primary_war_defender character bool any_friend = { is_primary_war_defender = yes } Wars
is_recent_grant title bool is_recent_grant = no Titles
is_reformed_religion character/province bool/character Checks if religion of character or province is a reformed religion. Religion
is_reincarnated character bool any_sibling = { is_reincarnated = yes } Family
is_republic character/title bool Checks if government is part of republic_governments group. is_republic = yes Government
is_rival character character Relations
is_ruler character bool Yes, will only affect characters who have a title (who are a ruler). Note that the character may not necessarily be landed (is_landed = false) in case of mercenaries, holy orders, or adventurers. Rulers
is_seafarer character bool Checks if either the culture or religion have the seafarer flag set. is_seafarer = yes Characters
is_theocracy character/title bool Checks if government is part of theocracy_governments group. is_theocracy = yes Government
is_title_active any title Indicates whether the landed title has a holder (landed titles deactivate if they have no holder). Landless titles (landless = yes) remain active once activated, which is done via the activate_title command. is_title_active = d_knights_templar Titles
is_titular title bool any_demesne_title = { is_titular = no } Titles
is_treasurer character bool Equivalent to has_job_title = job_treasurer Jobs
is_tribal character/title(holding) bool Checks if government is part of tribal_governments group. is_tribal = yes Government
is_tribal_type_title title bool Titles
is_tributary character bool Character is tributary to a suzerain. Note: to check the suzerain, see pays_tribute_to. is_tributary = yes Vassalage
is_valid_attraction character character any_courtier = { is_valid_attraction = ROOT } Marriage
is_valid_romance_target character character any_courtier = { is_valid_romance_target = ROOT } Marriage
is_valid_viking_invasion_target title character Checks that FROM holds the right amount of territory in the kingdom Wars
is_variable_equal X character/province clause Checks if a variable has the exact value, instead of standard >= check. See variables. is_variable_equal = { which = xxx value = xxx } Control
is_vassal_or_below character character is_vassal_or_below = ROOT Vassalage
is_vice_royalty title bool Checks for viceroyalty flag on title is_vice_royalty = no Titles
is_voter character bool Checks if character votes on the council (i.e. holds a position or title with the flag is_voter = yes). Also see has_position. any_vassal = { is_voter = yes } Council
is_winter province bool location = { is_winter = yes } Provinces
is_within_diplo_range character character is_within_diplo_range = FROM Relations
leads_faction character faction leads_faction = faction_succ_seniority Factions
learning character int A character's learning attribute. For state value, see realm_learning Characters
lifestyle_traits character int Number of traits with lifestyle = yes, normally 0 or 1 in vanilla. NOT = { lifestyle_traits = 1 } Traits
likes_better_than character clause Equivalent to opinion_diff with value = 0. ROOT = { likes_better_than = { who = PREV than = PREVPREV} } Opinion
loot unit? int Used in unit_event achievement. loot = 1000 Wars
lower_real_tier_than X character character/tier Same as lower_tier_than but ignores temporary titles Tier
lower_tier_than character/title character/tier Yes, will only affect characters who are of a lower tier Tier
martial character int/character A character's Martial attribute. For state value, see realm_martial Characters
max_manpower character int max_manpower = 500 Clans
mercenary character bool Whether character has a landed title flagged as mercenary.

Note: does not work in title scope, consider using scope any_mercenary_band

Titles
mercenary_siphon_factor title double Percentage of payment factor [?] mercenary_siphon_factor = 0.05 Titles
month any int In-game month number. Ranges from 0 (January) to 11 (December) Control
monthly_income X character double Money
multiplayer any bool Whether the game is multiplayer vs single player. Control
num_culture_realm_provs character clause Number of provinces with given culture
num_culture_realm_provs = {
 value = 8
 culture = swedish
}
Culture
num_fitting_characters_for_title title int Checks how many characters in ones court that would fit for a specific title Title
num_of_baron_titles X character int Titles
num_of_buildings title int any_demesne_title = { tier = baron num_of_buildings = 1} Holdings
num_of_children character int Family
num_of_claims character int Claims
num_of_consorts character int Marriage
num_of_count_titles character int Titles
num_of_count_titles_in_realm character int num_of_count_titles_in_realm = 35 Titles
num_of_duke_titles character int Titles
num_of_dynasty_members character int num_of_dynasty_members = 3 # Does not trigger for tiny dynasties Family
num_of_emperor_titles character int Titles
num_of_empty_holdings X province int Note: settlements under construction, do not count as empty. Provinces
num_of_extra_landed_titles character int liege = { num_of_extra_landed_titles = 1 } Titles
num_of_faction_backers character clause Checks the number of supporters for a given faction
num_of_faction_backers = {
	faction = faction_increase_council_power
	value = 0
}
Factions
num_of_feuds character int num_of_feuds = 3 Clans
num_of_friends character int Relations
num_of_government_vassals character clause
num_of_government_vassals = {
	government = merchant_republic_government
	value = 1
}
Governments
num_of_holy_sites character int Number of holy sites controlled by the religion Religion
num_of_king_titles character int Titles
num_of_lovers character int NOT = { num_of_lovers = 5 } Marriage
num_of_max_settlements province int Checks the current number of constructed or constructible holding slots in a province NOT = { num_of_max_settlements = 7 } Provinces
num_of_plot_backers character int liege = { num_of_plot_backers = 8} Objectives
num_of_prisoners character int liege = { num_of_prisoners = 1 } Characters
num_of_realm_counties character clause Scoped character controls at least N counties from specified title num_of_realm_counties = { value = 6 title = PREV } Rulers
num_of_rivals character int Relations
num_of_settlements province int Number of baronies the province has (maximum 7) Provinces
num_of_subrealm_castle

num_of_subrealm_cities

character int NOT = { num_of_subrealm_cities = 20 }

NOT = { num_of_subrealm_castles = 10 }

Rulers
num_of_spouses X character int Marriage
num_of_titles character int Number of landed titles Titles
num_of_trade_posts character int Number of trade posts Rulers
num_of_trade_post_diff character clause Difference of trade posts between 2 characters
num_of_trade_post_diff = {
  character = ROOT
  value = 10
}
Rulers
num_of_traits character int Number of traits Traits
num_of_unique_dynasty_vassals character int Number of vassals of different dynasties (excluding the dynasty of scoped character). Vassalage
num_of_vassals character int Number of direct vassals Vassalage
num_title_realm_provs title clause Number of counties in ROOT's realm.
num_title_realm_provs = {
  who = ROOT
  value = 6
}
Rulers
num_traits character int Duplicate of num_of_traits Traits
opinion character clause Checks if the opinion is at least this value opinion = { who = ROOT value = 25 } Opinion
opinion_diff character clause True if first target character has a higher opinion of the currently scoped character than second target character by at least value points.

as_if_liege = yes also applies the liege-vassal opinion modifiers (vassal_opinion, etc.) and is used in factions, to decide if a character would like someone better as liege than another one (and therefore would join a faction seeking to replace him).

opinion_diff = { first = LIEGE second = FROM value = 25 as_if_liege = yes } Opinion
opinion_levy_raised_days X character clause opinion_levy_raised_days = { who = ROOT days = 30 } Opinion
overlord_of character character holder_scope = { overlord_of = FROM } Rulers
over_max_demesne_size character int over_max_demesne_size = 4 Rulers
over_vassal_limit character int over_vassal_limit = 6 Rulers
owes_favor_to character character Checks if a character owes a favor to another character. The reverse condition is holds_favor_on. liege = { owes_favor_to = ROOT }
owns character province owns = 333 # Rome Rulers
owns_mercenary_units character bool Checks if character owns mercenary units owns_mercenary_units = yes
pacifist character bool pacifist = yes Characters
pays_tribute_to character character pays_tribute_to = ROOT Characters
personal_opinion character clause Similar to opinion, but does not take state diplomacy, laws or any other such state concerns into account
personal_opinion = { who = FROM value = 0}
Opinion
personal_opinion_diff character clause Similar to opinion_diff, but does not take state diplomacy, laws or any other such state concerns into account
personal_opinion_diff = { first = ROOT  second = liege  value = 5}
Opinion
personality_traits character int Number of traits with personality = yes NOT = { personality_traits = 5 } Traits
piety character int The amount of piety a character has. Characters
plot_is_known_by character character Tests if a plot is known by another character plot_is_known_by = ROOT Objectives
plot_power character double Typically ranges from 0.5 to 4.0 in vanilla Objectives
plot_power_contribution character clause plot_power_contribution = {plotter = ROOT power = 0.025} Objectives
population character int population = 10000 Clans
population_and_manpower character int population_and_manpower = 10000 Clans
population_factor character double Percentage of maximum population. population_factor = 0.9 # 90% of max Clans
port province bool Checks for coastal province Provinces
preparing_invasion character bool Wars
prestige character int The amount of prestige a character has. Characters
prisoner character bool If no, can't be applied to imprisoned characters. Can also be used as an event pre-trigger. Characters
province province province Checks currently scoped province to be the same as another.
ROOT = {
  capital_scope = {
    province = PREVPREV
  }
}
Provinces
province_id province int Only applies to the matching province ID Provinces
race character culture/character Same as culture condition. Checks if a character's culture matches that of a specified culture or character. This is different from graphical_culure, i.e when comparing two cultures that have the same culturegfx, race still evaluates to false. race = horse Character
real_month_of_year any int Checks for actual IRL month (contrary to month which checks it in-game). Ranges from 0 (January) to 11 (December) real_month_of_year = 11 Control
real_tier X character/title character/title/tier Same as tier but ignores temporary titles Tier
realm_diplomacy character int State diplomacy. For personal attribute, see diplomacy. Rulers
realm_intrigue character int State intrigue. For personal attribute, see intrigue. Rulers
realm_learning character int State learning. For personal attribute, see learning. Rulers
realm_levies character int NOT = { realm_levies = 6000 } Warfare
realm_levy_diff character clause realm_levy_diff = { who = ROOT value = 3000 } Warfare
realm_martial character int State martial. For personal attribute, see martial. Rulers
realm_size character int Total number of landed titles in the realm realm_size = 180 Rulers
realm_stewardship character int State stewardship. For personal attribute, see stewardship. Rulers
rebel character/title bool Characters
relative_income_to_liege character float Compares the income of character and of his liege relative_income_to_liege = 0.5 Money
relative_power character clause Check that currently scoped character has at least power percentage of who's power. relative_power = { who = FROM power = 4.0 } Rulers
relative_power_including_allies_attacker character clause Check that currently scoped character (plus its potential allies in an offensive war) have at least power percentage of who's power.
relative_power_including_allies_attacker = { 
	who = FROMFROM # Defender
	power = 0.8
}
Rulers
relative_power_including_allies_defender character clause Check that currently scoped character (plus its potential allies in a defensive war) have at least power percentage of who's power.
relative_power_including_allies_defender = {
	who = FROM # Attacker
	power = 2
}
Rulers
relative_power_to_liege character double any_realm_lord = { relative_power_to_liege = 0.1 } Vassalage
religion character religion Checks if character has the given religion Religion
religion_allows_female_temple_holders character bool Checks religion flag allows_female_temple_holders religion_allows_female_temple_holders = yes Religion
religion_authority character/province double Ranges from 0 to 1 Religion
religion_group character religion Checks if character's religion belongs to the given religion group Religion
region title,province region Checks if scope belongs to a geographical region. region = world_africa_east Province
republic_total_num_of_trade_posts character int republic_total_num_of_trade_posts = 80
reverse_clan_opinion character clause
reverse_clan_opinion = {
	who = FROM
	value = 25
}
Opinion
reverse_has_opinion_modifier character clause Checks if 'who' character has the given opinion modifier towards scoped character reverse_has_opinion_modifier = { who = ROOT modifier = opinion_supported_pope } Opinion
reverse_has_truce character character liege = { reverse_has_truce = ROOT } Wars
reverse_opinion character/new clause new can be used to reference the new_character scope reverse_opinion = { who = ROOT value = 0} Opinion
reverse_personal_opinion character clause Similar to reverse_opinion, but does not take state diplomacy, laws or any other such state concerns into account reverse_personal_opinion = { who = FROM value = 50} Opinion
reverse_personal_opinion_diff X character clause Does not take state diplomacy, laws or any other such state concerns into account Opinion
revolt_risk province double revolt_risk = 0.02 Provinces
rightful_religious_head character character any_independent_ruler = { rightful_religious_head = ROOT } Religion
risks_minor_clan_rising character bool risks_minor_clan_rising = yes Clans
ruled_years character/title int Rulers
same_guardian character character any_courtier = { same_guardian = ROOT } Guardianship
same_liege character character any_realm_lord = { same_liege = ROOT } Vassalage
same_realm character/title character
any_neighbor_province = {
  owner = {
    same_realm = ROOT
  }
}
Rulers
same_sex character character Checks if two characters have same sex. same_sex = FROM Characters
scaled_wealth character double Check character has the given wealth based on percentage of yearly income. scaled_wealth = 0.2 Money
score character int Current score of the player score = 100000
sibling character character Family
start_date any date Check the initial start date of current game. start_date = 1066.9.15 Control
stewardship character int A character's Stewardship attribute. For state value, see realm_stewardship Characters
technology_can_spread province bool Check whether technology can spread in the province. technology_can_spread = yes Province
temporary title bool Check if title is temporary one (revolt, claimant adventurer, ...) Titles
terrain province terrain Values: forest, hills, mountain, plains, farmlands, steppe, desert, jungle, arctic Provinces
their_opinion character clause their_opinion = { who = ROOT value = 25 } Opinion
tier character/title string Values: baron, count, duke, king, emperor Tier
title character/title title/province title = d_mesopotamia Titles
total_claims character clause total_claims = { who = FROM strong = yes value = 2} Claims
total_years_played Any int Number of years since beginning of current game total_years_played = 200 Control
trade_post_has_building province building Checks if a trade post has the specified building. trade_post_has_building = tr_silk_road_3 Buildings
trade_post_has_any_building X province building Checks if a trade post has at least 1 building. Buildings
trade_route province trade route Checks if a province is on the specified trade route. trade_route = silk_road Provinces
trait character string Checks if the character has this trait trait = shy Traits
treasury character double treasury = 50 Money
troops siege clause troops = { who = troops value = 0.1 enemy = yes} Wars
unused_manpower character int unused_manpower = 250 Clans
uses_decadence character bool Character has decadence mechanic via religion/government. uses_decadence = yes Characters
using_cb war casusBelli any_war = { using_cb = crusade} Wars
vassal_of character character any_rival = { vassal_of = ROOT } Vassalage
war character bool Checks if the character is in war Wars
war_score war double any_war = { war_score = 50 } Wars
war_title war title/province war_title = ROOT Wars
war_with character character/title Returns true if people are hostile due to raiding or if their armies are hostile because of a personal, liege or third party war.[3] liege = { NOT = { war_with = ROOT } } Wars
was_conceived_a_bastard character bool was_conceived_a_bastard = yes Family
wealth character int The minimum amount of gold this character should have Money
will_liege_enforce_peace character bool See also has_liege_enforced_peace will_liege_enforce_peace = no Realm
would_be_heir_under_law title clause would_be_heir_under_law = { who = FROM law = seniority } Government
year any int Returns the current year. Control
yearly_income character double yearly_income = 25 Money

See also[edit]

References[edit]

  1. Forum:774248
  2. Forum:774248
  3. forum:874495/page-17#post-20709564
Modding
CommandsConditionsScopesModifiersEventsDecisions
Gfx/Sfx/localisation