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

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:

    Then

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

Activity pulse actions (2)

  • apa_debate_found_disciple
  • apa_found_disciple

Events (21)

15 more

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.

Spotted a mistake on this page?