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

head_of_faith_set_up_change_core_tenet_effect

head_of_faith_set_up_change_core_tenet_effect = yes

game/common/scripted_effects/11_dlc_pam_scripted_effects.txt, line 746 (209 lines). No parameters.

head_of_faith_set_up_change_core_tenet_effect is a scripted effect in Crusader Kings III, in the By God Alone files, written at line 746 of its file. It takes no parameters: head_of_faith_set_up_change_core_tenet_effect = yes. The game's script calls it in 1 place, among them head_of_faith_change_core_tenet_effect (scripted effect). Patch 1.20.1.2, from game/common/scripted_effects/11_dlc_pam_scripted_effects.txt.

The comment above it in the file

used by code, do not rename or remove. DO NOT CHANGE THE GAME STATE OR ADD ARGUMENTS - only set tenet_to_add and tenet_to_remove in scope.

What it does

  • Else, if all of these hold:
    • Conditions:
    • Then › Every desired tenet:
      • Where:
        • scope:actor.rite:
          • rite_can_choose_tenet = scope:tenet_check
        • pam_tenet_ai_may_permit_trigger = { CHARACTER = scope:actor }
        • None of these

          • scope:actor.rite: The rite has the tenet scope:tenet check
          • scope:actor.faith.main_rite:
            • has_tenet_status = { tenet = scope:tenet_check status = prohibited }
      • selection_count = 97
      • only_positive = no
  • Else, if all of these hold:
    • Conditions:
    • Then:
      • scope:tenet_patron › Every desired tenet:
        • Only some of them (the filter is in the script below)
        • selection_count = 97
        • only_positive = no
      • Every desired tenet:
        • Where:
          • scope:actor.rite:
            • rite_can_choose_tenet = scope:tenet_check
          • pam_tenet_ai_may_permit_trigger = { CHARACTER = scope:actor }
          • None of these

            • scope:actor.rite: The rite has the tenet scope:tenet check
            • scope:actor.faith.main_rite:
              • has_tenet_status = { tenet = scope:tenet_check status = prohibited }
        • selection_count = 97
        • only_positive = no
  • If

    Then

    • puppeteer = { … }

• 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)
head_of_faith_set_up_change_core_tenet_effect = {
	save_scope_as = actor
	if = { # Players don't swap tenets like this
		limit = {
			is_ai = no
		}
	}
	else_if = { # Pious candidates take what feels the best
		limit = {
			has_realm_law = theocratic_elective_succession_law
			pam_is_college_election_candidate_trigger = { SOURCE = theocratic_elective_pious }
		}
		ordered_personal_tenet = {
			limit = {
				save_temporary_scope_as = tenet_check
				scope:actor.rite = { rite_can_choose_tenet = scope:tenet_check }
				pam_tenet_ai_may_permit_trigger = { CHARACTER = scope:actor }
				NOR = {
					scope:actor.rite = { rite_has_tenet = scope:tenet_check }
					scope:actor.faith.main_rite = {
						has_tenet_status = {
							tenet = scope:tenet_check
							status = prohibited
						}
					}
				}
			}
			order_by = pam_tenet_popularity_impact_value
			position = 0
			save_scope_as = tenet_to_add
		}
		# Nothing they personally hold is still available, so settle for whatever else suits them
		every_desired_tenet = {
			selection_count = 97
			only_positive = no
			limit = {
				NOT = { exists = scope:tenet_to_add }
				save_temporary_scope_as = tenet_check
				scope:actor.rite = { rite_can_choose_tenet = scope:tenet_check }
				pam_tenet_ai_may_permit_trigger = { CHARACTER = scope:actor }
				NOR = {
					scope:actor.rite = { rite_has_tenet = scope:tenet_check }
					scope:actor.faith.main_rite = {
						has_tenet_status = {
							tenet = scope:tenet_check
							status = prohibited
						}
					}
				}
			}
			save_scope_as = tenet_to_add
		}
	}
	else_if = { # Powerful candidates impose their puppeteer's creed, or their own when nobody pulls the strings
		limit = {
			pam_is_college_election_candidate_trigger = { SOURCE = theocratic_elective_powerful }
		}
		if = {
			limit = {
				exists = puppeteer
			}
			puppeteer = {
				save_temporary_scope_as = tenet_patron
			}
		}
		else = {
			save_temporary_scope_as = tenet_patron
		}
		scope:tenet_patron = {
			# What the patron actually professes comes first
			ordered_personal_tenet = {
				limit = {
					save_temporary_scope_as = tenet_check
					scope:actor.rite = { rite_can_choose_tenet = scope:tenet_check }
					trigger_if = {
						limit = { scope:tenet_patron = scope:actor }
						pam_tenet_ai_may_permit_trigger = { CHARACTER = scope:actor }
					}
					NOR = {
						scope:actor.rite = { rite_has_tenet = scope:tenet_check }
						scope:actor.faith.main_rite = {
							has_tenet_status = {
								tenet = scope:tenet_check
								status = prohibited
							}
						}
					}
				}
				order_by = pam_tenet_popularity_impact_value
				position = 0
				save_scope_as = tenet_to_add
			}
			# Nothing they personally hold is still available, so settle for whatever else suits them
			every_desired_tenet = {
				selection_count = 97
				only_positive = no
				limit = {
					NOT = { exists = scope:tenet_to_add }
					save_temporary_scope_as = tenet_check
					scope:actor.rite = { rite_can_choose_tenet = scope:tenet_check }
					trigger_if = {
						limit = { scope:tenet_patron = scope:actor }
						pam_tenet_ai_may_permit_trigger = { CHARACTER = scope:actor }
					}
					NOR = {
						scope:actor.rite = { rite_has_tenet = scope:tenet_check }
						scope:actor.faith.main_rite = {
							has_tenet_status = {
								tenet = scope:tenet_check
								status = prohibited
							}
						}
					}
				}
				save_scope_as = tenet_to_add
			}
		}
		# A puppeteer with nothing left to ask for leaves the candidate to his own conscience
		every_desired_tenet = {
			selection_count = 97

As written in game/common/scripted_effects/11_dlc_pam_scripted_effects.txt.

The first 120 of its 209 lines; the rest is in game/common/scripted_effects/11_dlc_pam_scripted_effects.txt from line 746.

Where it is used

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

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