Wiki

effect · set_legitimacy

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

set_legitimacy = 10. Sets legitimacy on scope country to specified value. Value has to be 0-100.

Hands-On Notes

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.

Hands-On Usage

set_legitimacy is commonly used in events or decisions to directly reset the legitimacy value of a puppet state or monarchy, such as zeroing legitimacy after a coup or maxing it to 100 upon completing a national focus. Unlike the cumulative approach of add_legitimacy, this command forcibly overwrites the value, making it suitable for scenarios requiring precise control over initial states.

country_event = {
    id = my_mod.10
    # ...
    option = {
        name = my_mod.10.a
        # Coup successful, legitimacy plummets
        set_legitimacy = 15
    }
}

Synergy

  • [add_legitimacy](/wiki/effect/add_legitimacy) — Complements set_legitimacy: use set_legitimacy first to establish a baseline, then apply add_legitimacy for dynamic adjustments to avoid overflow from successive additions.
  • [add_stability](/wiki/effect/add_stability) — Legitimacy and stability typically shift in tandem; when depicting regime upheaval or consolidation, both are often adjusted together.
  • [has_country_flag](/wiki/trigger/has_country_flag) — Check flags before executing set_legitimacy to ensure the same event chain doesn't trigger multiple times, preventing the value from being overwritten repeatedly.
  • [add_popularity](/wiki/effect/add_popularity) — When legitimacy drops sharply, it is usually accompanied by changes in the ruling party's support; pairing these two creates a more authentic political landscape.

Common Pitfalls

  1. Out-of-range values produce no error but abnormal behavior: passing values less than 0 or greater than 100 triggers no error, but produces unexpected results in-game. Always ensure all input values (including variable calculations) stay within the 0–100 range.
  2. Misuse outside COUNTRY scope: set_legitimacy only works at country scope; placing it inside state loops like every_owned_state silently fails. Novices often struggle to find the cause of non-functioning commands due to scope hierarchy confusion.