Wiki

trigger · is_subject

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Checks if the country is subject of any other country

实战 · 配合 · 坑

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

实战用法

is_subject 常用于判断某国是否处于附庸/傀儡状态,从而在 focus tree、决策或事件中限制宗主国独立行动的国家无法触发特定选项。例如在制作独立运动 mod 时,可以用它来确保只有仍处于从属关系的国家才能触发独立诉求事件。

# 某决策的 available 块:只有当前为附庸国时才可用
available = {
    is_subject = yes
}

配合关系

  • [has_autonomy_state](/wiki/trigger/has_autonomy_state):配合 is_subject 使用,在确认是附庸国的前提下进一步判断具体的自治等级(如殖民地、自治领等),实现分层条件逻辑。
  • [any_subject_country](/wiki/trigger/any_subject_country):反向配合,在宗主国视角下遍历所有附庸,与 is_subject 形成主从两端的完整校验链。
  • [compare_autonomy_progress_ratio](/wiki/trigger/compare_autonomy_progress_ratio):附庸国往往需要同时检查自治度进度,与 is_subject 配合避免对非附庸国进行无意义的自治值判断。
  • [end_puppet](/wiki/effect/end_puppet):常在 effect 块中与 is_subject 的 trigger 检查配套,先确认从属关系存在,再执行解除傀儡的操作,防止脚本报错。

常见坑

  1. scope 混淆is_subject 的 scope 必须是被判断的附庸国本身,而非宗主国。新手常在宗主国 scope 下写 is_subject = yes,导致判断对象错误,应改用 any_subject_country 等遍历命令从宗主国侧检查。
  2. 忽略 = yes / = no 的对称写法:部分新手只知道用 is_subject = yes,忘记 is_subject = no 同样有效且常用(例如限制只有独立国家才能发起某外交行动),遗漏后者会导致条件块冗余甚至逻辑错误。

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

is_subject is commonly used to determine whether a country is in a vassal or puppet state, allowing you to restrict certain options in focus trees, decisions, or events to only non-overlord nations. For example, when creating independence movement mods, you can use it to ensure that only countries still in a subject relationship can trigger independence demand events.

# available block of a certain decision: only usable when the current nation is a vassal
available = {
    is_subject = yes
}

Synergy

  • [has_autonomy_state](/wiki/trigger/has_autonomy_state): Used in conjunction with is_subject, it further determines the specific autonomy tier (such as colony, dominion, etc.) after confirming vassal status, enabling layered conditional logic.
  • [any_subject_country](/wiki/trigger/any_subject_country): Inverse synergy—iterates through all vassals from the overlord's perspective, forming a complete verification chain across both ends of the subject relationship with is_subject.
  • [compare_autonomy_progress_ratio](/wiki/trigger/compare_autonomy_progress_ratio): Vassal nations often need to check autonomy progress simultaneously; use it together with is_subject to avoid meaningless autonomy value judgments on non-vassal nations.
  • [end_puppet](/wiki/effect/end_puppet): Commonly paired with is_subject trigger checks in effect blocks—first confirm the subject relationship exists, then execute the puppet removal operation to prevent script errors.

Common Pitfalls

  1. Scope confusion: The scope of is_subject must be the vassal nation itself being checked, not the overlord. Beginners often write is_subject = yes under overlord scope, causing incorrect judgment targets. Instead, use traversal commands like any_subject_country from the overlord's side to check.
  2. Overlooking symmetric usage of = yes / = no: Some beginners only know is_subject = yes and forget that is_subject = no is equally valid and frequently used (for example, restricting certain diplomatic actions to independent nations only). Omitting the latter results in redundant condition blocks or even logic errors.