Scripted effect · All Under Heaven files
set_elder_relation_effect
set_elder_relation_effect = { DISCIPLE = … ELDER = … MERIT = … }game/common/scripted_effects/10_dlc_tgp_scripted_effects.txt, line 1155 (57 lines). Parameters: $DISCIPLE$, $ELDER$, $MERIT$.
set_elder_relation_effect is a scripted effect in Crusader Kings III, in the All Under Heaven files, written at line 1155 of its file. A call passes 3 parameters: DISCIPLE, ELDER and MERIT. The game's script calls it in 29 places, among them Ask to Join my Movement (interaction), Find Elder (interaction) and Request Mentorship (interaction). Patch 1.20.1.2, from game/common/scripted_effects/10_dlc_tgp_scripted_effects.txt.
The comment above it in the file
ELDER = scope:character that should become the elder of the relation DISCIPLE = scope:character that should become the disciple of the relation MERIT = amount of merit the Elder will gain, can be set to 0 for no gain
What it does
$DISCIPLE$ = { … }If
None of these
scope:new_disciple:has_relation_elder = scope:new_elder
scope:new_elder:eligible_for_elder_trigger = { DISCIPLE = scope:new_disciple }
Then
scope:new_disciple:If
scope:old_elder != scope:new_disciple
Then
remove_relation_elder = scope:old_elderscope:old_elder:- Opinion: Refused to Be My Disciple (-50)
- Event tgp_interaction_event.0030
set_relation_elder = scope:new_elder
scope:new_elder:add_merit_if_relevant_effect = { MERIT = $MERIT$ }
• 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 (57 lines of game script)
set_elder_relation_effect = {
$DISCIPLE$ = {
save_scope_as = new_disciple
random_relation = {
type = elder
save_scope_as = old_elder
}
}
$ELDER$ = {
save_scope_as = new_elder
}
if = {
limit = {
# no circular relations please
NOT = {
scope:new_disciple = {
has_relation_elder = scope:new_elder
}
}
# Disciple does not have a higher merit rank than the elder
# The elder can have more disciples
scope:new_elder = {
eligible_for_elder_trigger = {
DISCIPLE = scope:new_disciple
}
}
}
scope:new_disciple = {
# in case you already had an elder, remove the relation and send them a letter
if = {
limit = {
exists = scope:old_elder
# Guard against the disburse loop picking the same character as both old_elder and new_disciple, which would make add_opinion target self.
scope:old_elder != scope:new_disciple
}
remove_relation_elder = scope:old_elder
save_scope_as = actor #for loc in tgp_interaction_event.0030
save_scope_as = puppet_or_actor
scope:old_elder = {
add_opinion = {
target = scope:new_disciple
modifier = refused_to_be_disciple_opinion
opinion = -50
}
save_scope_as = recipient #for loc in tgp_interaction_event.0030
trigger_event = tgp_interaction_event.0030
}
}
set_relation_elder = scope:new_elder
}
scope:new_elder = {
add_merit_if_relevant_effect = {
MERIT = $MERIT$
}
}
}
}As written in game/common/scripted_effects/10_dlc_tgp_scripted_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls set_elder_relation_effect.
Character interactions (3)
Activity pulse actions (2)
- apa_debate_found_disciple
- apa_found_disciple
Events (21)
- … Speaks
coronation_events.1037 - …, or Nobody
imperial_examination.2000 - …'s Influence
debate_event.2010 - A Chorus of Doubt
az_debate.0004 - A Disciple Worth Winning
az_debate.0001 - A Few Kind Words
az_examination.0016
15 more
- A Moment with the Elder
az_debate.0002 - A Rebuke Before All
az_debate.0007 - Familial Piety
az_examination.0006 - Friendly Exchanges
debate_event.2020 - Observing the Elder
az_debate.0011 - Pride's Folly
debate_event.2000 - Scholarly Crossroads
az_debate.0008 - tgp_interaction_event.0001
- tgp_interaction_event.0031
- tgp_interaction_event.00311
- The Dilemma
az_debate.0003 - The Elder's Last Choice
az_debate.0005 - The Last Lesson
az_debate.0006 - The Passing of a Sage
tgp_china_career.0030 - Under Pressure
az_examination.0014
Source: game/common/scripted_effects/10_dlc_tgp_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.