CK3 DatabaseCrusader Kings III · 1.20.1.2 “Crozier” · unofficial
Silk & Silverout Tue, Nov 17What's free, what needs the DLC, price →

Scripted effect · All Under Heaven files

imperial_examination_set_up_examiners_effect

imperial_examination_set_up_examiners_effect = { HOST = … }

game/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt, line 797 (429 lines). Parameters: $HOST$.

imperial_examination_set_up_examiners_effect is a scripted effect in Crusader Kings III, in the All Under Heaven files, written at line 797 of its file. A call passes 1 parameter: HOST. 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

Grab any eligible examiners, pre-Activity

What it does

  • $HOST$ = { … }
  • If

    • scope:activity:
      • One of these

        • NOT = { has_variable_list = imperial_examiners_list }
        • or

          variable_list_size = { name = imperial_examiners_list value < examiners_amount }

    Then

    • scope:activity:
      • If

        • variable_list_size = { name = imperial_examiners_list value < examiners_amount }

        Then

        • while = { … }

        Otherwise

        • while = { … }
  • If

    • scope:activity:
      • One of these

        • NOT = { has_variable_list = imperial_examiners_list }
        • or

          variable_list_size = { name = imperial_examiners_list value < examiners_amount }

    Then

    • If

      • scope:activity:
        • variable_list_size = { name = imperial_examiners_list value < examiners_amount }

      Then

      • while = { … }

      Otherwise

      • while = { … }
  • If

    • scope:activity:
      • One of these

        • NOT = { has_variable_list = imperial_examiners_list }
        • or

          variable_list_size = { name = imperial_examiners_list value < examiners_amount }

    Then

    • If

      • scope:activity:
        • variable_list_size = { name = imperial_examiners_list value < examiners_amount }

      Then

      • while = { … }

      Otherwise

      • while = { … }
  • Every in list:
    • Where:
      • None of these

        • exists = involved_activity
        • scope:activity › Any attending character:
          • this = scope:new_examiner
        • Any invited activity:
          • this = scope:activity
    • add_to_activity = scope:activity

• 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)
imperial_examination_set_up_examiners_effect = {
	scope:activity.activity_location = { save_scope_as = location }
	#Got anyone else we can invite to be an examiner?
	$HOST$ = {
		ordered_courtier = {
			limit = {
				has_trait = confucian_education
				trigger_if = {
					limit = {
						scope:activity = {
							has_activity_type = activity_imperial_examination
						}
					}
					has_character_flag = passed_metropolitan_exam
				}
				trigger_else = {
					has_character_flag = passed_provincial_exam
				}
				is_available_imperial_examiner_trigger = { ATTENDING_CHAR = $HOST$ }
				#It's not one of our dedicated examiners
				save_temporary_scope_as = char_check
				scope:activity = {
					NOT = {
						is_target_in_variable_list = {
							name = imperial_examiners_list
							target = scope:char_check
						}
					}
				}
			}
			order_by = imperial_examination_entry_value
			max = examiners_amount
			check_range_bounds = no #Don't care if this is 0
			save_temporary_scope_as = temp_char
			#Yes we do it this way to pull in people who might not be interested in being Entrants	
			scope:activity = {
				add_to_variable_list = {
					name = imperial_examiners_list
					target = scope:temp_char
				}
			} 
		}
	}
	#Check for available landed rulers visiting the event (AI only)
	if = {
		limit = {
			scope:activity = {
				OR = {
					NOT = { has_variable_list = imperial_examiners_list }
					variable_list_size = {
						name = imperial_examiners_list
						value < examiners_amount
					}
				}
			}
		}
		#List exists
		scope:activity = {
			if = {
				limit = {
					has_variable_list = imperial_examiners_list
					variable_list_size = {
						name = imperial_examiners_list
						value < examiners_amount
					}
				}
				while = {
					limit = {
						variable_list_size = {
							name = imperial_examiners_list
							value < examiners_amount
						}
						any_attending_character = {
							location = scope:location
							this != scope:host
							is_ai = yes
							tgp_gender_can_be_exam_entrant_trigger = yes
							trigger_if = {
								limit = {
									scope:activity = {
										has_activity_type = activity_imperial_examination
									}
								}
								has_character_flag = passed_metropolitan_exam
							}
							trigger_else = {
								has_character_flag = passed_provincial_exam
							}
						}
					}
					random_attending_character = {
						limit = {
							location = scope:location
							is_ai = yes
							this != scope:host
							tgp_gender_can_be_exam_entrant_trigger = yes
							trigger_if = {
								limit = {
									scope:activity = {
										has_activity_type = activity_imperial_examination
									}
								}
								has_character_flag = passed_metropolitan_exam
							}
							trigger_else = {
								has_character_flag = passed_provincial_exam
							}
						}
						save_scope_as = new_examiner
					}
					#Yes we do it this way to pull in people who might not be interested in being Entrants
					add_to_variable_list = {
						name = imperial_examiners_list
						target = scope:new_examiner
					}
				}
			}
			#List doesn't exist
			else = {
				while = {

As written in game/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt.

The first 120 of its 429 lines; the rest is in game/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt from line 797.

Where it is used

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

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.

Spotted a mistake on this page?