Scripted effect
court_position_grant_effect
court_position_grant_effect = { CANDIDATE = … EMPLOYER = … POS = … }game/common/scripted_effects/00_court_position_effects.txt, line 647 (88 lines). Parameters: $CANDIDATE$, $EMPLOYER$, $POS$.
court_position_grant_effect is a scripted effect in Crusader Kings III, written at line 647 of its file. A call passes 3 parameters: CANDIDATE, EMPLOYER and POS. The game's script calls it in 69 places, among them Grand Tournament (activity), … Advancements (event fp2_struggle.1002) and … Passes …! (event chariot_race.3030). Patch 1.20.1.2, from game/common/scripted_effects/00_court_position_effects.txt.
What it does
If
$EMPLOYER$ = { … }
Then
$EMPLOYER$ = { … }
$CANDIDATE$ = { … }$EMPLOYER$ = { … }
• 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 (88 lines of game script)
court_position_grant_effect = { # Give position, and revoke old holder's if they exist
if = { #Multi-slot court positions - we replace the worst one
limit = {
$EMPLOYER$ = {
NOT = { can_employ_court_position_type = $POS$_court_position }
any_court_position_holder = {
type = $POS$_court_position
count >= 2
}
}
}
$EMPLOYER$ = {
ordered_court_position_holder = {
type = $POS$_court_position
order_by = {
value = aptitude:$POS$_court_position
multiply = -1
}
save_scope_as = old_holder #Should be the one with worst aptitude
}
}
}
else_if = {
limit = {
$EMPLOYER$.court_position:$POS$_court_position ?= { has_court_position = $POS$_court_position }
}
$EMPLOYER$.court_position:$POS$_court_position = { save_scope_as = old_holder }
}
$CANDIDATE$ = {
save_scope_as = candidate
if = {
limit = {
NOR = {
is_vassal_of = $EMPLOYER$
is_courtier_of = $EMPLOYER$
employer = $EMPLOYER$
}
}
hidden_effect = { set_employer = $EMPLOYER$ }
}
}
$EMPLOYER$ = {
if = {
limit = {
scope:old_holder ?= {
has_court_position = $POS$_court_position
}
}
send_interface_toast = {
title = move_and_grant_court_position_effect_tooltip
left_icon = $CANDIDATE$
right_icon = scope:old_holder
replace_court_position = {
recipient = $CANDIDATE$
holder = scope:old_holder
court_position = $POS$_court_position
}
}
}
else = {
send_interface_toast = {
title = move_and_grant_court_position_effect_tooltip
left_icon = $CANDIDATE$
appoint_court_position = {
recipient = $CANDIDATE$
court_position = $POS$_court_position
}
}
}
}
$CANDIDATE$ = {
$EMPLOYER$ = {
save_scope_as = liege
if = {
limit = { exists = scope:old_holder }
custom_tooltip = $POS$_old_holder_aptitude_tooltip
}
else = { custom_tooltip = $POS$_aptitude_tooltip }
}
}
#LAAMPs don't pay salaries
if = {
limit = {
$EMPLOYER$ = { is_landless_adventurer = no }
}
custom_tooltip = $POS$_salary_tooltip
}
}As written in game/common/scripted_effects/00_court_position_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls court_position_grant_effect.
Activities (1)
Events (60)
- … Advancements
fp2_struggle.1002 - … Passes …!
chariot_race.3030 - …: the Bodyguard
ep3_laamp_decision_event.1057 - …: The Hapless …
ep2_tournament_events.3503 - …: the Physician
ep3_laamp_decision_event.1047 - A Follower, Enamored
ep3_story_cycle_violet_poet.1015
54 more
- A Hunt Master
hunt.0540 - A Little Language
court.9500 - A Place at Court
hold_court.8090 - A Popular Mime
ep3_emperor_yearly.2090 - A Sublime Vision
mpo_events_tova.0030 - A Worthy Chief Eunuch
ep3_decisions_event.5010 - ach_coronation.0019
- An Anatomical Expert
court.0109 - An Unlikely Triumph
chariot_race.3050 - Architect's Digest
travel_events.2028 - Beware!
hunt.8060 - Borrowed Coin
tournament_events.1321 - Brethren as Neighbors
pam_theocratic_ruler_events.0004 - Catching a Break
travel_events.2040 - Civil Service
ep3_powerful_families.8100 - Distant Lands: Victory
legend_spread_events.8125 - Dynastic Duties
ach_coronation.0018 - Eminent Eunuch: …
ep3_story_cycle_admin_eunuch.1001 - Endless Poetry
hold_court.4500 - Experienced Wanderer
destination_events.10 - Fireside Tales
fp2_yearly.4008 - Foremost …
court.8160 - From Beyond the Border
hold_court.6030 - Genpei War: Soaring Butterfly
tgp_genpei_character.2000 - Grand Ambitions: A Master of Whispers
grand_ambitions.0151 - I Need a Hero
court.4751 - Laughs Requested
hold_court.3040 - Lay of the Land
ep3_laamps.5035 - My Bookmaker
ep3_decisions_event.1010 - My Homesick …
court.3040 - One Herb for You...
travel_events.2032 - Opportunity in Libation
coronation_events.1017 - Pie-based Shenanigans
court.9400 - Potent Physick
tgp_governor_contract_event.0002 - Rags to Maile
tournament_events.1230 - Raptor Retailer
hunt.2001 - Royal Service
hold_court.8050 - Scraping the Barrel
minor_decisions.0003 - Scrounger Life
court_yearly.6040 - Serious Business
hold_court.8110 - Silvertongue
court_events.3080 - Swords for the Faith
pam_theocratic_ruler_events.0005 - The … …
ach_coronation.0023 - The Feast of Fools
cultural_festival.3071 - The Good Witch of the Bog
bp1_yearly.9035 - The Mercenaries of …
travel_events_bp3.30 - The Metal …
travel_events.4031 - The Milk of A Nurse's Love
bp2_yearly.7012 - The Saint of …
ep3_emperor_yearly.2150 - The Sword of Damocles
court_new.0001 - The Wise … of …
tour_travel.1008 - Tribute of the Chase
nomad_events_oltner.0006 - Where Is my Hermit?
travel_events.3062 - Year of the …
feast_tsagaan_sar_events.0290
Scripted effects inside an event file (3)
- 1047_hire_physician_effect
- 1057_hire_bodyguard_effect
- appoint_court_eunuch_effect
Source: game/common/scripted_effects/00_court_position_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.