Wiki

trigger · has_captured_operative

Definition

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

Description

Checks if a country has a captured an operative ( supports scoped variables )
has_captured_operative = GER/yes/no

实战 · 配合 · 坑

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

实战用法

has_captured_operative 常用于谍报相关的 focus、decision 或 event 场景,例如判断某国是否已捕获己方特工,从而触发外交危机或解救任务。也可以用 yes/no 形式检测本国是否持有任何被俘特工,配合反间谍剧情推进。

# 在 decision 的 available 块中,检测德国是否被俘了我方特工
available = {
    GER = {
        has_captured_operative = ROOT  # 检测 GER 是否捕获了 ROOT 国家的特工
    }
}

# 或者简单判断本国是否持有任何被俘特工
trigger = {
    has_captured_operative = yes
}

配合关系

  • [capture_operative](/wiki/effect/capture_operative):主动捕获特工的 effect,与本 trigger 形成"捕获→检测状态"的完整逻辑链,常用于测试捕获事件是否成功触发。
  • [free_operative](/wiki/effect/free_operative):释放被俘特工的 effect,通常在 has_captured_operative = yes 为真时才有意义执行,避免对无俘虏状态无效调用。
  • [free_random_operative](/wiki/effect/free_random_operative):随机释放一名被俘特工,配合本 trigger 做前置校验,确保至少存在俘虏再触发外交谈判或交换俘虏的 event。
  • [any_operative_leader](/wiki/trigger/any_operative_leader):可进一步筛选被俘特工的具体属性(如特质、派系),与 has_captured_operative 形成粗筛+细筛的两级判断结构。

常见坑

  1. scope 混淆has_captured_operative = GER 的主语必须是 COUNTRY scope,新手容易在 STATE scope 下直接写此 trigger,导致脚本报错或静默失效;需要先用 OWNER 等切换到国家 scope 再调用。
  2. yes/no 与具体国家标签的语义差异has_captured_operative = yes 检测"是否持有任何被俘特工",而 has_captured_operative = GER 检测"是否持有来自 GER 的特工",两者不可互换;漏掉目标标签会导致条件范围比预期宽泛,触发逻辑出现误判。

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

has_captured_operative is commonly used in intelligence-related focus trees, decisions, or event scenarios to check whether a specific nation has captured your operatives, triggering diplomatic crises or rescue missions. It can also be used in yes/no form to detect whether your country holds any captured operatives, working in conjunction with counter-espionage storylines.

# In a decision's available block, check if Germany has captured one of our operatives
available = {
    GER = {
        has_captured_operative = ROOT  # Check if GER has captured operatives from ROOT
    }
}

# Or simply check if this country holds any captured operatives
trigger = {
    has_captured_operative = yes
}

Synergy

  • [capture_operative](/wiki/effect/capture_operative): The effect that actively captures operatives. Works with this trigger to form a complete "capture → state detection" logic chain, commonly used to test whether capture events trigger successfully.
  • [free_operative](/wiki/effect/free_operative): The effect that releases captured operatives. Usually only meaningful to execute when has_captured_operative = yes is true, avoiding ineffective calls on nations with no captured operatives.
  • [free_random_operative](/wiki/effect/free_random_operative): Randomly releases a captured operative. Use this trigger as a precondition check to ensure at least one captive exists before triggering diplomatic negotiations or prisoner exchange events.
  • [any_operative_leader](/wiki/trigger/any_operative_leader): Can further filter specific attributes of captured operatives (such as traits or faction). Works with has_captured_operative to form a two-tier filtering structure of coarse and fine screening.

Common Pitfalls

  1. Scope confusion: The subject of has_captured_operative = GER must be a COUNTRY scope. Beginners often write this trigger directly under STATE scope, causing script errors or silent failures. You must first switch to country scope using OWNER or similar before calling this trigger.
  2. Semantic difference between yes/no and specific country tags: has_captured_operative = yes checks "whether this nation holds any captured operatives," while has_captured_operative = GER checks "whether this nation holds operatives from GER." These are not interchangeable. Omitting the target tag expands the condition scope beyond intent, causing false positives in trigger logic.