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
}

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

set_popularities 常用于事件或国策触发后彻底重置一国的意识形态版图,例如模拟政变、革命或和平演变剧情。与 add_popularity 的逐步增减不同,它一次性覆盖所有意识形态支持率,适合需要"从零开始"的场景。

# 国策完成后触发内战前的意识形态重组
country_event = {
    id = my_mod.5
    immediate = {
        set_popularities = {
            democratic   = 20
            communism    = 35
            fascism      = 30
            neutrality   = 15
        }
    }
}

配合关系

  • [add_popularity](/wiki/effect/add_popularity) — 若只需微调某一意识形态而不想清零其他派系,可先用 set_popularities 奠定基础分布,再用 add_popularity 做精细修正。
  • [has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology) — 常作为前置条件检查当前执政意识形态,确保只在特定政权下才触发支持率的大幅重置。
  • [add_ideas](/wiki/effect/add_ideas) — 政局重置往往伴随新政策或意识形态 idea 的切换,两者搭配可同步更新国家修正值。
  • [country_event](/wiki/effect/country_event) — 支持率骤变后紧接触发后续事件链,推动 AI 或玩家做出政治响应。

常见坑

  1. 总和必须精确为 100:所有列出意识形态的数值之和若不等于 100(包括小数累计误差),游戏会直接报错或静默失效;未列出的意识形态会被自动归零,因此不能只写想改的那几项然后期望其余保持原值。
  2. 在非 COUNTRY scope 中调用会失效:该命令只能在国家 scope 下执行,若在 every_owned_state 等州级循环体内误写此命令,脚本不会报显式错误但效果不会生效,排查时极易遗漏。

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.