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

Scripted effect

efg_recalculate_contested_empire_for_faith_effect

efg_recalculate_contested_empire_for_faith_effect = yes

game/common/scripted_effects/00_empire_faith_gate_effects.txt, line 11 (70 lines). No parameters.

efg_recalculate_contested_empire_for_faith_effect is a scripted effect in Crusader Kings III, written at line 11 of its file. It takes no parameters: efg_recalculate_contested_empire_for_faith_effect = yes. The game's script calls it in 3 places, among them on_title_destroyed (on action), on_title_gain (on action) and on_vassal_change (on action). Patch 1.20.1.2, from game/common/scripted_effects/00_empire_faith_gate_effects.txt.

The comment above it in the file

Scope = reference character whose faith group should be recalculated

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 (70 lines of game script)
efg_recalculate_contested_empire_for_faith_effect = {
	if = {
		limit = { empire_faith_gate_enabled_trigger = yes }
		every_in_global_list = {
			variable = efg_empire_holders
			limit = {
				is_alive = yes
				is_landed = yes
				highest_held_title_tier >= tier_empire
				faith = root.faith
			}
			save_temporary_scope_as = efg_ruler
			if = {
				limit = {
					faith_has_existing_empire_holder_trigger = yes
					has_contested_empire_trigger = yes
					# Skip characters still in pending; empire_faith_gate.0002 applies them.
					NOT = { exists = var:efg_modifier_pending_end_year }
					any_in_global_list = {
						variable = efg_empire_holders
						efg_same_faith_empire_holder_trigger = yes
						count >= 2
					}
				}
				if = {
					limit = {
						any_in_global_list = {
							variable = efg_empire_holders
							efg_same_faith_empire_holder_trigger = yes
							count >= 4
						}
					}
					add_character_modifier = { modifier = multi_empire_same_faith_penalty_3 }
				}
				else_if = {
					limit = {
						any_in_global_list = {
							variable = efg_empire_holders
							efg_same_faith_empire_holder_trigger = yes
							count >= 3
						}
					}
					add_character_modifier = { modifier = multi_empire_same_faith_penalty_2 }
				}
				else = {
					add_character_modifier = { modifier = multi_empire_same_faith_penalty_1 }
				}
			}
			else_if = {
				limit = {
					OR = {
						has_contested_empire_trigger = yes
						has_variable = efg_modifier_pending_end_year
					}
					OR = {
						NOT = { faith_has_existing_empire_holder_trigger = yes }
						NOT = {
							any_in_global_list = {
								variable = efg_empire_holders
								efg_same_faith_empire_holder_trigger = yes
								count >= 2
							}
						}
					}
				}
				efg_remove_contested_empire_modifiers_effect = yes
			}
		}
	}
}

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

Where it is used

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

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

  • on_title_destroyed
  • on_title_gain
  • on_vassal_change

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