Scripted effect · All Under Heaven files
imperial_examination_determine_exam_outcome_effect
imperial_examination_determine_exam_outcome_effect = yesgame/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt, line 1692 (77 lines). No parameters.
imperial_examination_determine_exam_outcome_effect is a scripted effect in Crusader Kings III, in the All Under Heaven files, written at line 1692 of its file. It takes no parameters: imperial_examination_determine_exam_outcome_effect = yes. The game's script calls it in 2 places, among them Capital Examination (activity) and Local Examination (activity). Patch 1.20.1.2, from game/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt.
The comment above it in the file
Run at the end of each Phase
What it does
scope:activity:- Every guest subset:
- Where: Has “been caught cheating” (a variable the game's script sets)
name = entrants
- If imperial examination failee quota more than 0 › One guest subset, picked in order:
- Where: Does not have “failee to be removed” (a variable the game's script sets)
name = entrants
If
- Any guest subset:
name = entrants- Has the Trait: Students of Warfare
- Does not have “failee to be removed” (a variable the game's script sets)
Then
- One guest subset, picked in order:
- Where:
- Has the Trait: Students of Warfare
- Has “failee to be removed” (a variable the game's script sets)
- Is played by the AI
name = entrantschange_merit = { 100 150 }
- Where:
- Any guest subset:
- Every guest subset:
• 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 (77 lines of game script)
imperial_examination_determine_exam_outcome_effect = {
#Get the people in the last place and fail them
scope:activity = {
#Account for the cheating AI entrants
every_guest_subset = {
name = entrants
limit = { has_variable = been_caught_cheating }
set_variable = failee_to_be_removed
}
#Otherwise run through the list and trim it from the bottom up
if = {
limit = { imperial_examination_failee_quota_value > 0 }
ordered_guest_subset = {
name = entrants
limit = {
NOT = { has_variable = failee_to_be_removed }
}
order_by = {
value = temporary_exam_score_value
multiply = -1
}
max = imperial_examination_failee_quota_value
check_range_bounds = no
set_variable = failee_to_be_removed
}
}
# Check how many successful entrants we have with a martial education.
if = {
limit = {
any_guest_subset = {
name = entrants
count < {
value = 20
if = {
limit = {
scope:activity = {
has_activity_type = activity_imperial_examination
}
}
add = 20
}
}
has_trait = education_martial
NOT = { has_variable = failee_to_be_removed }
}
}
# If we don't have enough, let some of the failees pass.
ordered_guest_subset = {
name = entrants
check_range_bounds = no
limit = {
has_trait = education_martial
has_variable = failee_to_be_removed
is_ai = yes
}
order_by = {
value = temporary_exam_score_value
}
max = {
if = {
limit = {
scope:activity = {
has_activity_type = activity_imperial_examination
}
}
value = 20
}
else = {
value = 3
}
}
remove_variable = failee_to_be_removed
change_merit = { 100 150 }
}
}
}
}As written in game/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls imperial_examination_determine_exam_outcome_effect.
Activities (2)
Source: game/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.