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

Scripted effect · Tours and Tournaments files

tournament_replace_qualifier_scope_effect

tournament_replace_qualifier_scope_effect = yes

game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt, line 7196 (85 lines). No parameters.

tournament_replace_qualifier_scope_effect is a scripted effect in Crusader Kings III, in the Tours and Tournaments files, written at line 7196 of its file. It takes no parameters: tournament_replace_qualifier_scope_effect = yes. The game's script calls it in 3 places, among them …: Contest Begins (event contest_events.0500), …: Contest Begins (event contest_events.0700) and …: Contest Begins (event contest_events.0800). Patch 1.20.1.2, from game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.

The comment above it in the file

Replace qualified contestant with another

What it does

  • scope:activity:
    • If

      a check the game hides

      Then

      • One random guest subset current phase:
        • Only some of them (the filter is in the script below)
        • name = qualified
      • If

        • Any guest subset current phase:
          • name = qualified
          • has_relation_rival = root

        Then

        • One random guest subset current phase:
          • Where:
            • has_relation_rival = root
          • name = qualified
  • If

    a check the game hides

    Then

    • scope:activity › One guest subset current phase, picked in order:

• 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 (85 lines of game script)
tournament_replace_qualifier_scope_effect = {
	# For events replacing a contestant
	scope:activity = {
		if = {
			limit = {
				NOT = { exists = var:contest_aptitude }
			}
			random_guest_subset_current_phase = {
				name = qualified
				limit = {
					is_ai = yes
					NOT = {
						liege ?= { is_ai = no }
						liege.court_position:champion_court_position ?= this
					}
					NOT = { root.court_position:champion_court_position ?= this }
					NOT = {
						any_relation = {
							type = lover
							type = friend
							type = rival
							is_participant_in_activity = scope:activity
							is_ai = no
						}
					}
				}
				weight = {
					base = 1
					modifier = {
						add = 50
						var:contest_aptitude < root.contest_current_contest_aptitude_value
					}
					modifier = { # Try to exclude mysterious strangers
						add = -100
						exists = var:mysterious_stranger_origin
					}
					modifier = { # Try to exclude own knights
						add = -25
						OR = {
							is_knight_of = root
							liege ?= { is_ai = no }
						}
					}
				}
				save_scope_as = replaced_contestant
			}
			if = {
				limit = {
					any_guest_subset_current_phase = {
						name = qualified
						has_relation_rival = root
					}
				}
				random_guest_subset_current_phase = {
					name = qualified
					limit = { has_relation_rival = root }
					save_scope_as = rival_contestant
				}
			}
		}
	}
	if = {
		limit = { exists = var:contest_aptitude }
		scope:activity = {
			ordered_guest_subset_current_phase = {
				name = contestant
				limit = {
					save_temporary_scope_as = new_list_member
					NOR = {
						scope:activity = {
							any_guest_subset_current_phase = {
								name = qualified
								this = scope:new_list_member
							}
						}
					}
					activity_is_valid_tournament_contestant = yes
				}
				order_by = contest_current_contest_aptitude_value
				save_scope_as = new_contestant
			}
		}
	}
	else = { save_scope_as = new_contestant }
}

As written in game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.

Where it is used

Every place in common/, events/ and history/ that calls tournament_replace_qualifier_scope_effect.

Events (3)

Source: game/common/scripted_effects/04_dlc_ep2_tournament_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?