effect · set_stability
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
Sets the stability to the country in scope. Example: set_stability = 80
set_stabilityCOUNTRYnoneSets the stability to the country in scope. Example: set_stability = 80
Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.
set_stability is commonly used in national focuses, decisions, or events to forcefully set stability to a fixed value. For example, resetting stability to a baseline after a civil war concludes, or creating dramatic swings at key story moments for dramatic effect. Unlike add_stability, which performs addition or subtraction, set_stability overwrites the existing value directly—ideal for scenarios requiring "hard-locking" stability.
# Civil war conclusion event: reset stability to 40%
country_event = {
id = civil_war.10
...
option = {
name = civil_war.10.a
set_stability = 0.40 # Set directly to 40%, not incremental change
}
}
[add_stability](/wiki/effect/add_stability): When you need to reset stability to zero first and then fine-tune, use set_stability for the baseline reset and add_stability for subsequent micro-adjustments. Together they enable more flexible stability management.[add_war_support](/wiki/effect/add_war_support): Stability and war support typically shift in tandem. Major story events often require setting both simultaneously to maintain internal consistency of national state.[has_country_flag](/wiki/trigger/has_country_flag): Use flags as preconditions to ensure set_stability fires only once at a specific story stage, preventing duplicate executions that cause numerical anomalies.[add_ideas](/wiki/effect/add_ideas): Certain ideas (advisors/national spirit bonuses) continuously modify stability. Add or remove relevant ideas immediately after set_stability to ensure the final stability matches your design intent.80 represent 80%, but this effect actually expects decimals between 0 and 1 (0.80 is 80%). Writing 80 directly will either cap stability at the upper limit or produce unexpected results. Always confirm you're using decimal notation in your scripts.set_stability sets the base value, but various modifiers applied to the country (from ideas, dynamic modifiers, etc.) stack on top of that base. The actual in-game stability display often differs from the written value. Don't assume the command failed during debugging—verify modifier calculations first.