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_existing_hof_effect

set_up_dynamic_spiritual_hof_title_existing_hof_effect = { CREATOR = … RELIGIOUS_HEAD = … }

game/common/scripted_effects/00_religion_effects.txt, line 606 (72 lines). Parameters: $CREATOR$, $RELIGIOUS_HEAD$.

set_up_dynamic_spiritual_hof_title_existing_hof_effect is a scripted effect in Crusader Kings III, written at line 606 of its file. A call passes 2 parameters: CREATOR and RELIGIOUS_HEAD. The game's script calls it in 2 places, among them The New … Priesthood (event middle_east_decisions.0007) and The Old Man of the Mountain (event hasan_sabbah.1050). 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 }
  • 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

• 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 (72 lines of game script)
set_up_dynamic_spiritual_hof_title_existing_hof_effect = {

	$RELIGIOUS_HEAD$ = { save_scope_as = new_religious_head }

	# Sort scopes & starting processes.
	faith = { save_scope_as = my_faith }
	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
	}

	# Nab a suitable character.
	# The decision already chose one.

	# Try to land the new title.
	scope:my_faith = {
		random_holy_site_barony = {
			limit = { county.holder = $CREATOR$ }
			alternative_limit = {
				county.holder = { target_is_liege_or_above = $CREATOR$ }
			}
			alternative_limit = {
				county.holder = {
					faith = $CREATOR$.faith
					is_ai = 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 }
	# We enclose the law safeguard in an if statement to prevent errors when this is only _about_ to be fired.
	hidden_effect = {
		if = {
			limit = { exists = scope:new_religious_head }
			scope:new_religious_head = {
				if = {
					limit = {
						NOT = { has_realm_law = same_faith_theocratic_succession_law }
					}
					add_realm_law_skip_effects = same_faith_theocratic_succession_law
				}
			}
		}
	}
}

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

Where it is used

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

Events (2)

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?