Scripted effect
set_random_friendship_reason
set_random_friendship_reason = { TARGET = … }game/common/scripted_effects/00_relation_effects.txt, line 962 (83 lines). Parameters: $TARGET$.
set_random_friendship_reason is a scripted effect in Crusader Kings III, written at line 962 of its file. A call passes 1 parameter: TARGET. The game's script calls it in 6 places, among them A Sweet Farewell (event intrigue_temptation.3000), courtier_guest_management.3001 (event) and ep3_laamp_decision_event.1300 (event). Patch 1.20.1.2, from game/common/scripted_effects/00_relation_effects.txt.
What it does
- Gains a 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 (83 lines of game script)
set_random_friendship_reason = { # Use for adults, primarily
show_as_tooltip = {
set_relation_friend = $TARGET$
}
hidden_effect = {
random_list = {
10 = {
trigger = {
exists = location
NOT = { exists = liege }
}
set_relation_friend = { reason = friend_random_1 target = $TARGET$ province = location }
}
10 = {
trigger = {
exists = location
NOT = { exists = liege }
}
set_relation_friend = { reason = friend_random_2 target = $TARGET$ province = location }
}
10 = {
trigger = {
exists = location
NOT = { exists = liege }
}
set_relation_friend = { reason = friend_random_3 target = $TARGET$ province = location }
}
10 = {
trigger = {
exists = location
NOT = { exists = liege }
}
set_relation_friend = { reason = friend_random_4 target = $TARGET$ province = location }
}
10 = {
trigger = {
exists = location
NOT = { exists = liege }
}
set_relation_friend = { reason = friend_random_5 target = $TARGET$ province = location }
}
10 = {
trigger = {
exists = liege
}
set_relation_friend = { reason = friend_random_6 target = $TARGET$ involved_character = liege }
}
10 = {
trigger = {
exists = liege
}
set_relation_friend = { reason = friend_random_7 target = $TARGET$ involved_character = liege }
}
10 = {
trigger = {
exists = liege
}
set_relation_friend = { reason = friend_random_8 target = $TARGET$ involved_character = liege }
}
10 = {
trigger = {
exists = liege.capital_province
}
set_relation_friend = { reason = friend_random_9 target = $TARGET$ involved_character = liege province = liege.capital_province }
}
10 = {
trigger = {
exists = liege.capital_province
}
set_relation_friend = { reason = friend_random_10 target = $TARGET$ involved_character = liege province = liege.capital_province }
}
10 = {
trigger = {
NOR ={
exists = location
exists = liege
}
}
set_relation_friend = { reason = friend_random_fallback target = $TARGET$ }
}
}
}
}As written in game/common/scripted_effects/00_relation_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls set_random_friendship_reason.
Events (4)
Scripted effects (2)
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.