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_vacated_event_effect

court_position_vacated_event_effect = { COURT_POSITION_TYPE = … }

game/common/scripted_effects/00_court_position_effects.txt, line 3414 (60 lines). Parameters: $COURT_POSITION_TYPE$.

court_position_vacated_event_effect is a scripted effect in Crusader Kings III, written at line 3414 of its file. A call passes 1 parameter: COURT_POSITION_TYPE. The game's script calls it in 71 places, among them Akolouthos (court position), Antiquarian (court position) and Archer Captain (court position). Patch 1.20.1.2, from game/common/scripted_effects/00_court_position_effects.txt.

What it does

  • scope:liege:
    • If

      • Is played by a person
      • NOT = { has_player_court_position_automation_none = court_position_type:$COURT_POSITION_TYPE$ }

      Then

      • One court position candidate, picked in order:
        • court_position_type = scope:court_position_type
      • If

        • One of these

          • has_player_court_position_automation_assign_best = scope:court_position_type
          • or

            has_player_court_position_automation_assign_best_or_event = scope:court_position_type

        Then

        • appoint_court_position = { recipient = scope:candidate_1 court_position = scope:court_position_type }

• 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 (60 lines of game script)
court_position_vacated_event_effect = {
	scope:liege = {
		if = {
			limit = {
				is_ai = no
				NOT = { has_player_court_position_automation_none = court_position_type:$COURT_POSITION_TYPE$ }
			}

			court_position_type:$COURT_POSITION_TYPE$ = {
				save_scope_as = court_position_type
			}
			ordered_court_position_candidate = {
				court_position_type = scope:court_position_type
				order_by = aptitude_score:$COURT_POSITION_TYPE$

				# Previous holder might still be in the court/alive - lets not include them
				limit = { NOT = { this = scope:employee } }
				max = 2
				check_range_bounds = no

				if = {
					limit = { NOT = { exists = scope:candidate_1 } }
					save_scope_as = candidate_1
				}
				else_if = {
					limit = { NOT = { exists = scope:candidate_2 } }
					save_scope_as = candidate_2
				}
			}

			if = {
				limit = {
					OR = {
						has_player_court_position_automation_assign_best = scope:court_position_type
						has_player_court_position_automation_assign_best_or_event = scope:court_position_type
					}
					exists = scope:candidate_1
				}

				appoint_court_position = {
					recipient = scope:candidate_1
					court_position = scope:court_position_type
				}
			}
			else_if = {
				limit = {
					has_player_court_position_automation_assign_best = scope:court_position_type
				}
				# Do nothing, the player does not want an event
			}
			else_if = {
				limit = { is_landless_adventurer = yes }
				trigger_event = court_position_management_event.0002
			}
			else = {
				trigger_event = court_position_management_event.0001
			}
		}
	}
}

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_vacated_event_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?