Wiki

effect · every_occupied_country

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on every occupied Country by the country in scope (or \"random_select_amount\" of random country 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 country with display_individual_scopes.
ex:
SOV = {
	every_occupied_country = {
		tooltip = my_loc_key # Optional
		random_select_amount = 3 # Optional
		display_individual_scopes = yes # Optional - default = no
		... country scope effects ...
	}
}

实战 · 配合 · 坑

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

实战用法

every_occupied_country 适合在战争结束事件或决议中,对所有被本国占领的国家批量执行同一套效果,例如强制附庸、传播意识形态或清空抵抗。下面示例演示苏联在事件中对每个被占领国降低稳定度并强制设为傀儡:

SOV = {
    every_occupied_country = {
        limit = {
            is_ai = yes
            has_war = no
        }
        set_autonomy = {
            target = SOV
            autonomous_state = autonomy_puppet
        }
        add_stability = -0.10
    }
}

配合关系

  • has_war — 在 limit 内用于过滤掉仍在交战的被占领国,避免对战争中的国家执行不合逻辑的效果。
  • set_autonomy — 批量将被占领国设置为指定自治等级(附庸/殖民地等),是占领后处置的核心命令。
  • add_stability — 对所有被占领国统一调整稳定度,常用于惩罚性事件或占领政策效果。
  • set_politics — 配合循环将被占领国的执政党和流行度统一改写为占领国所属意识形态。

常见坑

  1. scope 方向混淆every_occupied_country 进入子块后 scope 已切换到被占领国,此时在子块内写 set_autonomytarget 应填宗主国标签,而非再次填被占领国自身,否则会产生无效或错误的自治关系。
  2. limit 缺失导致误伤中立国:该命令对"被本国军队占领领土的国家"生效,若不加 limit 过滤(如 exists = yeshas_capitulated = yes),可能意外命中刚刚被少量部队踏足的非预期国家,造成脚本副作用。

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_occupied_country is well-suited for post-war events or decisions where you need to apply the same set of effects to every country currently occupied by the executing nation — for example, forcing puppets, spreading ideology, or clearing resistance. The example below shows the Soviet Union using an event to reduce stability and force-puppet every occupied country:

SOV = {
    every_occupied_country = {
        limit = {
            is_ai = yes
            has_war = no
        }
        set_autonomy = {
            target = SOV
            autonomous_state = autonomy_puppet
        }
        add_stability = -0.10
    }
}

Synergy

  • has_war — Used inside limit to filter out occupied countries that are still at war, preventing logically inconsistent effects from being applied to active belligerents.
  • set_autonomy — Bulk-sets occupied countries to a specified autonomy level (puppet, colony, etc.); this is the core command for post-occupation disposition.
  • add_stability — Applies a uniform stability adjustment across all occupied countries, commonly used in punitive events or occupation policy effects.
  • set_politics — Used alongside the loop to overwrite the ruling party and popularity of every occupied country to match the occupier's ideology.

Common Pitfalls

  1. Scope direction confusion: Once inside the every_occupied_country block, the scope has already switched to the occupied country. When writing set_autonomy inside that block, target should be set to the overlord's tag — not the occupied country itself — otherwise the autonomy relationship will be invalid or incorrect.
  2. Missing limit causing unintended hits on neutral countries: This command fires for any country that has territory occupied by the executing nation's troops. Without a limit filter (such as exists = yes or has_capitulated = yes), it may unexpectedly catch countries that have merely had a small number of enemy troops step onto their soil, producing unintended script side effects.