Wiki

trigger · any_operative_leader

Definition

  • Supported scope:COUNTRY, OPERATION
  • Supported target:none

Description

check if any operatives meets the trigger. tooltip=key can be defined to override title

实战 · 配合 · 坑

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

实战用法

any_operative_leader 常用于检查某国是否拥有满足特定条件的情报人员,例如判断是否存在已被捕获、具有特定特质或执行特定任务的特工,从而触发事件或解锁决策。在间谍系统相关 mod 中,可用于 focus 的 available 块或 event 的 trigger 块做条件把关。

# 检查本国是否存在任意一个携带 seducer 特质的特工
available = {
    any_operative_leader = {
        has_trait = seducer
        is_operative_captured = no
    }
}

配合关系

  • has_trait — 在 any_operative_leader 的子块中筛选拥有特定特质的特工,是最常见的过滤条件。
  • is_operative_captured — 配合使用可区分在押与自由状态的情报人员,避免误判已被俘特工。
  • operative_leader_mission — 用于进一步确认该特工当前是否正在执行特定任务,实现更精准的状态检测。
  • harm_operative_leader — 在确认满足条件的特工存在后,通过对应 effect 块对其施加伤害或副作用,形成"先判断后操作"的完整逻辑。

常见坑

  1. 作用域混用any_operative_leader 只能在 COUNTRYOPERATION scope 下使用,若在 CHARACTERUNIT_LEADER scope 内调用则会报错或静默失败,新手容易在角色事件的 trigger 块中直接使用而忘记先切换回国家 scope。
  2. 子块条件被当作 AND 全部满足:该 trigger 会遍历所有特工并返回"是否存在至少一个满足子块全部条件的特工",不要误以为子块里的多个条件是"分别对不同特工生效"的 OR 逻辑,所有条件必须由同一个特工同时满足才会返回真。

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

any_operative_leader is commonly used to check whether a country has at least one operative matching specific criteria — for example, whether an operative has been captured, possesses a particular trait, or is currently running a specific mission — in order to fire events or unlock decisions. In intelligence-system mods, it fits naturally inside a focus's available block or an event's trigger block as a gating condition.

# Check whether the country has any operative with the seducer trait who is not captured
available = {
    any_operative_leader = {
        has_trait = seducer
        is_operative_captured = no
    }
}

Synergy

  • has_trait — Filters for operatives with a specific trait inside the any_operative_leader sub-block; this is the most common narrowing condition.
  • is_operative_captured — Used alongside the above to distinguish captured operatives from those still at large, preventing false positives from already-imprisoned agents.
  • operative_leader_mission — Further confirms whether the operative is currently executing a particular mission, enabling more precise state detection.
  • harm_operative_leader — Once a qualifying operative has been confirmed to exist, a corresponding effect block can be used to apply damage or side effects to them, forming a clean "check first, act second" pattern.

Common Pitfalls

  1. Scope mismatch: any_operative_leader is only valid inside a COUNTRY or OPERATION scope. Calling it from a CHARACTER or UNIT_LEADER scope will cause an error or a silent failure. A common beginner mistake is using it directly inside a character event's trigger block without first switching back to the country scope.
  2. Sub-block conditions are AND-evaluated against a single operative: This trigger iterates over all operatives and returns true only if at least one operative satisfies all conditions in the sub-block simultaneously. Do not assume that multiple conditions in the sub-block act as an OR across different operatives — every condition must be met by the same operative at the same time for the trigger to return true.