Scripted effect
upgrade_to_friend_effect
upgrade_to_friend_effect = { CHARACTER = … REASON = … }game/common/scripted_effects/00_relation_effects.txt, line 845 (74 lines). Parameters: $CHARACTER$, $REASON$.
upgrade_to_friend_effect is a scripted effect in Crusader Kings III, written at line 845 of its file. A call passes 2 parameters: CHARACTER and REASON. The game's script calls it in 11 places, among them … Enemies (event bp1_yearly.8130), … Guile (event bp1_yearly.8131) and … Mistakes (event bp1_yearly.8192). Patch 1.20.1.2, from game/common/scripted_effects/00_relation_effects.txt.
The comment above it in the file
Immediately upgrade the relationship
What it does
If
has_relation_nemesis = $CHARACTER$
Then
Else if
has_relation_rival = $CHARACTER$
Then
remove_relation_rival = $CHARACTER$
Else if
has_relation_friend = $CHARACTER$
Then
If a check the game hides passes: the same again (1 line)
- Gains a Best Friend
Otherwise
- Gains a Best Friend
• 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 (74 lines of game script)
upgrade_to_friend_effect = {
#If nemesis, change to rival
if = {
limit = { has_relation_nemesis = $CHARACTER$ }
remove_relation_nemesis = $CHARACTER$
if = {
limit = {
exists = scope:relationship_reason_involved_character
}
set_relation_rival = {
target = $CHARACTER$
reason = $REASON$
involved_character = scope:relationship_reason_involved_character
}
}
else = {
set_relation_rival = {
target = $CHARACTER$
reason = $REASON$
}
}
}
#If rival, end rivalry.
else_if = {
limit = { has_relation_rival = $CHARACTER$ }
remove_relation_rival = $CHARACTER$
}
# If not, look at upgrading from friend to best friend
else_if = {
limit = {
has_relation_friend = $CHARACTER$
}
if = {
limit = {
exists = scope:relationship_reason_involved_character
}
set_relation_best_friend = {
target = $CHARACTER$
reason = $REASON$
copy_reason = friend
involved_character = scope:relationship_reason_involved_character
}
}
else = {
set_relation_best_friend = {
target = $CHARACTER$
copy_reason = friend
reason = $REASON$
}
}
}
# If not, look at upgrading from nothing to friend
else_if = {
limit = {
NOT = { has_relation_friend = $CHARACTER$ }
}
if = {
limit = {
exists = scope:relationship_reason_involved_character
}
set_relation_friend = {
target = $CHARACTER$
reason = $REASON$
involved_character = scope:relationship_reason_involved_character
}
}
else = {
set_relation_friend = {
target = $CHARACTER$
reason = $REASON$
}
}
}
}As written in game/common/scripted_effects/00_relation_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls upgrade_to_friend_effect.
Events (11)
- … Enemies
bp1_yearly.8130 - … Guile
bp1_yearly.8131 - … Mistakes
bp1_yearly.8192 - A Life Saved
host_dinner_events.3081 - Folly
ep3_powerful_families.8070 - Memories of a …
bp1_yearly.9041
5 more
- Plague Trials: Shame
epidemic_events.1065 - The Baby Eating …
bp1_yearly.9043 - The Face of …
bp1_yearly.9042 - The False …
funeral.1020 - Together or Not at All
funeral.1140
Source: game/common/scripted_effects/00_relation_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.