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

Scripted effect

determine_ghw_target_effect

determine_ghw_target_effect = { FAITH = … }

game/common/scripted_effects/00_religious_interaction_effects.txt, line 241 (188 lines). Parameters: $FAITH$.

determine_ghw_target_effect is a scripted effect in Crusader Kings III, written at line 241 of its file. A call passes 1 parameter: FAITH. The game's script calls it in 2 places, among them great_holy_war.0001 (event) and great_holy_war.0004 (event). Patch 1.20.1.2, from game/common/scripted_effects/00_religious_interaction_effects.txt.

The comment above it in the file

Saves the target kingdom to scope:target_kingdom, and the target character to scope:target_character

What it does

  • random_log_scopes = yes
  • scope:target_kingdom › One random in de jure hierarchy:
    • Where:
      • Title tier exactly County
      • $FAITH$.main_rite = { … }
      • Their holder:
        • Highest held Title is at least 4 Rank
        • Realm county (at least 5):
    • continue = { tier > tier_county }

• 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)
determine_ghw_target_effect = {
	# Find every *possible* kingdom
	$FAITH$ = {
		save_temporary_scope_value_as = {
			name = faith_strength
			value = faith_military_strength
		}
	}
	#1178 Catholics target the Holy Land, to support Kingdom of Jerusalem and make Fourth Crusade more likely to trigger
	if = {
		limit = {
			#Definitely hasn't been a crusade already
			NOR = {
				has_global_variable = frankokratia_occurred
				has_global_variable = cath_crusade_1
			}
			game_start_date = 1178.10.1
			$FAITH$ = {
				this = faith:catholic
			}
			#Any holy land kingdom is valid
			any_kingdom = {
				valid_ghw_target_trigger = { FAITH = $FAITH$ }
				OR = {
					title_capital_county.title_province = { geographical_region = world_middle_east_arabia }
					title_capital_county.title_province = { geographical_region = world_middle_east_jerusalem }
					title_capital_county.title_province = { geographical_region = world_asia_minor }
					this = title:k_cyprus
					this = title:k_egypt
				}
			}
		}
		#Most likely to be aiding kingdom of jerusalem
		if = {
			limit = {
				exists = title:k_jerusalem.holder
				title:k_jerusalem.holder = {
					faith = faith:catholic
				}
				any_kingdom = {
					valid_ghw_target_trigger = { FAITH = $FAITH$ }
					OR = {
						title_capital_county.title_province = { geographical_region = world_middle_east_arabia }
						title_capital_county.title_province = { geographical_region = world_middle_east_jerusalem }
						title_capital_county.title_province = { geographical_region = world_asia_minor }
						this = title:k_cyprus
						this = title:k_egypt
					}
					any_de_jure_county = {
						OR = {
							holder = title:k_jerusalem.holder
							holder.top_liege = title:k_jerusalem.holder
							any_neighboring_county = {
								OR = {
									holder = title:k_jerusalem.holder
									holder.top_liege = title:k_jerusalem.holder
								}
							}
						}
					}
				}
			}
			every_kingdom = {
				limit = {
					valid_ghw_target_trigger = { FAITH = $FAITH$ }
					OR = {
						title_capital_county.title_province = { geographical_region = world_middle_east_arabia }
						title_capital_county.title_province = { geographical_region = world_middle_east_jerusalem }
						title_capital_county.title_province = { geographical_region = world_asia_minor }
						this = title:k_cyprus
						this = title:k_egypt
					}
					any_de_jure_county = {
						OR = {
							holder = title:k_jerusalem.holder
							holder.top_liege = title:k_jerusalem.holder
							any_neighboring_county = {
								OR = {
									holder = title:k_jerusalem.holder
									holder.top_liege = title:k_jerusalem.holder
								}
							}
						}
					}
				}
				add_to_list = potential_kingdoms
			}
		}
		else = {
			every_kingdom = {
				limit = {
					valid_ghw_target_trigger = { FAITH = $FAITH$ }
					OR = {
						title_capital_county.title_province = { geographical_region = world_middle_east_arabia }
						title_capital_county.title_province = { geographical_region = world_middle_east_jerusalem }
						title_capital_county.title_province = { geographical_region = world_asia_minor }
						this = title:k_cyprus
						this = title:k_egypt
					}
				}
				add_to_list = potential_kingdoms
			}
		}
	}
	else = {
		every_kingdom = {
			limit = {
				valid_ghw_target_trigger = { FAITH = $FAITH$ }
			}
			add_to_list = potential_kingdoms
		}
	}
	
	# Pick out the 10 "best" ones
	ordered_in_list = {
		list = potential_kingdoms
		order_by = great_holy_war_target_kingdom_weight
		
		min = 0
		max = 10

As written in game/common/scripted_effects/00_religious_interaction_effects.txt.

The first 120 of its 188 lines; the rest is in game/common/scripted_effects/00_religious_interaction_effects.txt from line 241.

Where it is used

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

Source: game/common/scripted_effects/00_religious_interaction_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?