Wiki

trigger · can_be_captured

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

can_be_captured = yes/no - Checks if the current character can be captured while deployed in a division

实战 · 配合 · 坑

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

实战用法

can_be_captured 常用于特工或指挥官相关的 mod 场景,例如在某个事件或决议中,需要判断目标角色是否处于可被俘获的状态,从而触发后续的捕获逻辑或豁免保护。比如可以配合角色特质系统,为"不可被捕"的特殊角色设置专属事件分支。

# 示例:仅当角色可被捕获时,才允许执行捕获操作
character_event = {
    id = my_mod.1
    
    trigger = {
        is_operative = yes
        can_be_captured = yes
    }
    
    option = {
        name = my_mod.1.a
        capture_operative = yes
    }
}

配合关系

  • is_operativecan_be_captured 主要针对部署中的角色,通常先用 is_operative 确认角色身份再做捕获条件判断,避免在非特工角色上误判。
  • is_operative_captured:常作为对立条件配合使用——先检查角色尚未被俘(is_operative_captured = no),再检查 can_be_captured = yes,构成完整的"可捕获且未被捕"判断链。
  • capture_operative:在 can_be_captured = yes 的条件通过后,effect 侧用 capture_operative 实际执行捕获动作,两者是典型的 trigger→effect 配对。
  • has_trait:部分 mod 通过特质来标记"受保护"角色,可与 can_be_captured 组合做双重验证,确保逻辑严谨。

常见坑

  1. scope 错误can_be_captured 仅在 CHARACTER scope 下有效,新手容易在国家 scope 或事件的顶层直接写该条件,导致脚本报错或静默返回假,需确保先通过 any_characterevery_character 等方式进入正确的角色 scope。
  2. 混淆"可被捕获"与"已被捕获"can_be_captured = yes 判断的是角色当前能否被捕获(如是否在师中部署),而非角色已经处于被俘状态;后者应使用 is_operative_captured,两者含义不同,不可替换使用。

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

can_be_captured is commonly used in operative- or commander-related mod scenarios — for example, when an event or decision needs to check whether a target character is currently in a capturable state before triggering downstream capture logic or granting immunity protection. It pairs well with the character trait system, allowing you to create dedicated event branches for special characters flagged as "uncatchable."

# Example: only allow a capture operation when the character can actually be captured
character_event = {
    id = my_mod.1
    
    trigger = {
        is_operative = yes
        can_be_captured = yes
    }
    
    option = {
        name = my_mod.1.a
        capture_operative = yes
    }
}

Synergy

  • is_operative: can_be_captured primarily targets characters that are actively deployed, so it is standard practice to first confirm the character's identity with is_operative before evaluating capture conditions — this prevents false positives on non-operative characters.
  • is_operative_captured: Frequently used as the complementary condition — first verify the character has not yet been captured (is_operative_captured = no), then check can_be_captured = yes, forming a complete "capturable and not yet captured" evaluation chain.
  • capture_operative: Once the can_be_captured = yes check passes, the effect side uses capture_operative to actually execute the capture action. The two form a classic trigger→effect pair.
  • has_trait: Some mods use traits to mark "protected" characters; combining has_trait with can_be_captured adds a second layer of validation and keeps the logic airtight.

Common Pitfalls

  1. Wrong scope: can_be_captured is only valid inside a CHARACTER scope. Beginners often write this condition directly at the country scope or at the top level of an event, causing script errors or a silent return of false. Always make sure to enter the correct character scope first via constructs such as any_character or every_character.
  2. Confusing "can be captured" with "has been captured": can_be_captured = yes checks whether a character is currently able to be captured (e.g., whether they are deployed in a division), not whether they are already in a captured state. The latter requires is_operative_captured. The two have distinct meanings and are not interchangeable.