Scripted effect · Tours and Tournaments files
chance_for_knight_appearance_effect
chance_for_knight_appearance_effect = yesgame/common/scripted_effects/04_dlc_ep2_tournament_effects.txt, line 7052 (100 lines). No parameters.
chance_for_knight_appearance_effect is a scripted effect in Crusader Kings III, in the Tours and Tournaments files, written at line 7052 of its file. It takes no parameters: chance_for_knight_appearance_effect = yes. 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
Potentially make wandering knight appear in tournament
What it does
If
- scope:activity: Attending character (less than 240):
Then
- 50% chance of:
- Every in list › Every pool character:
- Where:
- Prowess at least 12
guest_knight_candidate_trigger = { HOST = scope:host }is_available = yesis_in_activity = no
province = scope:pool_county.title_province
- Where:
If
a check the game hides
Then
create_character = { … }
- scope:host: …, a lordless warrior, has arrived to compete in your Grand Tournament
- Every in list › Every pool character:
• 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 (100 lines of game script)
chance_for_knight_appearance_effect = {
if = {
limit = {
NOT = { exists = scope:activity.var:tournament_commenced }
scope:activity = {
any_attending_character = {
count < 240 #Max is 250, we are leaving some open space.
}
}
}
random = {
chance = 50
every_realm_county = {
if = {
limit = {
save_temporary_scope_as = potential_county
NOT = {
any_in_list = {
list = pool_counties
duchy = scope:potential_county.duchy
}
}
}
add_to_temporary_list = pool_counties
}
}
every_in_list = {
list = pool_counties
save_temporary_scope_as = pool_county
every_pool_character = {
province = scope:pool_county.title_province
limit = {
prowess >= 12 #make sure this matches the tooltip of the decision and all the 12s below
guest_knight_candidate_trigger = { HOST = scope:host }
is_available = yes
is_in_activity = no
}
add_to_temporary_list = potential_knights
}
}
#Randomize a good knight from the realm pool characters
random_in_list = {
list = potential_knights
limit = { is_alive = yes }
weight = {
base = 1
modifier = {
add = {
value = prowess
subtract = 12
multiply = 5
}
}
}
save_scope_as = knight
}
#If no one was found, make one
if = {
limit = {
NOT = { exists = scope:knight }
}
create_character = {
location = root.capital_province
template = pool_repopulate_prowess
prowess = { 12 15 }
save_scope_as = knight
}
}
#Cultural Traditions
if = {
limit = {
scope:host.culture = { has_cultural_parameter = better_knights_from_decision }
}
hidden_effect = {
scope:knight = {
blademaster_lifestyle_rank_up_effect = yes
knight_increase_prowess_chance_effect = yes
knight_increase_prowess_chance_effect = yes
}
}
}
#Add knight to court
scope:host = {
send_interface_message = {
type = msg_tournament_knight_arrives
title = tournament_knight_appeared_title
left_icon = scope:knight
scope:knight = {
hidden_effect = {
add_to_activity = scope:activity
set_location = scope:activity.activity_location
set_passive_contest_aptitude_and_progress_effect = yes
}
}
custom_tooltip = tournament_knight_appeared_tt
}
}
}
}
}As written in game/common/scripted_effects/04_dlc_ep2_tournament_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls chance_for_knight_appearance_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.