Scripted effect
on_lost_faction_revolt_war
on_lost_faction_revolt_war = yesgame/common/scripted_effects/00_war_effects.txt, line 1110 (78 lines). No parameters.
on_lost_faction_revolt_war is a scripted effect in Crusader Kings III, written at line 1110 of its file. It takes no parameters: on_lost_faction_revolt_war = yes. The game's script calls it in 11 places, among them Ceremonial Claimant Faction (casus belli), Claimant Faction (casus belli) and Depose (casus belli). Patch 1.20.1.2, from game/common/scripted_effects/00_war_effects.txt.
The comment above it in the file
Imprison all faction-members (rebelling vassals if there's no faction) if they lose a revolt-war and add a revoke reason
What it does
If
a check the game hides
Then
- scope:attacker.joined_faction › Every faction member:
If
a check the game hides
Then
leave_faction_with_cooldown_effect = { FACTION = scope:attacker.joined_faction YEARS = faction_war_defeat_cooldown }
Otherwise
add_faction_cooldown_effect = { YEARS = faction_war_defeat_cooldown }
- scope:attacker.joined_faction › Every faction member:
war = { … }
• 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 (78 lines of game script)
on_lost_faction_revolt_war = {
scope:defender = { save_scope_as = imprisoner }
if = {
limit = {
exists = scope:attacker.joined_faction
}
scope:attacker.joined_faction = {
set_variable = {
name = peasant_destroying
value = yes
}
every_faction_member = {
if = {
limit = {
exists = scope:attacker.joined_faction # Can get destroyed as we loop through
}
leave_faction_with_cooldown_effect = {
FACTION = scope:attacker.joined_faction
YEARS = faction_war_defeat_cooldown
}
}
else = {
add_faction_cooldown_effect = { YEARS = faction_war_defeat_cooldown }
}
}
}
}
war = {
every_war_attacker = {
limit = {
exists = liege
any_liege_or_above = { this = scope:defender }
}
if = {
limit = {
has_title = title:k_chrysanthemum_throne
exists = title:k_chrysanthemum_throne.current_heir
}
title:k_chrysanthemum_throne.current_heir = { save_scope_as = new_emperor }
create_title_and_vassal_change = {
type = revoked
save_scope_as = title_change
}
title:k_chrysanthemum_throne = {
change_title_holder = {
holder = scope:new_emperor
change = scope:title_change
}
}
resolve_title_and_vassal_change = scope:title_change
}
if = { # Imprison them if they aren't imprisoned.
limit = {
is_imprisoned = no
}
hard_imprison_character_effect = {
TARGET = this
IMPRISONER = scope:defender
}
}
scope:defender = {
add_opinion = {
target = prev
modifier = vassal_lost_faction_revolt_war
}
}
hidden_effect = {
#block them from joining factions if they aren't blocked yet, hidden because you should always see it through the effect applied to every_faction_member above
if = {
limit = {
NOT = { has_character_flag = joining_faction_block }
}
add_faction_cooldown_effect = { YEARS = faction_war_defeat_cooldown }
}
}
}
}
}As written in game/common/scripted_effects/00_war_effects.txt.
Where it is used
Every place in common/, events/ and history/ that calls on_lost_faction_revolt_war.
Source: game/common/scripted_effects/00_war_effects.txt and every file of common/, events/ and history/ that calls it, Crusader Kings III 1.20.1.2.