Wiki

trigger · is_general_captured

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

Checks if the scoped unit leader (general) is captured (by any country)

### Examples

my_character = { is_general_captured = yes }

实战 · 配合 · 坑

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

实战用法

is_general_captured 常用于战俘相关的事件或决策中,例如在某将领被俘时触发外交谈判事件、限制被俘将领执行任务,或在释放战俘后给予奖励 trait。以下示例展示如何在事件 trigger 中检测特定角色是否处于被俘状态:

# 在某个 character 事件的 trigger 块中,检查该将领是否被俘
some_character = {
    is_general_captured = yes
    is_corps_commander = yes
}

也可配合 release_from_captivity effect 构成"触发释放"逻辑:

# 在决策的 available 块中确认目标仍被俘,执行后用 effect 释放
available = {
    some_character = {
        is_general_captured = yes
    }
}
effect = {
    some_character = {
        release_from_captivity = yes
    }
}

配合关系

  • is_corps_commander / is_field_marshal:配合使用可缩小范围,确认被俘者是指挥官而非其他角色类型,避免误判。
  • can_be_captured:用于在俘获逻辑前置校验,确认该将领允许被俘,与 is_general_captured 形成"是否可被俘→是否已被俘"的完整判断链。
  • release_from_captivity:最常见的后续 effect,先以 is_general_captured = yes 确认状态,再执行释放,防止对未被俘将领触发错误操作。
  • add_unit_leader_trait:释放或事件结算后为将领添加特质(如"战俘经历"),通常与 is_general_captured 判断处于同一事件的 trigger/effect 对中。

常见坑

  1. Scope 写错对象is_general_captured 必须在 CHARACTER scope 下使用,直接写在 country = { is_general_captured = yes } 或顶层会报错。需先通过 some_character = { ... }any_character = { ... } 进入正确 scope。
  2. 误以为 = no 等价于"未被俘且存活"is_general_captured = no 只能排除"当前被俘"状态,并不区分"自由中"与"已阵亡/已退役",如需精确判断应叠加 is_unit_leader = yes 等额外条件。

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_general_captured is commonly used in prisoner-of-war events or decisions — for example, triggering a diplomatic negotiation event when a commander is captured, restricting a captured commander from performing assignments, or granting a reward trait after a prisoner is released. The example below shows how to check whether a specific character is currently in a captured state inside an event trigger:

# Inside a character event's trigger block, check whether the commander is captured
some_character = {
    is_general_captured = yes
    is_corps_commander = yes
}

It can also be paired with the release_from_captivity effect to build a "trigger release" logic flow:

# Confirm the target is still captured in the decision's available block, then release via effect
available = {
    some_character = {
        is_general_captured = yes
    }
}
effect = {
    some_character = {
        release_from_captivity = yes
    }
}

Synergy

  • is_corps_commander / is_field_marshal: Use alongside is_general_captured to narrow the scope and confirm the captured character is actually a commander rather than some other character type, preventing false positives.
  • can_be_captured: Used as a prerequisite check before capture logic fires, confirming that the commander is eligible to be captured. Together with is_general_captured, this forms a complete "can be captured → has been captured" evaluation chain.
  • release_from_captivity: The most common follow-up effect. First verify the state with is_general_captured = yes, then execute the release — this prevents accidentally triggering a release on a commander who was never captured.
  • add_unit_leader_trait: Adds a trait to the commander after release or event resolution (e.g., a "POW Experience" trait). This is typically used in the same event's trigger/effect pair as the is_general_captured check.

Common Pitfalls

  1. Wrong scope target: is_general_captured must be used inside a CHARACTER scope. Writing it directly inside country = { is_general_captured = yes } or at the top level will cause an error. You must first enter the correct scope via some_character = { ... } or any_character = { ... }.
  2. Assuming = no means "alive and free": is_general_captured = no only rules out the "currently captured" state — it does not distinguish between "at liberty," "dead," or "retired." If you need a precise check, stack additional conditions such as is_unit_leader = yes.