Scripted effect · Tours and Tournaments files
tournament_contest_versus_pair_effect
tournament_contest_versus_pair_effect = { CONTEST = … STAGE = … }game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt, line 1782 (244 lines). Parameters: $CONTEST$, $STAGE$.
tournament_contest_versus_pair_effect is a scripted effect in Crusader Kings III, in the Tours and Tournaments files, written at line 1782 of its file. A call passes 2 parameters: CONTEST and STAGE. The game's script calls it in 1 place, among them tournament_contest_versus_pulse_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.
The comment above it in the file
Pair off versus contestants into bout matches
What it does
- Every guest subset:
name = $STAGE$phase = tournament_phase_$CONTEST$
If
- Any guest subset:
name = $STAGE$phase = tournament_phase_$CONTEST$
Then
while = { … }
- Any guest subset:
while = { … }
• 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 (120 lines of game script)
tournament_contest_versus_pair_effect = {
# Remove any event score gained in last round
every_guest_subset = {
name = $STAGE$
phase = tournament_phase_$CONTEST$
add_to_list = valid_contestants
set_variable = {
name = progress_to_victory
value = progress_to_victory_active_contestant_value
}
}
if = {
limit = {
any_guest_subset = {
name = $STAGE$ # e.g. quarter
phase = tournament_phase_$CONTEST$
count < contest_versus_$STAGE$_count
}
}
debug_log = "Not enough versus contestants"
while = {
limit = {
any_guest_subset = {
name = $STAGE$ # e.g. quarter
phase = tournament_phase_$CONTEST$
count < contest_versus_$STAGE$_count
}
}
if = {
limit = {
any_guest_subset = {
name = contestant
phase = tournament_phase_$CONTEST$
save_temporary_scope_as = new_list_member
NOT = {
scope:activity = {
any_guest_subset_current_phase = {
name = $STAGE$
this = scope:new_list_member
}
}
}
activity_is_valid_tournament_contestant = yes
}
}
random_guest_subset = {
name = contestant
phase = tournament_phase_$CONTEST$
limit = {
save_temporary_scope_as = new_list_member
NOT = {
scope:activity = {
any_guest_subset_current_phase = {
name = $STAGE$
this = scope:new_list_member
}
}
}
activity_is_valid_tournament_contestant = yes
}
save_scope_as = backup_contestant
}
}
else = { tournament_versus_create_contestant_fallback_effect = yes }
add_to_guest_subset = {
name = $STAGE$
target = scope:backup_contestant
phase = tournament_phase_$CONTEST$
}
}
}
# Pair remaining contestants
while = {
limit = {
any_guest_subset = {
name = $STAGE$
phase = tournament_phase_$CONTEST$
NOT = { has_variable = contest_$STAGE$_match_$CONTEST$ }
}
}
ordered_guest_subset = {
name = $STAGE$
phase = tournament_phase_$CONTEST$
limit = {
NOT = { has_variable = contest_$STAGE$_match_$CONTEST$ }
}
order_by = {
value = 50
if = {
limit = { scope:activity = { has_current_phase = tournament_phase_joust } }
add = contest_horse_aptitude_value
}
else_if = {
limit = { scope:activity = { has_current_phase = tournament_phase_duel } }
add = contest_foot_aptitude_value
}
else_if = {
limit = { scope:activity = { has_current_phase = tournament_phase_board_game } }
add = contest_board_game_aptitude_value
}
else = { add = contest_pugilism_aptitude_value }
}
# Save pair of contestants
save_scope_as = versus_matchee
scope:activity = {
random_guest_subset = {
name = $STAGE$
phase = tournament_phase_$CONTEST$
limit = {
NOR = {
this = scope:versus_matchee
has_variable = contest_$STAGE$_match_$CONTEST$
}
}
weight = {
base = 1
# Prefer to leave rivalry matches later
modifier = {
factor = 0.5
has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:versus_matchee }As written in game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.
The first 120 of its 244 lines; the rest is in game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt from line 1782.
Where it is used
Every place in common/, events/ and history/ that calls tournament_contest_versus_pair_effect.
Scripted effects (1)
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.