Wiki

effect · set_popularities

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

set popularities for all ideologies in a country. If an ideology is not specified its popularity will be set to zero. The popularities specified must add up to exactly 100

Example:
set_popularities = {
	neutrality = 54.5
	fascism = 45.5
}

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_popularities is commonly used to completely reset a nation's ideological landscape following events or focus tree completion, simulating coups, revolutions, or peaceful transitions. Unlike add_popularity, which makes incremental adjustments, it overwrites all ideology support values in a single operation, making it ideal for scenarios requiring a "clean slate" approach.

# Ideological reorganization triggered before civil war upon focus completion
country_event = {
    id = my_mod.5
    immediate = {
        set_popularities = {
            democratic   = 20
            communism    = 35
            fascism      = 30
            neutrality   = 15
        }
    }
}

Synergy

  • [add_popularity](/wiki/effect/add_popularity) — If you only need to fine-tune a single ideology without zeroing out other factions, establish the baseline distribution with set_popularities first, then make precise adjustments with add_popularity.
  • [has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology) — Commonly used as a precondition to verify the current ruling ideology, ensuring large-scale support shifts only trigger under specific political regimes.
  • [add_ideas](/wiki/effect/add_ideas) — Political restructuring typically accompanies the introduction of new policies or ideological ideas; combining both allows synchronized updates to national modifiers.
  • [country_event](/wiki/effect/country_event) — Chain subsequent events immediately after ideology shifts to drive AI or player political responses.

Common Pitfalls

  1. The total must equal exactly 100: If the sum of all listed ideology values does not equal 100 (including cumulative decimal rounding errors), the game will either throw an error or silently fail; any unlisted ideologies are automatically zeroed out, so you cannot list only the values you want to change and expect the rest to remain unchanged.
  2. Calling outside COUNTRY scope causes failure: This command only executes within country scope. If mistakenly placed inside state-level loops like every_owned_state, the script will not produce an explicit error but the effect simply will not apply, making it extremely easy to miss during debugging.