Scripted effect · Tours and Tournaments files
tournament_contest_team_composition_effect
tournament_contest_team_composition_effect = { CONTEST = … SKILL = … }game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt, line 311 (271 lines). Parameters: $CONTEST$, $SKILL$.
tournament_contest_team_composition_effect is a scripted effect in Crusader Kings III, in the Tours and Tournaments files, written at line 311 of its file. A call passes 2 parameters: CONTEST and SKILL. The game's script calls it in 1 place, among them Grand Tournament (activity). Its body carries 1 text of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.
The comment above it in the file
Sort competitors into 2 teams based on relationships and loyalties - on_start
What it does
scope:activity:- Every guest subset:
- Where:
One of these
- Is played by a person
or
All of these
has_court_position = champion_court_position- Their liege: Is played by a person
tournament_contest_can_compete_trigger = yes- Progress to victory at least scope:activity.var:progress to victory threshold
name = contestantphase = tournament_phase_$CONTEST$add_tournament_contest_contestant_effect = { CONTEST = $CONTEST$ SKILL = $SKILL$ PTV = progress_to_victory_active_contestant_value }
- Where:
while = { … }tournament_liege_qualification_toast_effect = yes- One random guest subset:
name = qualifiedphase = tournament_phase_$CONTEST$scope:activity:add_to_guest_subset = { name = team_alpha target = scope:new_list_member phase = tournament_phase_$CONTEST$ }
- One random guest subset:
- Where:
is_playable_character = yeshas_any_bad_relationship_with_character_trigger = { CHARACTER = scope:team_alpha_creator }
name = qualifiedphase = tournament_phase_$CONTEST$scope:activity:add_to_guest_subset = { name = team_beta target = scope:new_list_member phase = tournament_phase_$CONTEST$ }
- Where:
- One guest subset, picked in order:
- Where › scope:activity:
None of these
- Any guest subset current phase:
name = team_alphathis = scope:new_list_member_temp
- Any guest subset current phase:
name = team_betathis = scope:new_list_member_temp
- Any guest subset current phase:
name = qualifiedphase = tournament_phase_$CONTEST$- 1 of 2 things will happen:
- 50%:
activity_contest_team_size_modifier = { SMALLER = alpha LARGER = beta }activity_contest_team_preference_modifier = { TEAM = alpha }scope:activity:add_to_guest_subset = { name = team_alpha target = scope:new_list_member phase = tournament_phase_$CONTEST$ }
- 50%:
activity_contest_team_size_modifier = { SMALLER = beta LARGER = alpha }activity_contest_team_preference_modifier = { TEAM = beta }scope:activity:add_to_guest_subset = { name = team_beta target = scope:new_list_member phase = tournament_phase_$CONTEST$ }
- 50%:
- Where › scope:activity:
- One random guest subset:
name = team_alphascope:activity:add_to_guest_subset = { name = team_alpha_captain target = scope:alpha_captain }
- One random guest subset:
name = team_betascope:activity:add_to_guest_subset = { name = team_beta_captain target = scope:beta_captain }
tournament_contest_update_team_ptv_effect = yes- Every guest subset:
name = contestantphase = tournament_phase_$CONTEST$If
scope:activity:None of these
- Any guest subset current phase:
name = team_alphathis = scope:new_list_member_temp
- Any guest subset current phase:
name = team_betathis = scope:new_list_member_temp
- Any guest subset current phase:
Then
- You did not qualify for … … contest
scope:activity:add_to_guest_subset = { name = spectator target = scope:new_list_member phase = tournament_phase_$CONTEST$ }
- Every attending character: Event contest_events.0600
- Every guest subset:
• 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_team_composition_effect = {
scope:activity = {
set_variable = { name = tournament_commenced }
# Players
every_guest_subset = {
name = contestant
phase = tournament_phase_$CONTEST$
limit = {
OR = {
is_ai = no
AND = {
has_court_position = champion_court_position
liege = { is_ai = no }
}
}
tournament_contest_can_compete_trigger = yes
var:progress_to_victory >= scope:activity.var:progress_to_victory_threshold
}
add_tournament_contest_contestant_effect = {
CONTEST = $CONTEST$
SKILL = $SKILL$
PTV = progress_to_victory_active_contestant_value
}
}
# Filter relevant into entrants list
while = {
limit = {
any_guest_subset = {
name = qualified
phase = tournament_phase_$CONTEST$
count < 20
}
any_guest_subset = {
name = contestant
phase = tournament_phase_$CONTEST$
tournament_contest_can_compete_trigger = yes
}
}
# Determine eligible contestants
ordered_guest_subset = {
name = contestant
phase = tournament_phase_$CONTEST$
limit = { tournament_contest_can_compete_trigger = yes }
order_by = var:progress_to_victory
add_tournament_contest_contestant_effect = {
CONTEST = $CONTEST$
SKILL = $SKILL$
PTV = progress_to_victory_active_contestant_value
}
}
}
# Inform liege of prestige from qualified knights
tournament_liege_qualification_toast_effect = yes
# Pick first team alpha character
random_guest_subset = {
name = qualified
phase = tournament_phase_$CONTEST$
limit = { this = scope:host }
alternative_limit = {
has_court_position = champion_court_position
liege = scope:host
}
alternative_limit = { is_playable_character = yes }
alternative_limit = { always = yes }
save_scope_as = new_list_member
scope:activity = {
add_to_guest_subset = {
name = team_alpha
target = scope:new_list_member
phase = tournament_phase_$CONTEST$
}
}
save_scope_as = team_alpha_creator
}
# Pick first team beta character
random_guest_subset = {
name = qualified
phase = tournament_phase_$CONTEST$
limit = {
is_playable_character = yes
has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:team_alpha_creator }
this != scope:team_alpha_creator
}
alternative_limit = {
is_playable_character = yes
this != scope:team_alpha_creator
}
alternative_limit = {
this != scope:team_alpha_creator
}
weight = {
base = 1
modifier = {
factor = 10
has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:team_alpha_creator }
}
modifier = {
factor = 10
AND = {
scope:team_alpha_creator = { has_activity_intent = murder_attendee_intent }
this = scope:team_alpha_creator.intent_target
}
}
modifier = {
factor = 0.5
liege = scope:team_alpha_creator
}
modifier = {
add = 1
top_liege = this
}
modifier = {
add = 1
primary_title.tier >= scope:team_alpha_creator.primary_title.tier
}
}
save_scope_as = new_list_member
scope:activity = {
add_to_guest_subset = {
name = team_betaAs written in game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.
The first 120 of its 271 lines; the rest is in game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt from line 311.
Where it is used
Every place in common/, events/ and history/ that calls tournament_contest_team_composition_effect.
Activities (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.