Scripted trigger
courtier_allowed_to_leave_trigger
courtier_allowed_to_leave_trigger = yesgame/common/scripted_triggers/00_courtier_guest_management_triggers.txt, line 76 (180 lines). No parameters.
courtier_allowed_to_leave_trigger is a scripted trigger in Crusader Kings III, written at line 76 of its file. It takes no parameters: courtier_allowed_to_leave_trigger = yes (or no). The game's script calls it in 1 place, among them courtier_management (courtier guest management). Patch 1.20.1.2, from game/common/scripted_triggers/00_courtier_guest_management_triggers.txt.
What it checks
None of these
has_character_flag = blocked_from_leavingis_councillor_of = scope:liegeis_consort_of = scope:liegescope:liege:player_heir_position = { target = scope:leaving_courtier value <= 2 }
- Holds a court position
has_relation_lover = scope:liegeis_knight_of = scope:liegeis_tax_collector_of = scope:liege- Any relation:
One of these
this = scope:liegeor
All of these
is_courtier_of = scope:liegeOne of these
None of these
- Any close family member:
this = scope:leaving_courtier
- Any close family member:
or
Any close family member:this = scope:liege
- Any relation:
One of these
this = scope:liegeor
All of these
is_courtier_of = scope:liegeOne of these
None of these
- Any close family member:
this = scope:leaving_courtier
- Any close family member:
or
Any close family member:this = scope:liege
- Any relation:
One of these
this = scope:liegeor
All of these
is_courtier_of = scope:liegeOne of these
None of these
- Any close family member:
this = scope:leaving_courtier
- Any close family member:
or
Any close family member:this = scope:liege
- Any relation:
One of these
this = scope:liegeor
All of these
is_courtier_of = scope:liegeOne of these
None of these
- Any close family member:
this = scope:leaving_courtier
- Any close family member:
or
Any close family member:this = scope:liege
All of these
One of these
is_child_of = scope:liegeor
is_grandchild_of = scope:liegeor
is_great_grandchild_of = scope:liege
- Does not have the Trait: Bastard
Otherwise
scope:liege:One of these
- Has the Female Only Law
or
Has the Female Preference Law
All of these
One of these
is_child_of = scope:liegeor
is_grandchild_of = scope:liegeor
is_great_grandchild_of = scope:liege
- Is a child
scope:liege:pressing_claim_of_character_trigger = { CHARACTER = scope:leaving_courtier }
any_child_not_in_traveling_family_trigger = yesany_consort_not_in_traveling_family_trigger = yeshas_character_flag = courtier_staying_for_claim- Has “stewardship duty 1062 employer” (a variable the game's script sets)
- Any targeting scheme:
scheme_type = elope
All of these
- Is married
- Any spouse:
One of these
liege ?= scope:leaving_courtier.liegeor
All of these
exists = hostexists = scope:leaving_courtier.hostliege = scope:leaving_courtier.host
or
is_in_the_same_court_as = scope:leaving_courtier
Otherwise
scope:liege:One of these
- Has the Female Only Law
or
Has the Female Preference Law
is_diarch = yesis_designated_diarch = yes- Has the Trait: Shieldmaiden
- Has the Modifier: Mellowed Spirit
inspiration ?= { exists = inspiration_sponsor }- scope:liege: Government is Adventurer
is_obedient_to = scope:liegeAll of these
scope:liege.primary_title = title:h_chinaOne of these
is_child_of = scope:liegeor
is_grandchild_of = scope:liegeor
is_great_grandchild_of = scope:liege
• the game's own tooltip text · ◦ our reading of the script line · code the script where neither exists
“They” is whatever it runs on (the scope it is called in). The scripted triggers and effects it calls link to their own pages; $PARAMETERS$ stay as written: each call fills them in.
The script as written (120 lines of game script)
courtier_allowed_to_leave_trigger = {
save_temporary_scope_as = leaving_courtier
NOR = {
# Not blocked by script
has_character_flag = blocked_from_leaving
is_councillor_of = scope:liege
is_consort_of = scope:liege
scope:liege = {
player_heir_position = {
target = scope:leaving_courtier
value <= 2 #Not 1st, 2nd or 3rd player heir (0,1,2)
}
}
has_any_court_position = yes
has_relation_lover = scope:liege
is_knight_of = scope:liege
is_tax_collector_of = scope:liege
any_relation = {
type = ward
OR = {
this = scope:liege
AND = {
is_courtier_of = scope:liege
OR = {
NOT = { any_close_family_member = { this = scope:leaving_courtier } }
any_close_family_member = { this = scope:liege }
}
}
}
}
any_relation = {
type = guardian
OR = {
this = scope:liege
AND = {
is_courtier_of = scope:liege
OR = {
NOT = { any_close_family_member = { this = scope:leaving_courtier } }
any_close_family_member = { this = scope:liege }
}
}
}
}
any_relation = {
type = mentor
OR = {
this = scope:liege
AND = {
is_courtier_of = scope:liege
OR = {
NOT = { any_close_family_member = { this = scope:leaving_courtier } }
any_close_family_member = { this = scope:liege }
}
}
}
}
any_relation = {
type = student
OR = {
this = scope:liege
AND = {
is_courtier_of = scope:liege
OR = {
NOT = { any_close_family_member = { this = scope:leaving_courtier } }
any_close_family_member = { this = scope:liege }
}
}
}
}
#Keep daughters/sons for marriages
AND = {
OR = {
is_child_of = scope:liege
is_grandchild_of = scope:liege
is_great_grandchild_of = scope:liege
}
NOT = { has_trait = bastard }
trigger_if = { #Daughters
limit = { is_female = yes }
scope:liege = {
OR = {
has_realm_law = male_only_law
has_realm_law = male_preference_law
}
}
}
trigger_else = { #Sons
scope:liege = {
OR = {
has_realm_law = female_only_law
has_realm_law = female_preference_law
}
}
}
}
#No children of liege can leave court while children
AND = {
OR = {
is_child_of = scope:liege
is_grandchild_of = scope:liege
is_great_grandchild_of = scope:liege
}
is_adult = no
}
#Claimant won't leave while claim is pressed...
scope:liege = { pressing_claim_of_character_trigger = { CHARACTER = scope:leaving_courtier } }
#Would be leaving without a child or consort
any_child_not_in_traveling_family_trigger = yes
any_consort_not_in_traveling_family_trigger = yes
#...Or while they have a promise for a claim getting pressed
has_character_flag = courtier_staying_for_claim
#...Or if they're involved in an ongoing event
has_variable = stewardship_duty_1062_employer
#...Or if someone is trying to elope with them
any_targeting_scheme = {
scheme_type = elope
}
As written in game/common/scripted_triggers/00_courtier_guest_management_triggers.txt.
The first 120 of its 180 lines; the rest is in game/common/scripted_triggers/00_courtier_guest_management_triggers.txt from line 76.
Where it is used
Every place in common/, events/ and history/ that calls courtier_allowed_to_leave_trigger.
Courtier guest management (1)
- courtier_management
Source: game/common/scripted_triggers/00_courtier_guest_management_triggers.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.