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

activity_tournament_change_contestant_score_effect

activity_tournament_change_contestant_score_effect = { SCORE = … }

game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt, line 13 (137 lines). Parameters: $SCORE$.

activity_tournament_change_contestant_score_effect is a scripted effect in Crusader Kings III, in the Tours and Tournaments files, written at line 13 of its file. A call passes 1 parameter: SCORE. The game's script calls it in 150 places, among them tournament_archery_arrow_split (activity pulse), tournament_guest_ptv_small (activity pulse) and tournament_horse_stumbles (activity pulse). Its body carries 2 texts 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

Change score of a character for the current contest
Used to increase/decrease chance of winning the contest based on event outcomes

What it does

  • If

    • is_participant_in_activity = scope:score_changee.involved_activity
    • scope:score_changee.involved_activity › Any guest subset current phase:
      • name = contestant
    • scope:score_changee:

    Then

    • If

      • has_activity_state = active

      Then

    • If

      • has_activity_state = passive
      • Is played by a person

      Then

      • If

        • scope:old_ptv >= scope:score_changee.involved_activity.var:progress_to_victory_threshold
        • Progress to victory less than scope:score changee.involved activity.var:progress to victory threshold

        Then

        • You may not qualify for the … contest

        Else if

        • scope:old_ptv < scope:score_changee.involved_activity.var:progress_to_victory_threshold
        • Progress to victory at least scope:score changee.involved activity.var:progress to victory threshold

        Then

        • You are on course to qualify for the … contest

• 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)
activity_tournament_change_contestant_score_effect = {
	save_scope_as = score_changee
	if = {
		limit = {
			exists = scope:score_changee.involved_activity
			is_participant_in_activity = scope:score_changee.involved_activity
			scope:score_changee.involved_activity = {
				any_guest_subset_current_phase = {
					name = contestant
					this = scope:score_changee
				}
			}
			scope:score_changee = { activity_is_competing_trigger = yes }
		}
		if = {
			limit = { exists = var:progress_to_victory }
			save_scope_value_as = {
				name = old_ptv
				value = var:progress_to_victory
			}
		}
		# Set score tracker
		if = {
			limit = {
				NOT = { exists = var:progress_to_victory_score }
			}
			set_variable = {
				name = progress_to_victory_score
				value = {
					value = contest_progress_$SCORE$_value
					if = {
						limit = {
							scope:score_changee = {
								is_ai = yes
								NOR = {
									liege.court_position:champion_court_position ?= this
									involved_activity.special_guest:special_guest_champion ?= this
								}
							}
						}
						multiply = 0.5
					}
				}
			}
		}
		# Change existing score tracker
		else = {
			change_variable = {
				name = progress_to_victory_score
				add = {
					value = contest_progress_$SCORE$_value
					if = {
						limit = {
							scope:score_changee = {
								is_ai = yes
								NOR = {
									liege.court_position:champion_court_position ?= this
									involved_activity.special_guest:special_guest_champion ?= this
								}
							}
						}
						multiply = 0.5
					}
				}
			}
		}
		# Tooltip
		custom_tooltip = contestant_score_$SCORE$_tt
		# Update current PtV
		if = {
			limit = { has_activity_state = active }
			if = {
				limit = {
					scope:score_changee.involved_activity = { activity_tournament_team_contest_trigger = yes }
				}
				scope:score_changee.involved_activity = { tournament_contest_update_team_ptv_effect = yes }
			}
			else = {
				set_variable = {
					name = progress_to_victory
					value = progress_to_victory_active_contestant_value
				}
			}
		}
		else = {
			set_variable = {
				name = progress_to_victory
				value = progress_to_victory_passive_contestant_value
			}
		}
		# Toasts for qualification
		if = {
			limit = {
				has_activity_state = passive
				is_ai = no
			}
			if = { # No Longer Qualify
				limit = {
					exists = scope:old_ptv
					scope:old_ptv >= scope:score_changee.involved_activity.var:progress_to_victory_threshold
					var:progress_to_victory < scope:score_changee.involved_activity.var:progress_to_victory_threshold
				}
				send_interface_toast = {
					title = tournament_unqualified_ptv_toast
					left_icon = scope:score_changee
					custom_tooltip = tournament_unqualified_ptv_tt
				}
			}
			else_if = { # Now Qualify
				limit = {
					exists = scope:old_ptv
					scope:old_ptv < scope:score_changee.involved_activity.var:progress_to_victory_threshold
					var:progress_to_victory >= scope:score_changee.involved_activity.var:progress_to_victory_threshold
				}
				send_interface_toast = {
					title = tournament_qualified_ptv_toast
					left_icon = scope:score_changee
					custom_tooltip = tournament_qualified_ptv_tt 
				}
			}

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

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

Where it is used

Every place in common/, events/ and history/ that calls activity_tournament_change_contestant_score_effect — the first 120 of 150.

Activity pulse actions (7)

  • tournament_archery_arrow_split
  • tournament_guest_ptv_small
  • tournament_horse_stumbles
  • tournament_joust_lance_broken
  • tournament_joust_unhorsed
  • tournament_recital_successful_verse
1 more
  • tournament_win_memory

Events (113)

107 more

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?