Wiki

trigger · any_owned_state

Definition

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

Description

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

实战 · 配合 · 坑

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

实战用法

any_owned_state 常用于判断某国是否拥有至少一个满足特定条件的州,例如检测是否持有某资源州、某核心州,或是否存在服从度未达标的占领区,从而触发事件、决策或国策分支。

# 检查该国是否拥有至少一个存在抵抗活动且不受其完全控制的州
trigger = {
    any_owned_state = {
        has_active_resistance = yes
        NOT = { is_fully_controlled_by = ROOT }
    }
}

配合关系

  • all_owned_state(不在白名单,跳过)
  • is_owned_by — 在 any_owned_state 的子块内使用,可进一步确认该州的实际归属是否仍为触发国。
  • has_state_flag — 在子块内检查是否为某州设置过特定标记,配合 set_state_flag 实现"仅触发一次"逻辑。
  • compliance — 在子块内判断州的服从度数值,配合 any_owned_state 快速筛查全境中服从度低于阈值的占领州。
  • is_core_of — 在子块内验证某州是否为特定国家的核心,常用于判断是否存在被占领的本国核心领土。

常见坑

  1. Scope 混用any_owned_state 只能在 COUNTRY scope 下调用,若当前 scope 已进入 STATE(如在另一个 any_owned_state 的子块内),直接再次调用 any_owned_state 会报 scope 错误——需先用 OWNERROOT 等 target 回到国家 scope 再嵌套。
  2. 误用为 effect:此 trigger 仅做条件判断,不能写在 effect 块里来"对每个州执行操作";若需对所有符合条件的州执行操作,应改用 effect 侧的 every_state(配合 limit 块过滤条件),而非把 any_owned_state 放进 effect 中。

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_owned_state is commonly used to check whether a country owns at least one state that meets specific conditions — for example, detecting whether it holds a resource-rich state, a core state, or an occupied state where compliance has not yet reached the required threshold — in order to fire events, decisions, or focus branches.

# Check if the country owns at least one state with active resistance that it does not fully control
trigger = {
    any_owned_state = {
        has_active_resistance = yes
        NOT = { is_fully_controlled_by = ROOT }
    }
}

Synergy

  • all_owned_state (not whitelisted, skipped)
  • is_owned_by — Used inside the any_owned_state sub-block to further confirm whether the state still actually belongs to the triggering country.
  • has_state_flag — Used inside the sub-block to check whether a specific flag has been set on a state; combine with set_state_flag to implement "trigger only once" logic.
  • compliance — Used inside the sub-block to evaluate a state's compliance value; pair with any_owned_state to quickly scan all territories for occupied states below a compliance threshold.
  • is_core_of — Used inside the sub-block to verify whether a state is a core of a specific country; commonly used to check whether any occupied home-core territory exists.

Common Pitfalls

  1. Scope mismatch: any_owned_state can only be called from a COUNTRY scope. If the current scope has already entered a STATE scope (e.g., inside the sub-block of another any_owned_state), calling any_owned_state again directly will produce a scope error — you must first return to a country scope via a target such as OWNER or ROOT before nesting it again.
  2. Mistaking it for an effect: This is a trigger used purely for condition checks; it cannot be placed inside an effect block to "perform operations on every state." If you need to apply an operation to all states matching certain conditions, use the effect-side every_state with a limit block to filter conditions instead of placing any_owned_state inside an effect.