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

Scripted effect

excommunicate_character

excommunicate_character = { EXCOMMUNICATOR = … REQUESTING_CHARACTER = … TARGET_CHARACTER = … }

game/common/scripted_effects/00_religious_interaction_effects.txt, line 3 (190 lines). Parameters: $EXCOMMUNICATOR$, $REQUESTING_CHARACTER$, $TARGET_CHARACTER$.

excommunicate_character is a scripted effect in Crusader Kings III, written at line 3 of its file. A call passes 3 parameters: EXCOMMUNICATOR, REQUESTING_CHARACTER and TARGET_CHARACTER. The game's script calls it in 4 places, among them Excommunicate (interaction), Request Excommunication (interaction) and fp2_lyonese_monk.0601 (event). Its body carries 1 text of the game's own for the player. Patch 1.20.1.2, from game/common/scripted_effects/00_religious_interaction_effects.txt.

What it does

  • If

    • $REQUESTING_CHARACTER$.faith = $TARGET_CHARACTER$.faith

    Then

    • $TARGET_CHARACTER$ = { … }
    • If

      • scope:target_character.faith.religious_head:
        • One of these

          • this = scope:requesting_character
          • or

            this = scope:excommunicator

      Then

      Otherwise

• 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)
excommunicate_character = {
	if = {
		limit = {
			$REQUESTING_CHARACTER$.faith = $TARGET_CHARACTER$.faith
		}

		$EXCOMMUNICATOR$ = {
			save_scope_as = excommunicator
		}
		$REQUESTING_CHARACTER$ = {
			save_scope_as = requesting_character
		}
		$TARGET_CHARACTER$ = {
			save_scope_as = target_character
			set_variable = {
				name = excommunication_issuer
				value = scope:excommunicator
			}

			# If our religious head was convinced/persuaded to excommunicate us by another ruler, we want to make that clear.
			if = {
				limit = {
					scope:requesting_character != scope:excommunicator
				}
				add_excommunication_actual_effect = yes
				add_opinion = {
					modifier = excommunicated_opinion
					target = scope:excommunicator
					opinion = -30
				}
				add_opinion = {
					modifier = hate_opinion
					target = scope:requesting_character
					opinion = -50
				}
			}
			# Though if our head independently decided to excommunicate us, that should also be clear.
			else = {
				add_excommunication_actual_effect = yes
				add_opinion = {
					modifier = excommunicated_opinion
					target = scope:excommunicator
					opinion = -50
				}
			}

			add_piety_level = -1

			# LEGITIMACY LOSS FROM EXCOMMUNICATION
			excommunication_legitimacy_effect = yes

			if = {
				limit = {
					scope:requesting_character != scope:excommunicator
				}
				# Stored for the excommunication letter event: who asked the Pope to excommunicate you.
				set_variable = {
					name = requested_my_excommunication
					value = scope:requesting_character
				}
			}
			if = {
				limit = {
					empire_faith_gate_enabled_trigger = yes
					has_contested_empire_trigger = yes
					faith_has_existing_empire_holder_trigger = yes
				}
				# Stored for conditional letter text (empire faith gate reason).
				set_variable = {
					name = excommunication_reason
					value = flag:empire_faith_gate
				}
			}
			else_if = {
				limit = {
					scope:requesting_character = scope:excommunicator
					faith.religious_head ?= scope:excommunicator
					OR = {
						has_relation_rival = scope:excommunicator
						has_relation_nemesis = scope:excommunicator
						is_at_war_with = scope:excommunicator
					}
				}
				# Stored for conditional letter text (Pope excommunicated you on his own initiative).
				set_variable = {
					name = excommunication_reason
					value = flag:clergy_hostility
				}
			}

			# Notify other players of interest; the excommunicated player gets the recovery alert instead.
			every_player = {
				limit = {
					faith = scope:target_character.faith
					NOR = {
						this = scope:target_character # Excommunicated player uses action_excommunicated_recovery instead.
						this = scope:requesting_character # Requester already got a response from the Pope.
					}

					save_temporary_scope_as = player
					OR = {
						top_liege = scope:target_character # Our realm's top liege is a character of interest.
						top_liege = {
							any_vassal_or_below = { # Peers of the realm are also characters of interest...
								this = scope:target_character
								OR = {
									NOT = { highest_held_title_tier = 1 } #... unless they're someone else's baron (then they're too inconsequential).
									is_vassal_of = scope:player
								}
							}
						}
						any_close_family_member = {
							this = scope:target_character # Family members are characters of interest, even if not part of our realm.
						}
						any_neighboring_top_liege_realm_owner = {
							this = scope:target_character # Finally, any neighboring realm owners are characters of interest (as we get an excommunication war CB on them, as well as the ability to request claims).
						}
					}
				}
				save_scope_as = this_player

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

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

Where it is used

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

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?