Hands-On Usage
set_autonomy is commonly used in mod scripting for handling overlord-vassal relationships in event chains, such as post-war treaties, focus tree-triggered independence/annexation sequences, or simulating historical colonial autonomy progressions. The following example shows an overlord nation upgrading a vassal to puppet status through a national focus:
# In the completion effect of a certain nation's focus
set_autonomy = {
target = PHI
autonomy_state = autonomy_puppet
freedom_level = 0.4
end_wars = yes
end_civil_wars = yes
}
Synergy
[has_autonomy_state](/wiki/trigger/has_autonomy_state) — Use before executing set_autonomy to check the target's current autonomy level, preventing duplicate triggers or logical conflicts.
[compare_autonomy_progress_ratio](/wiki/trigger/compare_autonomy_progress_ratio) — Determines whether the autonomy progress ratio meets a threshold to decide whether a tier change should be triggered.
[add_autonomy_score](/wiki/effect/add_autonomy_score) — When paired with set_autonomy, you can accumulate autonomy points first using this effect, then enforce the final state with set_autonomy, simulating a gradual independence process.
[end_puppet](/wiki/effect/end_puppet) — When you need to fully remove a vassal relationship rather than just adjust the tier, it forms a low/high-tier handling option with set_autonomy, flexibly chosen based on your event branch design.
Common Pitfalls
- Incorrect target field causing the effect to fail: The
target field must contain a valid country tag (e.g., ENG) and cannot accept scope keywords (such as THIS, ROOT) — scope keywords only work within the context scope where set_autonomy is executed, while target requires an explicit country tag or variable reference. Confusing the two will cause the effect to silently fail.
- Overlooking war state leading to unintended behavior: Both
end_wars and end_civil_wars default to yes. If the target nation is currently at war and you do not want to forcefully end the war, you must explicitly set end_wars = no. Otherwise, you may unexpectedly terminate wars unrelated to your design, creating hard-to-trace logic bugs.