Wiki

effect · every_controlled_state

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on every State controlled by the country in scope (or \"random_select_amount\" of random state if specified) that fulfills the \"limit\" trigger.
tooltip=key can be added to override tooltip title.
By default the effects are only displayed once, you may display them for each matching state with display_individual_scopes.
ex:
SOV = {
	every_controlled_state = {
		tooltip = my_loc_key # Optional
		random_select_amount = 3 # Optional
		display_individual_scopes = yes # Optional - default = no
		... state scope effects ...
	}
}

实战 · 配合 · 坑

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

实战用法

every_controlled_state 常用于事件或决策中批量修改所有受控州的属性,例如在占领事件中统一提升顺从度、降低抵抗度,或在战争胜利后为所有控制州添加建筑。也常用于 mod 中初始化阶段对某国所有控制州批量打标记或改变分类。

# 苏联在特定决策后对所有控制州降低抵抗度并提升顺从度
SOV = {
    every_controlled_state = {
        limit = {
            is_controlled_by = SOV
            resistance > 20
        }
        add_resistance = -10
        add_compliance = 5
    }
}

配合关系

  • is_controlled_by:在 limit 块中用于进一步筛选真正由目标国控制的州,避免在联合控制或临时占领情况下误操作。
  • add_compliance:批量对所有受控州提升顺从度,是该迭代器最常见的组合用途之一。
  • set_state_flag:在循环内为每个满足条件的州打标记,供后续触发器或事件检查使用。
  • set_occupation_law:统一为所有受控州设置占领法,常见于政策决策或游戏开局初始化脚本。

常见坑

  1. 未加 limit 导致波及范围过广every_controlled_state 会对所有受控州执行效果,若不加 limit 限定条件,即使是本国核心州或首都州也会被影响,容易造成逻辑错误;务必在 limit 中精确筛选目标州。
  2. every_owned_state 混淆:控制(controlled)≠ 拥有(owned),该命令作用于控制州而非领土州,若目标是己方核心领土(owned but not controlled 的情况同样存在),应根据实际需求选择正确的迭代器,否则效果可能不覆盖预期的州。

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

every_controlled_state is commonly used in events or decisions to batch-modify properties across all controlled states — for example, uniformly raising compliance and lowering resistance during occupation events, or adding buildings to every controlled state after a war victory. It is also frequently used in mod initialization scripts to mass-apply flags or change categories across all states controlled by a given country.

# After a specific decision, the Soviet Union lowers resistance and raises compliance across all controlled states
SOV = {
    every_controlled_state = {
        limit = {
            is_controlled_by = SOV
            resistance > 20
        }
        add_resistance = -10
        add_compliance = 5
    }
}

Synergy

  • is_controlled_by: Used inside a limit block to further filter for states genuinely controlled by the target country, preventing unintended effects in joint-control or temporary occupation scenarios.
  • add_compliance: Batch-raising compliance across all controlled states is one of the most common use cases paired with this iterator.
  • set_state_flag: Sets a flag on each qualifying state inside the loop, making it available for subsequent trigger or event checks.
  • set_occupation_law: Uniformly applies an occupation law to all controlled states; frequently seen in policy decisions or game-start initialization scripts.

Common Pitfalls

  1. Omitting limit causes unintended wide coverage: every_controlled_state applies its effects to every controlled state. Without a limit condition, even core states or the capital will be affected, which can easily introduce logic errors. Always use limit to precisely filter the intended target states.
  2. Confusing it with every_owned_state: Controlled (controlled) ≠ owned (owned). This iterator operates on states the country controls, not states it owns. If your target is the country's own core territory (and cases where states are owned but not controlled also exist), choose the correct iterator based on your actual intent — otherwise the effect may not cover the states you expect.