Wiki

trigger · any_subject_country

Definition

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

Description

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

实战 · 配合 · 坑

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

实战用法

any_subject_country 常用于检查宗主国是否拥有至少一个满足特定条件的附属国,例如判断某附属国是否已经研发了特定科技、拥有特定政体,或达到某个自治度等级,从而触发外交或决策事件。典型场景包括:帝国系 mod 中检查宗主国的殖民地是否有某个政党占主导、或某附属国是否已陷入内战。

# 检查是否有任何附属国处于战争中,且是法西斯政府
any_subject_country = {
    has_war = yes
    has_government = fascism
}

配合关系

  • is_subject_of:常与 any_subject_country 配合,在附属国自身视角下反向验证宗主从属关系,形成双向条件核查。
  • has_government:在 any_subject_country 块内用于筛选特定意识形态的附属国,是最高频的内部过滤条件。
  • has_war:在块内判断某附属国是否处于战争状态,常用于触发宗主国的援助或干预决策。
  • set_autonomy:当 any_subject_country 条件满足后,在 effect 块中对附属国调整自治度,是最直接的后续动作之一。

常见坑

  1. Scope 方向混淆any_subject_country 必须在**宗主国(COUNTRY)**的 scope 下调用,若在附属国自身 scope 内想检查"我是否是某国的附属国",应改用 is_subject_of,否则逻辑完全相反且通常返回 false。
  2. 内部 scope 已切换:进入 any_subject_country = { } 块后,scope 已切换至被遍历的附属国,此时不能在块内直接引用宗主国的 flag 或条件,需要用 ROOT / PREV 前缀来回指宗主国,否则判断对象会出错。

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_subject_country is commonly used to check whether an overlord has at least one subject that meets specific conditions — for example, whether a subject has researched a particular technology, holds a certain government type, or has reached a given autonomy level — in order to trigger diplomatic events or decisions. Typical use cases include: checking in an imperial-style mod whether a particular party is dominant in one of the overlord's colonies, or whether a subject has fallen into civil war.

# Check whether any subject country is at war and has a fascist government
any_subject_country = {
    has_war = yes
    has_government = fascism
}

Synergy

  • is_subject_of: Often paired with any_subject_country to verify the overlord–subject relationship from the subject's own perspective, enabling two-way condition checks.
  • has_government: Used inside an any_subject_country block to filter subjects by ideology — the single most common inner filter condition.
  • has_war: Used inside the block to check whether a given subject is currently at war; frequently used to trigger the overlord's aid or intervention decisions.
  • set_autonomy: Once the any_subject_country condition is satisfied, this effect is applied in the effect block to adjust a subject's autonomy level — one of the most direct follow-up actions.

Common Pitfalls

  1. Scope direction confusion: any_subject_country must be called from the overlord's (COUNTRY) scope. If you want to check "am I a subject of a certain country?" from within the subject's own scope, use is_subject_of instead — calling any_subject_country there will produce completely inverted logic and will typically return false.
  2. The inner scope has already switched: Once inside an any_subject_country = { } block, the scope has switched to the subject country being iterated. You cannot directly reference the overlord's flags or conditions inside the block; use the ROOT / PREV prefix to refer back to the overlord, otherwise your checks will target the wrong country entirely.