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
has_relation_potential_friend = scope:target_charcan_set_relation_friend_trigger = { CHARACTER = scope:target_char }
Then
If
has_activity_intent = befriend_attendee_intentintent_target ?= scope:target_charintent_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.
Decisions (2)
Character interactions (5)
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)
- … …: An Opening
ep2_tournament_events.0006 - … Advancements
fp2_struggle.1002 - … Charm
bp1_yearly.8160 - … Enemies
bp1_yearly.8130 - … Enfeoffment
fp3_frontier_story_cycle.0099 - … Favoritism
bp1_yearly.8070
99 more
- ... From My Friends
imperial_examination.4030 - … in Despair
court.0107 - … Legends
bp2_yearly.8054 - … Magic
bp1_yearly.8161 - … Moment
coronation_events.1027 - … Roadside Shrine
pilgrimage.1130 - … Talents
bp1_yearly.8190 - … The Spirit of …
pilgrimage.2070 - … Who Spurns the Fight
jason_locale_events.100 - …: Gneiss to Meet You
pet_rock.0105 - …: Good Sport
tournament_events.1270 - …: Mis-loose
ep2_tournament_events.6503 - …: New Experiences
tournament_events.1406 - …: One to Root For
tournament_events.1409 - …: Potential Suitors
tournament_events.1404 - …: Sabotage
tournament_events.6052 - …: Success
scheme_critical_moments.1252 - …: Taking an Opportunity
ep2_tournament_events.5505 - …: Tall Tales
tournament_events.1401 - …: the Adulterer
host_dinner_events.3002 - …: The Hapless …
ep2_tournament_events.3503 - …: the Healer
ep3_laamp_decision_event.1041 - …: the Training Grounds
ep3_laamp_decision_event.1051 - …: the Villain of …
host_dinner_events.1081 - …: Under … Wing
tournament_events.1300 - …: Wasted Concessions
tournament_events.1402 - 'Haunted' Manor: Safe and Sound
travel_events.2022 - A … …
coronation_events_klank.1008 - A … in Our Bed
bp1_yearly.9019 - A …-like …
tour_grounds_events.1012 - A Badge with a View
feast_default.6400 - A Blessed Toast
coronation_events.1015 - A Blessing from …
coronation_events.1028 - A Broken Note
az_tour.0005 - A Cake to Remember
coronation_events.1026 - A Celebration
travel_events.3022 - A Childhood Favorite
bp2_yearly.8071 - A Conversation in the Hand...
ep3_camp_party.2000 - A Cordial Hostage
bp2_yearly.8056 - A Coughing Crown
ach_coronation.0022 - A Courtier Between Friends
bp1_yearly.3100 - A Devoted Follower
ep3_camp_temperament.0040 - A Disciple Worth Winning
az_debate.0001 - A Divine Right Unearned
ach_coronation.0017 - A Faithful Friend
bp1_yearly.5708 - A Familial Reflection
bp1_yearly.4000 - A Familiar Presence
bp2_yearly.7014 - A Fiery Evening
coronation_events.1013 - A Fine Tilt!
bp2_yearly.5108 - A Fireside Story
culture_tradition_events.2100 - A Fog that Clouds All
ep3_story_cycle_violet_poet.1020 - A Follower's Heart
ep3_laamp_flavor_oltner.0001 - A Friend in Need
bp1_yearly.3002 - A Friend in Need
bp1_yearly.3003 - A Friend Indeed
bp1_yearly.3001 - A Friend of Wood
bp1_yearly.9003 - A Friend's Friend
ep2_wedding.2001 - A Game of Shagai
feast_tsagaan_sar_events.0200 - A Glorious Guest
tournament_events.1310 - A Heavy Crown
learning_medicine.2030 - A Hunter's Poem
tgp_hunt.0006 - A Language in Common
language_events.0002 - A Lesson in Charity
child_personality.7081 - A Lesson in Lucre
child_personality.7050 - A Little Experimentation
intrigue_temptation.3110 - A Lonely Doll
bp2_yearly.8030 - A Loyal Reminder: Homage
cultural_festival.3021 - A Loyal Reminder: Paying Homage
cultural_festival.3022 - A Master for Shepherds
migration_events.1020 - A Matter of Faith?
bp2_adult_education.1080 - A Meeting of Houses
ep2_wedding.3400 - A Mess of Legs
jason_first_race_event.1 - A Mind Alike
imperial_examination_jay.0010 - A Mirror in the Mud
bp1_yearly.9007 - A Moment of Doubt
assassination_ongoing.0004 - A Moment to Talk
hunt.7300 - A Moment to Talk
hunt.7301 - A Moment to Talk
hunt.7303 - A Never-ending Feast
party_baron.2002 - A Never-ending Feast
party_baron.2004 - A Night to Forget: Anywhere But Here
relation_upgrade.1002 - A Night to Forget: Interminable Screeching
relation_upgrade.1004 - A Novel Challenge
fp1_yearly.0661 - A Peer Ascends
az_examination.0020 - A Plague of Rumors
feast_default_alex.200 - A Poetic Life: An Exchange of Verses
tgp_japan_yearly_events.1262 - A Potential Crush
bp2_yearly.2014 - A Question of Honor
host_dinner_events.3150 - A Rebuke Before All
az_debate.0007 - A Relic of Revenge
court.0111 - A Romantic Revenant
epidemic_events.1010 - A Sheet of Paper
imperial_examination.4100 - A Sinister Consideration
bp1_yearly.9006 - A Slice of the Pie
court.2201 - A Slippery Slope
fp1_yearly.0671 - A Snapped Twig
travel_events.2010 - A Spectacular Courtier
court.0108 - A Story About...
bp1_yearly.7052 - A Story for the Ages
tgp_japan_yearly_events.1250
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.