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_generate_wager_scope_effect

tournament_generate_wager_scope_effect = yes

game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt, line 3294 (230 lines). No parameters.

tournament_generate_wager_scope_effect is a scripted effect in Crusader Kings III, in the Tours and Tournaments files, written at line 3294 of its file. It takes no parameters: tournament_generate_wager_scope_effect = yes. The game's script calls it in 1 place, among them …: Place Your Bets (event tournament_events.1000). Patch 1.20.1.2, from game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.

The comment above it in the file

Find scopes for possible wagers

What it does

• 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_generate_wager_scope_effect = {
	# Top contestant - for maths
	ordered_guest_subset_current_phase = {
		name = qualified
		limit = {
			NOT = { exists = var:mysterious_stranger_origin }
		}
		order_by = var:contest_aptitude
		save_scope_as = wager_top_contestant
		tournament_horse_race_fetch_horse_effect = yes
	}
	save_scope_value_as = {
		name = wager_diff_value
		value = {
			add = scope:wager_top_contestant.var:contest_aptitude
			divide = 2
		}
	}
	# Bottom contestant - for maths
	ordered_guest_subset_current_phase = {
		name = qualified
		order_by = {
			value = 0
			subtract = var:contest_aptitude
		}
		save_scope_as = wager_bottom_contestant
		tournament_horse_race_fetch_horse_effect = yes
	}
	# Champion contestant
	if = {
		limit = {
			scope:wagerer = { employs_court_position = champion_court_position }
			any_guest_subset_current_phase = {
				name = qualified
				has_court_position = champion_court_position
				liege = scope:wagerer
				NOR = {
					this = scope:wager_top_contestant
					this = scope:wager_bottom_contestant
				}
			}
		}
		random_guest_subset_current_phase = {
			name = qualified
			limit = {
				has_court_position = champion_court_position
				liege = scope:wagerer
				NOR = {
					this = scope:wager_top_contestant
					this = scope:wager_bottom_contestant
				}
			}
			save_scope_as = wager_champion_contestant
			if = {
				limit = {
					scope:activity = { has_current_phase = tournament_phase_horse_race }
				}
				tournament_horse_race_fetch_horse_effect = yes
			}
		}
	}
	# Flavor contestant
	if = {
		limit = {
			any_guest_subset_current_phase = {
				name = qualified
				OR = {
					has_any_good_relationship_with_character_trigger = { CHARACTER = root }
					is_child_of = root
					is_spouse_of = root
				}
				NOR = {
					this = scope:wager_top_contestant
					AND = {
						exists = scope:wager_champion_contestant
						this = scope:wager_champion_contestant
					}
				}
			}
		}
		ordered_guest_subset_current_phase = {
			name = qualified
			limit = {
				OR = {
					has_any_good_relationship_with_character_trigger = { CHARACTER = root }
					is_child_of = root
					is_spouse_of = root
				}
				NOR = {
					this = scope:wager_top_contestant
					AND = {
						exists = scope:wager_champion_contestant
						this = scope:wager_champion_contestant
					}
				}
			}
			order_by = var:contest_aptitude
			save_scope_as = wager_flavor_contestant
			if = {
				limit = {
					scope:activity = { has_current_phase = tournament_phase_horse_race }
				}
				tournament_horse_race_fetch_horse_effect = yes
			}
		}
	}
	# Underdog contestant
	if = {
		limit = {
			any_guest_subset_current_phase = {
				name = qualified
				NOR = {
					exists = var:mysterious_stranger_origin
					this = scope:wager_top_contestant
					AND = {
						exists = scope:wager_flavor_contestant
						this = scope:wager_flavor_contestant
					}
					AND = {
						exists = scope:wager_champion_contestant

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

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

Where it is used

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

Events (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?