Wiki

trigger · has_finished_collecting_for_operation

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

checks if finished collecting of resources for an operation.
Example: 
has_finished_collecting_for_operation = { 
 target = ITA 
 operation = operation_infiltrate_armed_forces_navy}

实战 · 配合 · 坑

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

实战用法

此 trigger 常用于间谍/情报类 mod 中,检测某国是否已为特定行动完成情报资源收集,从而解锁后续决议或触发剧情事件。例如当玩家对意大利实施"渗透海军"行动前,先确认资源已到位再弹出提示事件:

# 在决议的 available 块中使用
available = {
    has_finished_collecting_for_operation = {
        target = ITA
        operation = operation_infiltrate_armed_forces_navy
    }
}

配合关系

  • [add_operation_token](/wiki/effect/add_operation_token):收集完成后立即为行动添加令牌,是推进情报行动流程的自然下一步。
  • [has_active_mission](/wiki/trigger/has_active_mission):与其配合判断当前行动任务是否仍在进行中,避免重复触发逻辑。
  • [has_country_flag](/wiki/trigger/has_country_flag):通常在确认收集完成后设置国旗标记,再用此 trigger 防止条件块重复判定。
  • [country_event](/wiki/effect/country_event):收集完成后触发对应剧情事件,驱动情报行动的叙事推进。

常见坑

  1. 忘记指定 target 字段target 是必填字段,指向被行动针对的国家 scope,若省略游戏不会报错但条件永远不会返回真,导致后续逻辑静默失效,排查困难。
  2. 将 operation 值写成本地化字符串而非脚本 keyoperation 字段填写的是行动的脚本定义名称(如 operation_infiltrate_armed_forces_navy),而非本地化显示名,照抄界面文字会导致匹配失败。

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

This trigger is commonly used in spy/intelligence-focused mods to detect whether a nation has completed intelligence resource gathering for a specific operation, thereby unlocking subsequent decisions or triggering scripted events. For example, before the player executes an "Infiltrate Navy" operation against Italy, you can first confirm that resources are in place before displaying a notification event:

# Used within the available block of a decision
available = {
    has_finished_collecting_for_operation = {
        target = ITA
        operation = operation_infiltrate_armed_forces_navy
    }
}

Synergy

  • [add_operation_token](/wiki/effect/add_operation_token): Immediately adds a token to the operation upon collection completion, which is the natural next step in advancing the intelligence operation workflow.
  • [has_active_mission](/wiki/trigger/has_active_mission): Works in conjunction to determine whether the current operation task is still ongoing, preventing duplicate trigger logic.
  • [has_country_flag](/wiki/trigger/has_country_flag): Typically sets a country flag after confirming collection completion, then uses this trigger to prevent repeated condition block evaluation.
  • [country_event](/wiki/effect/country_event): Triggers the corresponding scripted event upon collection completion, driving the narrative progression of the intelligence operation.

Common Pitfalls

  1. Forgetting to specify the target field: target is a required field that points to the country scope targeted by the operation. If omitted, the game will not produce an error but the condition will never return true, causing subsequent logic to silently fail and making debugging difficult.
  2. Writing the operation value as a localization string instead of a script key: The operation field expects the operation's scripted definition name (such as operation_infiltrate_armed_forces_navy), not the localized display name. Copying interface text directly will result in matching failure.