Scripted effect · Wards and Wardens files
guardian_travel_invalidation_effect
guardian_travel_invalidation_effect = yesgame/common/scripted_effects/05_bp2_hostage_effects.txt, line 752 (67 lines). No parameters.
guardian_travel_invalidation_effect is a scripted effect in Crusader Kings III, in the Wards and Wardens files, written at line 752 of its file. It takes no parameters: guardian_travel_invalidation_effect = yes. The game's script calls it in 2 places, among them migration_events_on_action (on action) and travel_events_on_action (on action). Patch 1.20.1.2, from game/common/scripted_effects/05_bp2_hostage_effects.txt.
The comment above it in the file
Invalidate travelling guardians
What it does
If
One of these
- Is imprisoned
or
Num of relation ward at least 2or
is_playable_character = yesor
var:guardian_travelling_to_ward:is_alive = no- Is imprisoned
- Any relation:
or
NOT = { exists = var:guardian_travelling_to_ward }
Then
scope:ward:If a check the game hides passes: the same again (1 line)
- Their liege › scope:guardian:
remove_relation_ward = scope:ward
- Their liege › scope:guardian:
scope:guardian:remove_relation_ward = scope:wardcurrent_travel_plan = { … }set_location_to_default = yes
• 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 (67 lines of game script)
guardian_travel_invalidation_effect = {
if = {
limit = {
exists = var:guardian_travelling_to_ward
OR = {
# Guardian is imprisoned
is_imprisoned = yes
# Guardian has wards already
num_of_relation_ward >= 2
is_playable_character = yes
var:guardian_travelling_to_ward = {
is_alive = no
# Ward is jailed
is_imprisoned = yes
# Ward has a guardian already
any_relation = { type = guardian }
}
NOT = { exists = var:guardian_travelling_to_ward }
}
}
var:guardian_travelling_to_ward ?= { save_scope_as = ward }
save_scope_as = guardian
scope:ward ?= {
if = {
limit = { exists = liege }
liege = {
save_scope_as = ward_liege
send_interface_toast = {
title = ward_invalidated_during_travel_title
left_icon = scope:guardian
right_icon = scope:ward
show_as_tooltip = {
scope:guardian = { remove_relation_ward = scope:ward }
}
}
}
}
send_interface_toast = {
title = guardian_invalidated_during_travel_title
left_icon = scope:guardian
scope:guardian = {
show_as_tooltip = { remove_relation_ward = scope:ward }
current_travel_plan = {
if = {
limit = { can_cancel = yes }
cancel_travel_plan = yes
}
}
set_location_to_default = yes
}
}
if = {
limit = { is_alive = yes }
remove_variable = character_making_education_request
remove_variable = ward_waiting_for_guardian
}
}
if = {
limit = { is_alive = yes }
remove_variable = guardian_travelling_to_ward
}
debug_log = "Guardian invalidated during travel"
debug_log_scopes = yes
}
}As written in game/common/scripted_effects/05_bp2_hostage_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls guardian_travel_invalidation_effect.
On actions (the game's own hooks) (2)
- migration_events_on_action
- travel_events_on_action
Source: game/common/scripted_effects/05_bp2_hostage_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.