Wiki

effect · set_politics

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

set_politics: 
ruling_party = key of new ruling ideology
elections_allowed = yes/no
optional (renames the ruling party and displays correct loc):
long_name = loc_key
name = loc_key

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_politics is commonly used in national focuses, decisions, or events to forcibly switch the ruling party's ideology, such as in scenarios involving coups, revolutions, or regime changes due to diplomatic pressure. It allows you to set the ruling ideology and control the elections toggle in one step, avoiding state inconsistencies from manually adjusting individual elements.

# Example: Trigger a communist coup through a national focus
focus = {
    id = GER_communist_revolution
    ...
    completion_reward = {
        set_politics = {
            ruling_party = communism
            elections_allowed = no
            long_name = "GER_communist_party_long"
            name = "GER_communist_party"
        }
    }
}

Synergy

  • [add_popularity](/wiki/effect/add_popularity) — After switching the ruling party, the support for the previous ruling ideology often remains low. You need to simultaneously boost the popularity of the new ruling party; otherwise, the in-game displayed support rate will be out of sync with the ruling status.
  • [add_ideas](/wiki/effect/add_ideas) — After a regime change, you typically need to add corresponding ideological national spirits or policy ideas. Combining this with set_politics creates a complete political system transition logic.
  • [remove_ideas](/wiki/effect/remove_ideas) — Legacy ideas from the old regime should be removed after the switch. Used in conjunction with set_politics, this ensures political consistency before and after the transition (the inverse operation corresponding to add_ideas in the whitelist; be careful about command names when actually using it).
  • [has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology) — Use this trigger to check the current leader's ideology before switching politics, avoiding redundant execution on countries that already match the target ideology and reducing unnecessary log overhead.

Common Pitfalls

  1. ruling_party takes an ideology group key (such as communism, democratic, fascism, neutrality), not a specific faction or party name. Newcomers often mistakenly fill in localization strings or custom faction names, resulting in script errors or silent failures.
  2. The long_name and name fields take localization keys, not direct display text. If the corresponding key does not exist in the .yml localization file, the game will display the raw key string instead of the expected name, and will not throw an obvious error, making troubleshooting difficult.