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

Scripted effect

successful_popular_revolt_outcome_effect

successful_popular_revolt_outcome_effect = { FACTION_LEADER = … SOURCE_GOVERNMENT = … TARGET_TITLE = … }

game/common/scripted_effects/00_faction_effects.txt, line 290 (466 lines). Parameters: $FACTION_LEADER$, $SOURCE_GOVERNMENT$, $TARGET_TITLE$.

successful_popular_revolt_outcome_effect is a scripted effect in Crusader Kings III, written at line 290 of its file. A call passes 3 parameters: FACTION_LEADER, SOURCE_GOVERNMENT and TARGET_TITLE. The game's script calls it in 2 places, among them Rebellion (casus belli) and faction_demand.1001 (event). Patch 1.20.1.2, from game/common/scripted_effects/00_faction_effects.txt.

The comment above it in the file

Shared effect between the Popular Faction's demand event and victory outcome.
Parameters:
$FACTION_LEADER$
$TARGET_TITLE$
$SOURCE_GOVERNMENT$

What it does

  • $FACTION_LEADER$ = { … }
  • If

    • $SOURCE_GOVERNMENT$ = { government_allows = state_faith }
    • $FACTION_LEADER$.culture = scope:faction_target.capital_county.culture
    • $FACTION_LEADER$.rite != scope:faction_target.primary_title.state_rite

    Then

    • $SOURCE_GOVERNMENT$.primary_title = { … }

    Else if

    • $SOURCE_GOVERNMENT$ = { government_allows = state_faith }
    • $FACTION_LEADER$.rite = scope:faction_target.primary_title.state_rite
    • $FACTION_LEADER$.rite != scope:faction_target.rite

    Then

    • $SOURCE_GOVERNMENT$.primary_title = { … }

    Otherwise

    • Every in list:
      • Gains the … Title (faction leader)
      • becomes_independent = { change = scope:change_tooltip }
    • while = { … }
  • If

    • scope:faction_target.top_participant_group:dynastic_cycle:
      • participant_group_type = hegemon_ruler
    • Dynastic Cycle: The current phase counts “Lost Defensive Territorial War Dynastic Cycle Catalyst”

    Then

• 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)
successful_popular_revolt_outcome_effect = {
	# Save scopes for later usage.
	$FACTION_LEADER$ = {
		save_scope_as = faction_leader
		joined_faction = {
			save_scope_as = popular_faction
			every_faction_member = {
				add_to_list = faction_members
			}
			faction_target = {
				save_scope_as = faction_target
			}
		}
		add_to_list = faction_members
	}
	$TARGET_TITLE$ = {
		save_scope_as = some_title
	}
	if = { # Populists factions in an admin realm should aim to change state rite, if they are of the capital culture
		limit = {
			$SOURCE_GOVERNMENT$ = { government_allows = state_faith }
			$FACTION_LEADER$.culture = scope:faction_target.capital_county.culture
			$FACTION_LEADER$.rite != scope:faction_target.primary_title.state_rite
		}

		$SOURCE_GOVERNMENT$.primary_title = {
			# Change the state rite
			set_state_rite = $FACTION_LEADER$.rite
			pam_tenet_popularity_boost_rite_effect = { RITE = state_rite }

			# Try grabbing someone from the line of succession who practices the State Rite
			if = {
				limit = {
					any_title_heir = {
						rite = $FACTION_LEADER$.rite
					}
				}
				ordered_title_heir = {
					order_by = "appointment_candidate_score(prev)"
					limit = {
						rite = $FACTION_LEADER$.rite
					}
					save_scope_as = new_ruler
				}
			}
			# Otherwise, make the peasant leader the new emperor
			else = { $FACTION_LEADER$ = { save_scope_as = new_ruler } }

			# Actually make the switch
			create_title_and_vassal_change = {
				type = conquest_populist
				save_scope_as = change
			}
			# Transfer all titles to heir of primary title if only one governorship is held
			hidden_effect = {
				$SOURCE_GOVERNMENT$ = {
					every_held_title = {
						title_tier >= county
						limit = {
							is_landless_type_title = no
							is_noble_family_title = no
						}
						change_title_holder_include_vassals = {
							holder = scope:new_ruler
							change = scope:change
							take_baronies = no
						}
					}
				}
			}
			resolve_title_and_vassal_change = scope:change
		}
	}
	else_if = { # Populists factions of the state rite in an admin realm where the emperor is of a heretical rite simply take the empire
		limit = {
			$SOURCE_GOVERNMENT$ = { government_allows = state_faith }
			$FACTION_LEADER$.rite = scope:faction_target.primary_title.state_rite
			$FACTION_LEADER$.rite != scope:faction_target.rite
		}

		$SOURCE_GOVERNMENT$.primary_title = {

			$FACTION_LEADER$ = { save_scope_as = new_ruler }

			# Actually make the switch
			create_title_and_vassal_change = {
				type = conquest_populist
				save_scope_as = change
			}
			# Transfer all titles to heir of primary title if only one governorship is held
			hidden_effect = {
				$SOURCE_GOVERNMENT$ = {
					every_held_title = {
						title_tier >= county
						limit = {
							is_landless_type_title = no
							is_noble_family_title = no
						}
						change_title_holder_include_vassals = {
							holder = scope:new_ruler
							change = scope:change
							take_baronies = no
						}
					}
				}
			}
			resolve_title_and_vassal_change = scope:change
		}
	}
	else = { # Otherwise we run the normal script
		# Compile a list of all counties belonging to the faction.
		scope:popular_faction = {
			every_faction_county_member = {
				limit = {
					holder.top_liege ?= scope:faction_target
				}
				duchy = {
					if = {
						limit = { holder.top_liege ?= scope:faction_target }
						add_to_list = seized_duchies

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

The first 120 of its 466 lines; the rest is in game/common/scripted_effects/00_faction_effects.txt from line 290.

Where it is used

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

Casus belli (1)

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