Wiki

trigger · all_owned_state

Definition

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

Description

check if all owned states meets the trigger. tooltip=key can be defined to override title

实战 · 配合 · 坑

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

实战用法

all_owned_state 常用于判断一个国家所有已占领/拥有的州是否满足某种状态条件,例如检查一个国家是否所有核心州都已建成特定建筑、或全部州都不处于抵抗状态,从而触发焦点/决议的完成条件。典型场景包括"帝国建设"类 mod 中检查玩家是否已将版图内所有州纳入顺从控制。

# 检查某国所有拥有的州合规度是否均达到 50 以上
focus = {
    available = {
        all_owned_state = {
            compliance > 49
        }
    }
}

另一个例子:在 event 触发条件中,确认某国所有州都不处于积极抵抗状态:

trigger = {
    all_owned_state = {
        NOT = {
            has_active_resistance = yes
        }
    }
}

配合关系

  • any_neighbor_stateall_owned_state 负责检查"所有"州满足条件,而 any_neighbor_state 用于检查"至少一个"邻接州满足条件,两者逻辑互补,常用于领土扩张的复合判断。
  • has_state_flag:在 all_owned_state 内部用 has_state_flag 检查每个州是否被打上了特定标记,适合追踪逐州推进的任务进度。
  • is_owned_and_controlled_by:与 all_owned_state 组合使用,可进一步筛选出既被拥有又被实际控制的州,避免傀儡/战时占领的干扰。
  • compliance:直接在 all_owned_state 的子块中用 compliance 检查合规度阈值,是最常见的内部条件之一。

常见坑

  1. Scope 用错all_owned_state 只能在 COUNTRY scope 下调用,若不小心写在 STATE scope(例如在某个 every_state 的子块内且未切回国家 scope)会导致脚本报错或静默失败,新手需确认外层 scope 确实是国家。
  2. "拥有"与"控制"混淆:该 trigger 检查的是拥有(owned)的州,而非控制(controlled)的州——战时被敌军占领但仍属于你的州依然会被纳入检查范围,若需排除这类州,应在内部配合 is_controlled_byis_owned_and_controlled_by 进行二次过滤。

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

all_owned_state is commonly used to check whether every state owned or occupied by a country meets a given condition — for example, verifying that all of a nation's core states have a specific building constructed, or that none of its states are experiencing active resistance, in order to satisfy the completion conditions of a focus or decision. A typical use case in "empire-building" mods is checking whether the player has brought every state in their territory under compliant control.

# Check whether all states owned by a country have compliance above 50
focus = {
    available = {
        all_owned_state = {
            compliance > 49
        }
    }
}

Another example: using it inside an event trigger to confirm that none of a country's states have active resistance:

trigger = {
    all_owned_state = {
        NOT = {
            has_active_resistance = yes
        }
    }
}

Synergy

  • any_neighbor_state: all_owned_state checks that all states satisfy a condition, while any_neighbor_state checks that at least one neighboring state does — the two are logically complementary and are often combined for compound territorial expansion checks.
  • has_state_flag: Use has_state_flag inside all_owned_state to check whether each state has been tagged with a specific flag, which is well-suited for tracking mission progress that advances state by state.
  • is_owned_and_controlled_by: Combining this with all_owned_state lets you further filter for states that are both owned and actually controlled, avoiding interference from puppet states or wartime occupation.
  • compliance: Using compliance directly inside the all_owned_state block to check a compliance threshold is one of the most common inner conditions.

Common Pitfalls

  1. Wrong scope: all_owned_state can only be called from a COUNTRY scope. If it is accidentally written inside a STATE scope — for instance, inside a sub-block of every_state without switching back to a country scope — the script will either throw an error or fail silently. Always confirm that the enclosing scope is indeed a country.
  2. Confusing "owned" with "controlled": This trigger checks states that are owned, not states that are controlled — states that are still legally yours but are currently occupied by enemy forces will still be included in the check. If you need to exclude such states, filter them internally with is_controlled_by or is_owned_and_controlled_by.