Wiki

trigger · has_any_general_captured_by

Definition

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

Description

Checks if the scoped country has any unit leader captured by the target country

### Examples

FRA = { has_any_general_captured_by = GER # This will be true if any of France's generals are captured by Germany }

实战 · 配合 · 坑

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

实战用法

常用于战俘相关的事件或决议中,判断本国将领是否被某个特定敌国俘虏,从而触发外交谈判、战俘交换或羞辱性惩罚等剧情。例如在法德战争剧本中,检测法国是否有将领被德国俘虏,若是则开放"交换战俘"决议。

# 当法国有将领被德国俘虏时,才允许触发战俘交换事件
FRA = {
    has_any_general_captured_by = GER
    has_war_with = GER
}

配合关系

  • has_war_with:通常需要先确认两国处于交战状态,再检测将领是否已被俘虏,避免在和平时期出现逻辑矛盾。
  • any_army_leader:可进一步遍历具体的陆军将领,对被俘的特定将领施加更精细的条件判断。
  • has_capitulated:配合检测目标国是否已投降,区分"正常战俘"与"战争结束后的战俘"两种情境。
  • has_country_flag:与国家标记联用,防止战俘交换事件反复触发,在事件触发后设置标记并用此 trigger 锁门。

常见坑

  1. Scope 方向写反:该 trigger 的 scope 是被俘将领所属国,target 是俘虏方,新手容易将两者对调——应写 FRA = { has_any_general_captured_by = GER } 而非在 GER 的 scope 下使用,否则判断结果完全相反。
  2. target 只支持白名单关键字或国家 TAG:target 处不可填写省份 ID、STATE scope 等非国家目标,只能使用 THISROOTPREVFROM 等上下文关键字或具体国家 TAG(如 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

Commonly used in prisoner-of-war events or decisions to check whether a country's generals have been captured by a specific enemy nation, thereby triggering diplomatic negotiations, POW exchanges, or humiliation storylines. For example, in a Franco-German war scenario, this trigger checks whether France has any generals captured by Germany — if so, it unlocks a "Exchange Prisoners" decision.

# Only allow the POW exchange event to fire when France has a general captured by Germany
FRA = {
    has_any_general_captured_by = GER
    has_war_with = GER
}

Synergy

  • has_war_with: You typically want to confirm that the two countries are at war before checking whether a general has been captured, to avoid logical contradictions during peacetime.
  • any_army_leader: Can be used to iterate over specific army leaders, allowing more granular conditions to be applied to a particular captured general.
  • has_capitulated: Pair with this to check whether the target country has already capitulated, distinguishing between "wartime POWs" and "post-war POWs."
  • has_country_flag: Use alongside country flags to prevent POW exchange events from firing repeatedly — set a flag after the event triggers and use this trigger as a gate.

Common Pitfalls

  1. Scope direction is reversed: The scope of this trigger is the country the captured general belongs to, and the target is the capturing country. Beginners often swap the two — the correct form is FRA = { has_any_general_captured_by = GER }, not using it inside GER's scope. Getting this backwards will produce completely inverted results.
  2. The target only accepts whitelisted keywords or country TAGs: The target field does not accept province IDs, STATE scopes, or any non-country targets. Only context keywords such as THIS, ROOT, PREV, FROM, or explicit country TAGs (e.g. GER) are valid. Anything else will cause a silent script error, making the condition permanently evaluate to false.