Scripted effect
guardian_add_opinion_effect
guardian_add_opinion_effect = { GUARDIAN = … WARD = … WARD_LIEGE = … }game/common/scripted_effects/00_education_effects.txt, line 1665 (110 lines). Parameters: $GUARDIAN$, $WARD$, $WARD_LIEGE$.
guardian_add_opinion_effect is a scripted effect in Crusader Kings III, written at line 1665 of its file. A call passes 3 parameters: GUARDIAN, WARD and WARD_LIEGE. The game's script calls it in 5 places, among them ward_guardian_arrival_tooltip_effect (local effect), on_guardian_arrive_at_ward (on action) and on_ward_arrive_at_guardian (on action). Patch 1.20.1.2, from game/common/scripted_effects/00_education_effects.txt.
The comment above it in the file
To run every time a guardian/ward relationship is set
What it does
Every line of it is script with no tooltip text: the script is below.
The script as written (110 lines of game script)
guardian_add_opinion_effect = {
$GUARDIAN$ = {
if = {
limit = {
NOT = { this = $WARD_LIEGE$ }
$WARD_LIEGE$ = { is_alive = yes }
is_ai = yes
}
#For educator
if = {
limit = {
$WARD_LIEGE$ = { player_heir = $WARD$ }
liege ?= $WARD_LIEGE$
is_ruler = yes
has_vassal_stance = parochial
}
add_opinion = {
target = $WARD_LIEGE$
modifier = guardian_of_heir_parochial_opinion
}
}
else_if = {
limit = { $WARD_LIEGE$ = { player_heir = $WARD$ } }
add_opinion = {
target = $WARD_LIEGE$
modifier = guardian_of_heir_opinion
}
}
else_if = {
limit = {
$WARD_LIEGE$ = { is_close_family_of = $WARD$ }
liege ?= $WARD_LIEGE$
is_ruler = yes
has_vassal_stance = parochial
}
add_opinion = {
target = $WARD_LIEGE$
modifier = guardian_of_relative_parochial_opinion
}
}
else_if = {
limit = { $WARD_LIEGE$ = { is_close_family_of = $WARD$ } }
add_opinion = {
target = $WARD_LIEGE$
modifier = guardian_of_relative_opinion
}
}
#For educator liege, if educator is courtier
if = {
limit = {
liege ?= {
is_ai = yes
is_alive = yes
}
is_ruler = no
NOT = { liege = $WARD_LIEGE$ }
}
liege = {
if = {
limit = {
$WARD_LIEGE$ = { player_heir = $WARD$ }
liege ?= $WARD_LIEGE$
is_ruler = yes
has_vassal_stance = parochial
}
add_opinion = {
target = $WARD_LIEGE$
modifier = guardian_of_heir_parochial_opinion
}
}
else_if = {
limit = { $WARD_LIEGE$ = { player_heir = $WARD$ } }
add_opinion = {
target = $WARD_LIEGE$
modifier = guardian_of_heir_opinion
}
}
else_if = {
limit = {
$WARD_LIEGE$ = { is_close_family_of = $WARD$ }
liege ?= $WARD_LIEGE$
is_ruler = yes
has_vassal_stance = parochial
}
add_opinion = {
target = $WARD_LIEGE$
modifier = guardian_of_relative_parochial_opinion
}
}
else_if = {
limit = { $WARD_LIEGE$ = { is_close_family_of = $WARD$ } }
add_opinion = {
target = $WARD_LIEGE$
modifier = guardian_of_relative_opinion
}
}
save_scope_as = guardian_liege
$WARD$ = {
set_variable = {
name = guardian_liege
value = scope:guardian_liege
}
}
}
}
}
}
}As written in game/common/scripted_effects/00_education_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls guardian_add_opinion_effect.
Scripted effects inside an event file (1)
- ward_guardian_arrival_tooltip_effect
On actions (the game's own hooks) (2)
- on_guardian_arrive_at_ward
- on_ward_arrive_at_guardian
Scripted effects (2)
Source: game/common/scripted_effects/00_education_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.