Wiki

trigger · num_finished_operations

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Compares number of completed operations.
Example: 
num_finished_operations = { 
 target = ITA 
 operation = operation_infiltrate_armed_forces_navy value > 35 
}

实战 · 配合 · 坑

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

实战用法

num_finished_operations 常用于情报/间谍 mod 中,依据某国家对特定目标完成的行动次数来解锁决策、奖励或触发事件。例如,当玩家对意大利完成足够多的渗透行动后,才能获得额外的情报加成或开启后续任务链:

# 解锁决策的 available 条件:对意大利完成 5 次以上渗透行动
available = {
    num_finished_operations = {
        target = ITA
        operation = operation_infiltrate_armed_forces_navy
        value > 5
    }
}

配合关系

  • [add_operation_token](/wiki/effect/add_operation_token):完成行动数量达标后,可通过该 effect 给予行动令牌作为奖励,形成"完成行动 → 获得资源"的闭环激励。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):常与国策完成条件并列使用,要求玩家既走完特定国策树分支,又积累一定数量的完成行动,双重门槛防止决策被过早触发。
  • [any_operative_leader](/wiki/trigger/any_operative_leader):在检测完成行动数量的同时,进一步限定必须存在具备特定特质的特工,使条件更精确地匹配情报 gameplay 流程。
  • [add_intel](/wiki/effect/add_intel):作为满足 num_finished_operations 条件后的奖励 effect,给予情报值,契合行动完成后获取情报的叙事逻辑。

常见坑

  1. 忽略 target 字段的必要性target 不能省略,且必须填写具体的国家 TAG(如 ITA)或合法的 scope 引用,直接写 any 作为字面值是无效的,新手容易误认为可以不加 target 来统计对所有国家的行动总数。
  2. 比较运算符位置错误value > 35 中的比较运算符与数值必须紧跟在 operation = <operation_id> 所在行的末尾,或作为独立字段写在花括号内,若将其拆散成 value = > 35 等形式会导致解析报错,且不会有任何 error 提示直接静默失效。

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

num_finished_operations is commonly used in intelligence/espionage mods to unlock decisions, rewards, or trigger events based on the number of operations a country has completed against a specific target. For example, after the player completes enough infiltration operations against Italy, they can gain additional intelligence bonuses or unlock subsequent mission chains:

# available condition for unlocking a decision: completed 5+ infiltration operations against Italy
available = {
    num_finished_operations = {
        target = ITA
        operation = operation_infiltrate_armed_forces_navy
        value > 5
    }
}

Synergy

  • [add_operation_token](/wiki/effect/add_operation_token): Once the operation completion threshold is met, this effect can reward operation tokens, creating a closed-loop incentive cycle of "complete operations → gain resources".
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Commonly paired with focus completion conditions, requiring players to both complete a specific focus tree branch and accumulate a certain number of finished operations, establishing a dual gate to prevent decisions from triggering prematurely.
  • [any_operative_leader](/wiki/trigger/any_operative_leader): While checking the count of completed operations, this further restricts the requirement that operatives with specific traits must exist, making conditions more precisely aligned with intelligence gameplay flow.
  • [add_intel](/wiki/effect/add_intel): Serves as the reward effect after satisfying num_finished_operations conditions, granting intelligence points, which aligns with the narrative logic of gaining intelligence after operation completion.

Common Pitfalls

  1. Overlooking the necessity of the target field: target cannot be omitted and must contain a valid country TAG (such as ITA) or legitimate scope reference. Writing any as a literal value is invalid. Beginners often mistakenly believe target can be excluded to count total operations against all countries.
  2. Incorrect placement of comparison operators: In value > 35, the comparison operator and number must immediately follow the line containing operation = <operation_id>, or be written as an independent field within the curly braces. Splitting it into forms like value = > 35 will cause parsing errors and silently fail without any error message.