Wiki

trigger · any_occupied_country

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

check if any any occupied meets the trigger. tooltip=key can be defined to override title

实战 · 配合 · 坑

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

实战用法

any_occupied_country 常用于判断当前国家是否占领了某些特定敌国领土,例如在事件或决策的 available 块中检测是否有被占领国满足特定条件(如特定 tag、政体等),从而触发占领政策选项或特殊外交选项。

# 示例:如果当前国家占领的国家中存在民主政体的国家,则该决策可用
available = {
    any_occupied_country = {
        has_government = democratic
    }
}

也可以在 trigger 块中用于检测是否存在被占领且尚未投降的国家:

trigger = {
    any_occupied_country = {
        has_war = yes
        has_capitulated = no
    }
}

配合关系

  • has_government — 最常见搭配,用于筛选被占领国中具有特定意识形态的国家,决定是否触发相关占领或傀儡化逻辑。
  • is_puppet_of — 用于排除已经成为己方傀儡的国家,避免重复判断已处理的从属国。
  • has_capitulated — 配合判断被占领国是否已经投降,区分"领土被占但仍在抵抗"与"已完全投降"两种状态。
  • tag — 在循环体内精确指定某个目标国家,限定 any_occupied_country 的范围至具体的国家 tag。

常见坑

  1. scope 混淆any_occupied_country 的 scope 必须是 COUNTRY,新手容易在 statedivision scope 下调用它,导致脚本报错或静默失效。被占领国(occupied country)是指有至少一个州被当前国家占领的其他国家,而非仅控制某省,注意与 controls_state 等逻辑区分。

  2. 误以为可枚举所有被占领国any_occupied_country 只要有任意一个满足条件即返回真,不能用它来"对所有被占领国执行操作"——那是 effect 侧的 every_country 加筛选条件的职责,混用会导致逻辑完全偏离预期。

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

any_occupied_country is commonly used to check whether the current country occupies territory belonging to specific enemies — for example, inside an available block of an event or decision, to detect whether any occupied country meets certain conditions (such as a specific tag, government type, etc.), thereby unlocking occupation policy options or special diplomatic choices.

# Example: the decision becomes available if any country occupied by the current country has a democratic government
available = {
    any_occupied_country = {
        has_government = democratic
    }
}

It can also be used inside a trigger block to check whether any occupied country has not yet surrendered:

trigger = {
    any_occupied_country = {
        has_war = yes
        has_capitulated = no
    }
}

Synergy

  • has_government — The most common pairing; filters occupied countries by ideology to determine whether to trigger occupation or puppetization logic.
  • is_puppet_of — Used to exclude countries that are already your puppets, preventing redundant checks on subjects already handled.
  • has_capitulated — Combined with any_occupied_country to distinguish between "territory occupied but still resisting" and "fully capitulated" states.
  • tag — Pinpoints a specific target country inside the loop body, narrowing the scope of any_occupied_country to a concrete country tag.

Common Pitfalls

  1. Scope confusion: any_occupied_country must be called from a COUNTRY scope. Beginners often call it from a state or division scope, causing script errors or silent failures. An occupied country refers to any foreign country that has at least one state occupied by the current country — not merely province control. Be careful to distinguish this from logic like controls_state.

  2. Assuming it iterates over all occupied countries: any_occupied_country returns true as soon as any single country satisfies the condition. It cannot be used to "perform an action on every occupied country" — that is the responsibility of every_country on the effect side with appropriate filters. Mixing up the two will cause your logic to behave in completely unintended ways.