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_contest_race_composition_effect

tournament_contest_race_composition_effect = { CONTEST = … SKILL = … }

game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt, line 1226 (145 lines). Parameters: $CONTEST$, $SKILL$.

tournament_contest_race_composition_effect is a scripted effect in Crusader Kings III, in the Tours and Tournaments files, written at line 1226 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). Patch 1.20.1.2, from game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.

The comment above it in the file

Create competitor list and log entry

What it does

  • scope:activity:

• 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_race_composition_effect = {
	# Set up contest
	scope:activity = {
		set_variable = { name = tournament_commenced }
		# Set flavor variant
		if = {
			limit = {
				scope:host.culture = { has_cultural_pillar = heritage_arabic }
			}
			set_variable = {
				name = contest_horse_race_variant
				value = flag:maydan
			}
		}
		else = {
			set_variable = {
				name = contest_horse_race_variant
				value = flag:default
			}
		}
		# Players
		every_guest_subset = {
			name = contestant
			phase = tournament_phase_$CONTEST$
			limit = {
				is_ai = no
				tournament_contest_can_compete_trigger = yes
				exists = var:progress_to_victory
				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 < 7
				}
				any_guest_subset_current_phase = {
					name = contestant
					tournament_contest_can_compete_trigger = yes
				}
			}
			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
				}
			}
		}
		# Chance for mysterious stranger
		hidden_effect = {
			random_list = {
				3 = {
					ordered_guest_subset = {
						name = contestant
						phase = tournament_phase_$CONTEST$
						limit = { tournament_contest_can_compete_race_trigger = yes }
						order_by = var:progress_to_victory # to favor landed
						add_tournament_contest_contestant_effect = {
							CONTEST = $CONTEST$
							SKILL = $SKILL$
							PTV = progress_to_victory_active_contestant_value
						}
					}
				}
				1 = {
					trigger = {
						NOT = { exists = var:mysterious_stranger_appeared }
						any_guest_subset = {
							name = contestant
							phase = tournament_phase_$CONTEST$
							tournament_contest_can_compete_race_trigger = yes
						}
					}
					random_guest_subset = {
						name = contestant
						phase = tournament_phase_$CONTEST$
						limit = { tournament_contest_can_compete_race_trigger = yes }
						save_scope_as = mysterious_stranger
						set_variable = {
							name = mysterious_stranger_origin
							value = scope:activity.activity_location.barony
						}
						add_character_flag = horse_race_mysterious_stranger
						add_tournament_contest_contestant_effect = {
							CONTEST = $CONTEST$
							SKILL = $SKILL$
							PTV = progress_to_victory_active_contestant_value
						}
						tournament_horse_race_fetch_horse_effect = yes
					}
					if = {
						limit = { exists = scope:mysterious_stranger }
						set_variable = {
							name = mysterious_stranger_appeared
							value = scope:mysterious_stranger
						}
					}
				}
			}
		}
		# Add Activity Log entry
		add_activity_log_entry = {
			key = tournament_contest_start_log
			tags = { contest }
			score = 20
			character = scope:host
		}

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

The first 120 of its 145 lines; the rest is in game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt from line 1226.

Where it is used

Every place in common/, events/ and history/ that calls tournament_contest_race_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.

Spotted a mistake on this page?