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_team_winner_effect

tournament_contest_team_winner_effect = { CONTEST = … }

game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt, line 756 (140 lines). Parameters: $CONTEST$.

tournament_contest_team_winner_effect is a scripted effect in Crusader Kings III, in the Tours and Tournaments files, written at line 756 of its file. A call passes 1 parameter: CONTEST. 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

Determine winning team based on relative strength and event score - on_end

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_contest_team_winner_effect = {
	# Achievement.
	little_william_marshal_achievement_contest_end_effect = yes
	scope:activity = {
		tournament_contest_update_team_ptv_effect = yes
		save_scope_value_as = { name = contest_complete value = flag:$CONTEST$ }
		# Determine winning team
		random_list = {
			# ALPHA WINS
			1 = {
				# Add all team member's contest ability
				modifier = { add = var:team_a_ptv }
				# More likely is this team's PtV is higher
				modifier = {
					var:team_a_ptv > var:team_b_ptv
					factor = 2
				}
				# If other team has less than half PtV of this team, this team wins win
				modifier = {
					progress_to_victory_fetch_team_a_half_value >= scope:activity.var:team_b_ptv
					add = 1000
				}
			    every_guest_subset = {
			    	name = team_alpha
			    	phase = tournament_phase_$CONTEST$
					limit = { activity_tournament_valid_winner_trigger = yes }
					save_scope_as = new_list_member
					tournament_complete_win_contest_intent_effect = yes
					scope:activity = {
						add_to_guest_subset = {
			    			name = winner
							target = scope:new_list_member
							phase = tournament_phase_$CONTEST$
						}
					}
					# Achievement.
					little_william_marshal_achievement_contest_end_winner_effect = yes
				}
				every_guest_subset = {
			    	name = team_beta
			    	phase = tournament_phase_$CONTEST$
					limit = { activity_tournament_valid_winner_trigger = yes }
					save_scope_as = new_list_member
					scope:activity = {
						add_to_guest_subset = {
			    			name = second_place
							target = scope:new_list_member
							phase = tournament_phase_$CONTEST$
						}
					}
				}
				# Save winning and losing captain
				tournament_contest_winner_captain_effect = {
					WINNER = alpha
					LOSER = beta
					CONTEST = melee
				}
			}
			# BETA WINS
			1 = {
				# Add all team member's contest ability
				modifier = { add = var:team_b_ptv }
				# More likely is this team's PtV is higher
				modifier = {
					var:team_b_ptv > var:team_a_ptv
					factor = 2
				}
				# If other team has less than half PtV of this team, this team wins win
				modifier = {
					progress_to_victory_fetch_team_b_half_value >= scope:activity.var:team_a_ptv
					add = 1000
				}
				every_guest_subset = {
			    	name = team_beta
			    	phase = tournament_phase_$CONTEST$
					limit = { activity_tournament_valid_winner_trigger = yes }
					save_scope_as = new_list_member
					tournament_complete_win_contest_intent_effect = yes
					scope:activity = {
						add_to_guest_subset = {
			    			name = winner
							target = scope:new_list_member
							phase = tournament_phase_$CONTEST$
						}
					}
					# Achievement.
					little_william_marshal_achievement_contest_end_winner_effect = yes
				}
				every_guest_subset = {
			    	name = team_alpha
			    	phase = tournament_phase_$CONTEST$
					limit = { activity_tournament_valid_winner_trigger = yes }
					save_scope_as = new_list_member
					scope:activity = {
						add_to_guest_subset = {
			    			name = second_place
							target = scope:new_list_member
							phase = tournament_phase_$CONTEST$
						}
					}
				}
				# Save winning and losing captain
				tournament_contest_winner_captain_effect = {
					WINNER = beta
					LOSER = alpha
					CONTEST = melee
				}
			}
		}
		# Rewards
		tournament_contest_team_rewards_effect = { CONTEST = $CONTEST$ }
		# Add log entry
		add_activity_log_entry = {
			key = tournament_$CONTEST$_team_winner_log
			tags = { winner contest }
			score = 80
			show_in_conclusion = yes
			character = scope:contest_winner
			target = scope:second_place

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

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

Where it is used

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