Wiki

trigger · operative_leader_operation

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

Checks whether the operative is performing the given operation:
operative_leader_operation = operation_rescue_operative

实战 · 配合 · 坑

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

实战用法

operative_leader_operation 常用于情报 mod 中,在特工执行特定行动期间动态改变其行为或触发剧情事件——例如仅当特工正在执行"营救特工"任务时才允许某些选项激活,或在任务进行中锁定玩家的干预选择。下面是一个典型的事件条件示例:

# 在特工事件中,仅当该特工正在执行营救行动时才显示此选项
option = {
    name = my_operative_event.option_a
    trigger = {
        FROM = {
            operative_leader_operation = operation_rescue_operative
        }
    }
    # ... 后续 effect
}

配合关系

  • [is_operative](/wiki/trigger/is_operative):使用前通常先确认当前 scope 是特工角色,避免在非特工 CHARACTER 上误判导致报错。
  • [operative_leader_mission](/wiki/trigger/operative_leader_mission):两者常并列使用,前者检查正在执行的具体行动(operation),后者检查当前的任务模式(mission),组合起来可精确匹配特工的完整工作状态。
  • [force_operative_leader_into_hiding](/wiki/effect/force_operative_leader_into_hiding):在确认特工正在执行某行动后,可据此将其强制潜伏,常见于"任务失败"或"暴露风险"的后续处理逻辑中。
  • [harm_operative_leader](/wiki/effect/harm_operative_leader):同样在行动检查为真后触发,用于模拟特工执行高风险行动期间受到伤害的剧情结果。

常见坑

  1. Scope 写错位置:此 trigger 必须在 CHARACTER scope 下调用,新手常在国家 scope(如 ROOTFROM 指向国家时)直接写,导致游戏报错或条件永远为假;需先用 country_leaderevery_operative 等方式切换到特工角色 scope 再判断。
  2. 行动 token 拼写依赖实际 operation 定义:传入的参数(如 operation_rescue_operative)必须与 common/operations/ 下实际定义的行动 key 完全一致,自定义 mod 新增的行动若 key 写错,条件将静默返回假而不会报错,极难排查。

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

operative_leader_operation is commonly used in intelligence mods to dynamically alter operative behavior or trigger story events during specific operations—for example, allowing certain option activations only when an operative is executing a "rescue operative" mission, or locking player intervention choices during the operation. Below is a typical event condition example:

# In an operative event, display this option only when the operative is executing a rescue operation
option = {
    name = my_operative_event.option_a
    trigger = {
        FROM = {
            operative_leader_operation = operation_rescue_operative
        }
    }
    # ... subsequent effects
}

Synergy

  • [is_operative](/wiki/trigger/is_operative): Before use, confirm the current scope is an operative character to avoid false positives on non-operative CHARACTERs that could cause errors.
  • [operative_leader_mission](/wiki/trigger/operative_leader_mission): Commonly used alongside this trigger—the former checks the specific operation being executed, while the latter checks the current mission mode, and combining them allows precise matching of the operative's complete work status.
  • [force_operative_leader_into_hiding](/wiki/effect/force_operative_leader_into_hiding): After confirming an operative is executing a certain operation, you can forcibly place them into hiding based on this condition, commonly seen in follow-up logic for "mission failure" or "exposure risk" scenarios.
  • [harm_operative_leader](/wiki/effect/harm_operative_leader): Similarly triggers after the operation check returns true, used to simulate story consequences where the operative takes damage during high-risk operations.

Common Pitfalls

  1. Scope in wrong location: This trigger must be called within a CHARACTER scope. Beginners often write it directly in a country scope (such as when ROOT or FROM points to a country), causing the game to error or the condition to always return false. You must first switch to operative character scope using methods like country_leader or every_operative before checking the condition.
  2. Operation token spelling depends on actual operation definition: The parameter passed in (such as operation_rescue_operative) must exactly match the operation key actually defined in common/operations/. If a custom operation added by a mod has the wrong key spelling, the condition will silently return false without throwing an error, making it extremely difficult to debug.