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

Scripted effect

progress_towards_friend_effect

progress_towards_friend_effect = { CHARACTER = … OPINION = … REASON = … }

game/common/scripted_effects/00_relation_effects.txt, line 31 (174 lines). Parameters: $CHARACTER$, $OPINION$, $REASON$.

progress_towards_friend_effect is a scripted effect in Crusader Kings III, written at line 31 of its file. A call passes 3 parameters: CHARACTER, OPINION and REASON. The game's script calls it in 482 places, among them Assimilate to Mandala Rule (decision), Perform Tea Ceremony (decision) and Debt Relief (interaction). Patch 1.20.1.2, from game/common/scripted_effects/00_relation_effects.txt.

The comment above it in the file

Sets potential friend + opinion or upgrades potential friend to full friend

What it does

  • If

    Then

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

      Otherwise

    • If

      • has_activity_intent = befriend_attendee_intent
      • intent_target ?= scope:target_char
      • intent_target.involved_activity ?= this.involved_activity

      Then

      • complete_activity_intent = yes

    Otherwise

    • If

      • can_set_relation_potential_friend_trigger = { CHARACTER = scope:target_char }
      • If

        • Is played by the AI
        • scope:target_char: Is played by the AI

        Then

        • scope:target_char: Opinion of prev at least -25

        Otherwise

        • always = yes

      Then

      • set_relation_potential_friend = scope:target_char
    • If

      • scope:friend_opinion != 0

      Then

      • If

        • scope:target_char: Is played by the AI

        Then

        • reverse_add_opinion = { target = scope:target_char modifier = friendliness_opinion opinion = scope:friend_opinion }
      • Opinion: Friendly

• 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)
progress_towards_friend_effect = {
	$CHARACTER$ = { save_scope_as = target_char }
	#If potential friend, set friend!
	if = {
		limit = {
			has_relation_potential_friend = scope:target_char
			can_set_relation_friend_trigger = { CHARACTER = scope:target_char }
		}
		if = {
			limit = {
				exists = scope:relationship_reason_involved_character
				exists = scope:relationship_reason_province
			}
			set_relation_friend = { 
				reason = $REASON$ 
				target = scope:target_char 
				involved_character = scope:relationship_reason_involved_character 
				province = scope:relationship_reason_province 
			}
			if = {
				limit = {
					involved_activity ?= {
						has_activity_type = activity_playdate
					}
				}
				involved_activity = {
					add_activity_log_entry = {
						key = activity_generic_friend_log
						tags = { good }
						score = 10
						character = prev
						target = scope:target_char
					}
				}
			}
		}
		else_if = {
			limit = {
				exists = scope:relationship_reason_province
			}
			set_relation_friend = { 
				reason = $REASON$ 
				target = scope:target_char 
				province = scope:relationship_reason_province 
			}
			if = {
				limit = {
					this.involved_activity ?= {
						has_activity_type = activity_playdate
					}
				}
				this.involved_activity ?= {
					add_activity_log_entry = {
						key = activity_generic_friend_log
						tags = { good }
						score = 10
						character = prev
						target = scope:target_char
					}
				}
			}
		}
		else_if = {
			limit = {
				exists = scope:relationship_reason_involved_character
			}
			set_relation_friend = { 
				reason = $REASON$ 
				target = scope:target_char 
				involved_character = scope:relationship_reason_involved_character 
			}
			if = {
				limit = {
					this.involved_activity ?= {
						has_activity_type = activity_playdate
					}
				}
				this.involved_activity ?= {
					add_activity_log_entry = {
						key = activity_generic_friend_log
						tags = { good }
						score = 10
						character = prev
						target = scope:target_char
					}
				}
			}
		}
		else = {
			set_relation_friend = { 
				reason = $REASON$ 
				target = scope:target_char 
			}
			if = {
				limit = {
					this.involved_activity ?= {
						has_activity_type = activity_playdate
					}
				}
				this.involved_activity ?= {
					add_activity_log_entry = {
						key = activity_generic_friend_log
						tags = { good }
						score = 10
						character = prev
						target = scope:target_char
					}
				}
			}
		}
		# Complete activity intent if relevant
		if = {
			limit = {
				exists = involved_activity
				has_activity_intent = befriend_attendee_intent
				intent_target ?= scope:target_char
				intent_target.involved_activity ?= this.involved_activity
			}	
			save_scope_as = intent_completer
			send_interface_toast = {

As written in game/common/scripted_effects/00_relation_effects.txt.

The first 120 of its 174 lines; the rest is in game/common/scripted_effects/00_relation_effects.txt from line 31.

Where it is used

Every place in common/, events/ and history/ that calls progress_towards_friend_effect — the first 120 of 482.

Activity pulse actions (7)

  • apa_bonded_during_studies
  • apa_cheering_on_competitors
  • apa_friendly_discussions
  • befriend_loyalists
  • bonding_spouse_family
  • detractors_bond
1 more
  • supporters_bond

Court position tasks (1)

  • Promote Friendship

Events (105)

99 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?