Scripted effect · Friends and Foes files
improve_relationship_effect
improve_relationship_effect = { REASON = … TARGET = … }game/common/scripted_effects/01_dlc_bp1_filippa_scripted_effects.txt, line 187 (183 lines). Parameters: $REASON$, $TARGET$.
improve_relationship_effect is a scripted effect in Crusader Kings III, in the Friends and Foes files, written at line 187 of its file. A call passes 2 parameters: REASON and TARGET. The game's script calls it in 21 places, among them ...Comes Around (event travel_events.2035), A Snapped Twig (event travel_events.2010) and author_book.1000 (event). Patch 1.20.1.2, from game/common/scripted_effects/01_dlc_bp1_filippa_scripted_effects.txt.
The comment above it in the file
Does not add opinion if either person is NOT AI
What it does
If
$TARGET$ = { is_alive = yes }
Then
If
has_relation_nemesis = $TARGET$
Then
remove_relation_nemesis = $TARGET$- If played by the AI: Opinion: Friendly (+15)
If
$TARGET$ = { is_ai = yes }
Then
reverse_add_opinion = { target = $TARGET$ modifier = friendliness_opinion opinion = 15 }
Else if
has_relation_rival = $TARGET$
Then
remove_relation_rival = $TARGET$- If played by the AI: Opinion: Friendly (+15)
If
$TARGET$ = { is_ai = yes }
Then
reverse_add_opinion = { target = $TARGET$ modifier = friendliness_opinion opinion = 15 }
Else if
has_relation_potential_rival = $TARGET$
Then
remove_relation_potential_rival = $TARGET$- If played by the AI: Opinion: Friendly (+15)
If
$TARGET$ = { is_ai = yes }
Then
reverse_add_opinion = { target = $TARGET$ modifier = friendliness_opinion opinion = 15 }
Else if
has_relation_potential_friend = $TARGET$
Then
- Gains a Friend
- If played by the AI: Opinion: Friendly (+30)
If
$TARGET$ = { is_ai = yes }
Then
reverse_add_opinion = { target = $TARGET$ modifier = friendliness_opinion opinion = 30 }
Else if
has_relation_friend = $TARGET$can_set_relation_best_friend_trigger = { CHARACTER = $TARGET$ }
Then
- Gains a Best Friend
- If played by the AI: Opinion: Friendly (+50)
If
$TARGET$ = { is_ai = yes }
Then
reverse_add_opinion = { target = $TARGET$ modifier = friendliness_opinion opinion = 50 }
Otherwise
set_relation_potential_friend = $TARGET$- If played by the AI: Opinion: Friendly (+15)
If
$TARGET$ = { is_ai = yes }
Then
reverse_add_opinion = { target = $TARGET$ modifier = friendliness_opinion opinion = 15 }
• 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)
improve_relationship_effect = {
if = {
limit = {
this != $TARGET$
is_alive = yes
$TARGET$ = { is_alive = yes }
}
#Nemesis -> Rival
if = {
limit = {
has_relation_nemesis = $TARGET$
}
remove_relation_nemesis = $TARGET$
hidden_effect = {
set_relation_rival = {
target = $TARGET$
reason = $REASON$
}
}
if = {
limit = {
is_ai = yes
}
add_opinion = {
target = $TARGET$
modifier = friendliness_opinion
opinion = 15
}
}
if = {
limit = {
$TARGET$ = { is_ai = yes }
}
reverse_add_opinion = {
target = $TARGET$
modifier = friendliness_opinion
opinion = 15
}
}
}
#Rival -> Potential Rival
else_if = {
limit = {
has_relation_rival = $TARGET$
}
remove_relation_rival = $TARGET$
hidden_effect = { set_relation_potential_rival = $TARGET$ }
if = {
limit = {
is_ai = yes
}
add_opinion = {
target = $TARGET$
modifier = friendliness_opinion
opinion = 15
}
}
if = {
limit = {
$TARGET$ = { is_ai = yes }
}
reverse_add_opinion = {
target = $TARGET$
modifier = friendliness_opinion
opinion = 15
}
}
}
#Potential Rival -> Potential Friend
else_if = {
limit = {
has_relation_potential_rival = $TARGET$
}
remove_relation_potential_rival = $TARGET$
hidden_effect = { set_relation_potential_friend = $TARGET$ }
if = {
limit = {
is_ai = yes
}
add_opinion = {
target = $TARGET$
modifier = friendliness_opinion
opinion = 15
}
}
if = {
limit = {
$TARGET$ = { is_ai = yes }
}
reverse_add_opinion = {
target = $TARGET$
modifier = friendliness_opinion
opinion = 15
}
}
}
#Potential Friend -> Friend
else_if = {
limit = {
has_relation_potential_friend = $TARGET$
}
set_relation_friend = {
target = $TARGET$
reason = $REASON$
}
if = {
limit = {
is_ai = yes
}
add_opinion = {
target = $TARGET$
modifier = friendliness_opinion
opinion = 30
}
}
if = {
limit = {
$TARGET$ = { is_ai = yes }
}
reverse_add_opinion = {As written in game/common/scripted_effects/01_dlc_bp1_filippa_scripted_effects.txt.
The first 120 of its 183 lines; the rest is in game/common/scripted_effects/01_dlc_bp1_filippa_scripted_effects.txt from line 187.
Where it is used
Every place in common/, events/ and history/ that calls improve_relationship_effect.
Events (15)
- ...Comes Around
travel_events.2035 - A Snapped Twig
travel_events.2010 - author_book.1000
- Awakening
travel_events.2029 - Confessions of a Non-Believer
travel_events.2030 - Danger: … Overboard!
travel_danger_events.4000
9 more
- Danger: Life or Death, How to Save a Life
travel_events.2104 - Danger: Life or Death, How to Save a Life
travel_events.2105 - Danger: Life or Death, Saved
travel_events.2108 - Danger: Life or Death, Saved
travel_events.2109 - Danger: The Rigors of Travel
travel_danger_events.4010 - Domestic Disputes
bp1_yearly.2040 - Have a Seat
travel_events.2008 - True Aim
travel_events.2038 - Truest Aim
travel_events.2039
Scripted effects inside an event file (6)
- bp1_yearly_2030_relationship_effect
- bp2_yearly_1055_martial_effect
- bp2_yearly_1060_give_economical_reward_effect
- bp2_yearly_1060_give_learned_reward_effect
- bp2_yearly_1060_give_martial_reward_effect
- tour_general_vassal_offers_up_pet_effect
Source: game/common/scripted_effects/01_dlc_bp1_filippa_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.