Wiki

trigger · num_of_operatives

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks the number of operatives the country controls

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.