Wiki

trigger · num_of_operatives

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks the number of operatives the country controls

实战 · 配合 · 坑

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

实战用法

num_of_operatives 常用于情报体系 mod 中,限制某些决策或国策只有在特工数量达到一定规模后才能触发,比如解锁高级渗透任务或允许大规模破坏行动。也可用于 AI 策略条件中,判断玩家或 AI 国家是否已具备足够的情报力量来执行特定计划。

# 只有当国家拥有足够特工时,才允许激活某个破坏决策
available = {
    num_of_operatives > 3
    has_country_flag = intelligence_network_established
}

配合关系

  • [has_active_mission](/wiki/trigger/has_active_mission):检查是否有特工任务正在执行,与 num_of_operatives 搭配可构建"有任务 + 有人手"的双重门槛。
  • [any_operative_leader](/wiki/trigger/any_operative_leader):在确认特工数量足够后,进一步筛选特定特质或级别的特工,实现更精细的条件判断。
  • [create_operative_leader](/wiki/effect/create_operative_leader):当特工数量不足时在 effect 块中创建新特工,与该 trigger 的阈值检查形成"不足则补充"的逻辑闭环。
  • [capture_operative](/wiki/effect/capture_operative):常在 trigger 判断敌方特工规模后,决定是否触发抓捕效果,两者结合用于反情报类决策。

常见坑

  1. 混淆"控制"与"部署":该 trigger 统计的是国家当前控制的特工总数,包括待机状态,而非仅限于正在执行任务的特工。新手容易以为只有在外行动中的特工才被计入,从而把阈值设得过低导致条件过早满足。
  2. 忘记 scope 限制num_of_operatives 只能在 COUNTRY scope 下使用,若误放在 STATE 或 CHARACTER scope 的 limit 块内会导致脚本报错或静默返回假,调试时难以发现。

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_of_operatives is commonly used in intelligence system mods to restrict certain decisions or focuses so they only trigger once a country has accumulated a sufficient operative workforce. This might unlock advanced infiltration tasks or enable large-scale sabotage operations. It can also be used in AI behavior conditions to determine whether the player or an AI nation has built up enough intelligence capacity to execute specific plans.

# Only allow activating a sabotage decision when the country has enough operatives
available = {
    num_of_operatives > 3
    has_country_flag = intelligence_network_established
}

Synergy

  • [has_active_mission](/wiki/trigger/has_active_mission): Checks whether operative missions are currently running. Pairing it with num_of_operatives creates a dual threshold—"has active missions AND has personnel available."
  • [any_operative_leader](/wiki/trigger/any_operative_leader): After confirming sufficient operative count, further refine by filtering for specific traits or ranks, enabling more granular condition logic.
  • [create_operative_leader](/wiki/effect/create_operative_leader): When operative count falls short, create new operatives in the effect block. Combined with this trigger's threshold checks, it forms a "replenish if insufficient" feedback loop.
  • [capture_operative](/wiki/effect/capture_operative): Often used after a trigger assesses enemy operative strength to decide whether to trigger a capture effect. Together they support counter-intelligence style decisions.

Common Pitfalls

  1. Confusing "controlled" with "deployed": This trigger counts the total number of operatives currently controlled by the country, including those in standby state—not just those actively executing missions. Newcomers often assume only operatives in active operations count, leading them to set thresholds too low and causing conditions to activate prematurely.
  2. Forgetting scope restrictions: num_of_operatives only works within COUNTRY scope. Accidentally placing it in a limit block under STATE or CHARACTER scope causes script errors or silent failure, making debugging difficult to track down.