Wiki

trigger · has_any_captured_general

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if any of the generals of the scoped country is captured by another country

### Examples

FRA = { has_any_captured_general = yes }

实战 · 配合 · 坑

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

实战用法

当 mod 中涉及战俘机制或外交谈判剧情时,可以用此 trigger 检测某国是否有将领被俘,从而触发专属事件或解锁相关决策。例如,在讲和或战后清算 focus 中,判断己方将领是否落入敌手,进而给予玩家追加筹码的选项。

# 法国至少有一名将领被俘时,触发战俘交换国家事件
country_event = {
    id = fra_pow.1
    trigger = {
        tag = FRA
        has_war = yes
        has_any_captured_general = yes
    }
    option = {
        name = fra_pow.1.a
        add_war_support = -0.05
    }
}

配合关系

  • has_war — 将领被俘通常发生于战争期间,与 has_war 联用可避免在和平时期误触发。
  • has_capitulated — 配合检测某交战国是否已投降,用于判断被俘将领的归属方是否仍处于活跃状态。
  • any_army_leader — 可在其下进一步筛选具体哪位将领被俘,实现更精细的条件判断。
  • country_event — 将领被俘后常用来触发专属剧情事件,是最自然的后续 effect 搭档。

常见坑

  1. Scope 写错:此 trigger 只能在 COUNTRY scope 下使用,新手容易在 state_event 的 state scope 或 character scope 内直接调用,导致脚本报错或条件永远为假,使用前务必确认当前 scope 是国家。
  2. 误以为可指定目标国:trigger 名中虽有"captured"但不接受 target 参数,无法直接写 has_any_captured_general = GER 来指定是被哪个国家俘虏;若需检测被特定国俘虏的情况,需结合 any_army_leader 等进行嵌套判断。

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

When a mod involves prisoner-of-war mechanics or diplomatic negotiation storylines, this trigger can be used to check whether a country has any captured generals, allowing you to fire dedicated events or unlock related decisions. For example, in a peace deal or post-war reckoning focus, you can check whether your own generals have fallen into enemy hands and then offer the player additional leverage options.

# Fires a POW exchange country event when France has at least one captured general
country_event = {
    id = fra_pow.1
    trigger = {
        tag = FRA
        has_war = yes
        has_any_captured_general = yes
    }
    option = {
        name = fra_pow.1.a
        add_war_support = -0.05
    }
}

Synergy

  • has_war — Generals are typically captured during wartime; pairing this with has_war prevents accidental triggers during peacetime.
  • has_capitulated — Combine with a check for whether a belligerent has already capitulated, useful for determining whether the faction holding the captured general is still an active participant.
  • any_army_leader — Can be used underneath to further filter which specific general has been captured, enabling more granular condition checks.
  • country_event — The most natural follow-up effect after a general is captured; commonly used to fire a dedicated story event.

Common Pitfalls

  1. Wrong scope: This trigger can only be used within a COUNTRY scope. Beginners often call it directly inside a state scope in a state_event or inside a character scope, which causes script errors or a condition that is permanently false. Always confirm you are in a country scope before using it.
  2. Assuming a target country can be specified: Despite the word "captured" in the trigger name, it does not accept a target parameter — you cannot write has_any_captured_general = GER to specify which country did the capturing. If you need to check whether a general was captured by a specific country, you must use nested logic with any_army_leader or similar triggers.