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

Scripted effect

peasant_faction_demands_enforced

peasant_faction_demands_enforced = { FACTION = … }

game/common/scripted_effects/00_faction_effects.txt, line 1515 (146 lines). Parameters: $FACTION$.

peasant_faction_demands_enforced is a scripted effect in Crusader Kings III, written at line 1515 of its file. A call passes 1 parameter: FACTION. The game's script calls it in 2 places, among them Peasant War (casus belli) and faction_demand.1101 (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_faction_effects.txt.

What it does

  • $FACTION$ ?= { … }
  • If

    • scope:peasant_demands_defender != scope:peasant_demands_defender.top_liege
    • scope:peasant_demands_defender.top_liege.top_participant_group:dynastic_cycle:
      • participant_group_type = hegemon_ruler

    Then

    • $FACTION$ = { … }
    • scope:peasant_demands_defender:
      • If

        • scope:peasant_demands_defender.top_liege › Any targeting faction:
          • faction_type = escalated_peasant_faction

        Then

        • scope:peasant_demands_defender.top_liege:
          • Every in list:
            • title_join_faction = scope:escalated_faction
          • scope:attacker:
            • join_faction_skip_check = scope:escalated_faction

        Otherwise

        • scope:attacker:
          • create_faction = { type = escalated_peasant_faction target = scope:peasant_demands_defender.top_liege }
        • scope:peasant_demands_defender.top_liege › One random targeting faction:
          • faction_type = escalated_peasant_faction
          • set_special_character = scope:attacker
        • All Counties will join an Escalated Peasant Faction against …

    Otherwise

    • $FACTION$ = { … }

• 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)
peasant_faction_demands_enforced = {
	# escalate if in the Cycle
	# The double ?= are intended because $FACTION$ can be garbled data in very rare cases
	$FACTION$ ?= {
		faction_target ?= { save_scope_as = peasant_demands_defender }
	}
	if = {
		limit = {
			exists = scope:peasant_demands_defender
			exists = scope:peasant_demands_defender.top_liege
			scope:peasant_demands_defender != scope:peasant_demands_defender.top_liege
			#only in Dynastic Cycle
			scope:peasant_demands_defender.top_liege.top_participant_group:dynastic_cycle ?= {
				participant_group_type = hegemon_ruler
			}
		}
		scope:peasant_demands_defender.top_liege = {
			set_variable = {
				name = peasant_war_escalates
				days = 365
			}
		}
		$FACTION$ = {
			faction_leader = {
				save_scope_as = attacker
				add_character_flag = peasant_revolt_do_not_kill
				set_variable = {
					name = peasant_war_escalates
					days = 365
				}
				add_trait_xp = {
					trait = peasant_leader
					value = 20
				}
			}
			every_faction_county_member = {
				add_to_list = faction_counties
				add_county_modifier = {
					modifier = peasant_war_lost_county_modifier
					years = 10
				}
			}
			destroy_faction = yes
		}
		scope:peasant_demands_defender = {
			if = {
				limit = {
					NOT = { exists = scope:attacker }
				}
				scope:peasant_leader = {
					save_scope_as = attacker
				}
			}
			if = {
				limit = {
					scope:peasant_demands_defender.top_liege = {
						any_targeting_faction = {
							faction_type = escalated_peasant_faction
							save_temporary_scope_as = escalated_faction
						}
					}
				}
				scope:peasant_demands_defender.top_liege = {
					send_interface_message = {
						type = msg_faction_grows
						left_icon = scope:attacker
						right_icon = scope:peasant_demands_defender
						every_in_list = {
							list = faction_counties
							title_join_faction = scope:escalated_faction
						}
						scope:attacker = {
							join_faction_skip_check = scope:escalated_faction
						}
					}
				}
			}
			else = {
				scope:attacker = {
					create_faction = {
						type = escalated_peasant_faction
						target = scope:peasant_demands_defender.top_liege
					}
				}
				scope:peasant_demands_defender.top_liege = {
					random_targeting_faction = {
						faction_type = escalated_peasant_faction
						save_scope_as = escalated_faction
						set_special_character = scope:attacker
					}
				}
				custom_tooltip = {
					text = county_and_leader_join_faction_against_top_liege
					if = {
						limit = {
							exists = scope:escalated_faction
						}
						every_in_list = {
							list = faction_counties
							limit = {
								title_is_a_faction_member = no
							}
							title_join_faction = scope:escalated_faction
						}
						scope:attacker = {
							set_variable = {
								name = rebel_leader_peasants
								value = scope:escalated_faction
							}
							if = {
								limit = {
									NOT = {
										scope:escalated_faction = {
											any_faction_member = { this = scope:attacker }
										}
									}
								}
								join_faction_skip_check = scope:escalated_faction
							}
							primary_title = {

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

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

Where it is used

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

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?