CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

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

    • remove_relation_nemesis = $CHARACTER$
    • If a check the game hides passes: the same again (1 line)

      Otherwise

    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)

      Otherwise

    Else if

    • NOT = { has_relation_friend = $CHARACTER$ }

    Then

    • If a check the game hides passes: the same again (1 line)

      Otherwise

• 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)

5 more

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.

Spotted a mistake on this page?