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

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)

54 more

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.

Spotted a mistake on this page?