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

Scripted effect

set_up_dynamic_spiritual_hof_title_effect

set_up_dynamic_spiritual_hof_title_effect = { CREATOR = … }

game/common/scripted_effects/00_religion_effects.txt, line 383 (138 lines). Parameters: $CREATOR$.

set_up_dynamic_spiritual_hof_title_effect is a scripted effect in Crusader Kings III, written at line 383 of its file. A call passes 1 parameter: CREATOR. The game's script calls it in 4 places, among them Conclave: From the Brink (event fp2_lyonese_monk.0841), faith_creation.0002 (event) and on_faith_created (on action). Patch 1.20.1.2, from game/common/scripted_effects/00_religion_effects.txt.

What it does

  • create_dynamic_title = { tier = duchy name = REL_HEAD_TITLE_NAME adj = REL_HEAD_TITLE_ADJ }
  • Otherwise:
    • create_character = { … }
  • If

    a check the game hides

    Then

    • scope:new_title:
      • set_capital_county = scope:holy_site.county
  • Their faith:
    • set_religious_head_title = scope:new_title
  • scope:new_title:
    • generate_coa = religious_title
  • If

    • scope:hof_creator:
      • NOT = { rite = scope:my_faith.main_rite }

    Then

    • scope:hof_creator.rite:
      • set_main_rite = yes

• 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)
set_up_dynamic_spiritual_hof_title_effect = {
	# Sort scopes & starting processes.
	faith = { save_scope_as = my_faith }
	$CREATOR$ = { save_scope_as = hof_creator }
	create_dynamic_title = {
		tier = duchy
		name = REL_HEAD_TITLE_NAME
		adj = REL_HEAD_TITLE_ADJ
	}
	create_title_and_vassal_change = {
		type = created
		save_scope_as = change
		add_claim_on_loss = no
	}
	# Clergy take the title, while lay creators prefer clerical puppets over the realm priest
	if = {
		limit = {
			scope:hof_creator = { is_clergy = yes }
		}
		scope:hof_creator = { save_scope_as = new_religious_head }
	}
	else_if = {
		limit = {
			scope:hof_creator.puppet:theological_agent_puppet ?= {
				rite = scope:hof_creator.rite
			}
		}
		scope:hof_creator.puppet:theological_agent_puppet = {
			save_scope_as = new_religious_head
		}
	}
	else_if = {
		limit = {
			scope:hof_creator.puppet:external_theological_agent_puppet ?= {
				rite = scope:hof_creator.rite
			}
		}
		scope:hof_creator.puppet:external_theological_agent_puppet = {
			save_scope_as = new_religious_head
		}
	}
	else_if = {
		limit = {
			scope:hof_creator.cp:councillor_court_chaplain ?= {
				rite = scope:hof_creator.rite
			}
		}
		scope:hof_creator.cp:councillor_court_chaplain = {
			save_scope_as = new_religious_head
		}
	}
	else_if = {
		limit = {
			any_theocratic_vassal = { faith = $CREATOR$.faith }
		}
		ordered_theocratic_vassal = {
			limit = { faith = $CREATOR$.faith }
			order_by = head_of_faith_selection_weight
			save_scope_as = new_religious_head
		}
	}
	else = {
		create_character = {
			location = $CREATOR$.capital_province
			age = { 30 50 }
			gender_female_chance = root_faith_clergy_gender_female_chance
			trait = education_learning_4
			faith = $CREATOR$.faith
			rite = $CREATOR$.rite
			culture = $CREATOR$.culture
			learning = { 14 22 }
			save_scope_as = new_religious_head
		}
	}
	# Try to land the new title.
	scope:my_faith = {
		random_holy_site_barony = {
			# Prefer a capital that's under $CREATOR$.
			limit = { county.holder = $CREATOR$ }
			# Even if it's indirectly under $CREATOR$.
			alternative_limit = {
				county.holder = { target_is_liege_or_above = $CREATOR$ }
			}
			# Then go for any that's held by someone of the faith.
			alternative_limit = { county.holder.faith = $CREATOR$.faith }
			# Under *extreme* circumstances, pick any holy site with at least some faithful.
			alternative_limit = { county.faith = $CREATOR$.faith }
			# Ok, just pick any of them. We're out of options and we need _somewhere_.
			alternative_limit = { always = yes }
			save_scope_as = holy_site
		}
	}
	if = {
		limit = { exists = scope:holy_site }
		scope:new_title = { set_capital_county = scope:holy_site.county }
	}
	# Configure final effects.
	hidden_effect = {
		scope:new_title = {
			set_landless_title = yes
			set_destroy_if_invalid_heir = yes
			set_no_automatic_claims = yes
			set_definitive_form = yes
			set_always_follows_primary_heir = yes
			change_title_holder = {
				holder = scope:new_religious_head
				change = scope:change
			}
		}
	}
	resolve_title_and_vassal_change = scope:change
	faith = { set_religious_head_title = scope:new_title }
	scope:new_title = { generate_coa = religious_title }
	# The establishing rite becomes the mainline rite of the faith.
	if = {
		limit = {
			scope:hof_creator = {
				exists = rite
				NOT = { rite = scope:my_faith.main_rite }
			}

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

The first 120 of its 138 lines; the rest is in game/common/scripted_effects/00_religion_effects.txt from line 383.

Where it is used

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

Events (2)

On actions (the game's own hooks) (1)

  • on_faith_created

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