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

Scripted effect · By God Alone files

pam_establish_antipope_effect

pam_establish_antipope_effect = { ANTIPOPE = … SPONSOR = … }

game/common/scripted_effects/pam_antipope_effects.txt, line 68 (197 lines). Parameters: $ANTIPOPE$, $SPONSOR$.

pam_establish_antipope_effect is a scripted effect in Crusader Kings III, in the By God Alone files, written at line 68 of its file. A call passes 2 parameters: ANTIPOPE and SPONSOR. The game's script calls it in 2 places, among them A Rival … (event pam_antipope_events.0001) and The Old Man of the Mountain (event hasan_sabbah.1050). Patch 1.20.1.2, from game/common/scripted_effects/pam_antipope_effects.txt.

The comment above it in the file

Raises $ANTIPOPE$ as an independent rival Head of Faith, sponsored by $SPONSOR$

What it does

• 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)
pam_establish_antipope_effect = {
	$ANTIPOPE$ = { save_scope_as = antipope }
	$SPONSOR$ = { save_scope_as = sponsor }
	# A sponsored antipope takes up their sponsor's rite
	if = {
		limit = {
			scope:antipope != scope:sponsor
			scope:antipope = {
				NOT = { rite = scope:sponsor.rite }
			}
		}
		scope:antipope = {
			set_character_rite = scope:sponsor.rite
		}
	}
	if = {
		limit = { exists = scope:antipope.capital_county }
		scope:antipope.capital_county = { save_scope_as = capital_county }
	}
	else = {
		scope:sponsor.capital_county = { save_scope_as = capital_county }
	}
	scope:antipope = {
		faith = { save_scope_as = pam_antipope_faith }
		if = {
			limit = { exists = capital_province }
			capital_province = { save_scope_as = pam_antipope_capital }
		}
		hidden_effect_new_object = {
			if = {
				limit = {
					faith.religious_head_title.tier = tier_kingdom
				}
				create_dynamic_title = {
					tier = kingdom
					name = {
						first_valid = {
							triggered_desc = {
								trigger = { exists = scope:pam_antipope_capital }
								desc = PAM_ANTIPOPE_TITLE_NAME
							}
							desc = PAM_ANTIPOPE_TITLE_NAME_NO_CAPITAL
						}
					}
				}
			}
			else = {
				create_dynamic_title = {
					tier = duchy
					name = {
						first_valid = {
							triggered_desc = {
								trigger = { exists = scope:pam_antipope_capital }
								desc = PAM_ANTIPOPE_TITLE_NAME
							}
							desc = PAM_ANTIPOPE_TITLE_NAME_NO_CAPITAL
						}
					}
				}
			}
			scope:new_title = {
				save_scope_as = pam_antipope_title
				# Faith challenger list is dropped by code if the rite detaches into its own faith
				set_variable = { name = pam_antipope_office }
				set_destroy_if_invalid_heir = yes
				set_no_automatic_claims = yes
				set_definitive_form = yes
				set_always_follows_primary_heir = yes
				set_can_be_named_after_dynasty = no
				set_capital_county = scope:capital_county
				set_landless_title = yes
			}
			create_title_and_vassal_change = {
				type = created
				save_scope_as = pam_antipope_title_change
				add_claim_on_loss = no
			}
			scope:pam_antipope_title = {
				change_title_holder = {
					holder = scope:antipope
					change = scope:pam_antipope_title_change
				}
			}
			resolve_title_and_vassal_change = scope:pam_antipope_title_change
			# Needs a holder before it can derive a coat of arms
			scope:pam_antipope_title = {
				generate_coa = religious_title
			}
			set_primary_title_to = scope:pam_antipope_title
		}
		# GOVERNMENT
		if = {
			limit = {
				NOT = { government_has_flag = government_is_theocracy }
				scope:sponsor != this
				theocratic_lay_clergy_trigger = yes
				trigger_if = {
					limit = {
						rite = { rite_has_doctrine = doctrine_theocracy_lay_clergy }
					}
					is_landed = no
				}
			}
			if = {
				limit = { religion = religion:christianity_religion }
				change_government = ecclesiastical_government
			}
			else = { change_government = theocracy_government }
		}
		# A rival Head of Faith answers to no secular liege
		if = {
			limit = { NOT = { this = top_liege } }
			create_title_and_vassal_change = {
				type = independency
				save_scope_as = pam_antipope_independence_change
				add_claim_on_loss = no
			}
			becomes_independent = { change = scope:pam_antipope_independence_change }
			resolve_title_and_vassal_change = scope:pam_antipope_independence_change
		}

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

The first 120 of its 197 lines; the rest is in game/common/scripted_effects/pam_antipope_effects.txt from line 68.

Where it is used

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

Events (2)

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