Wiki

trigger · is_preparing_operation

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

checks if preparing a specific operation.
Example: 
is_preparing_operation = { 
 target = ITA 
 operation = operation_infiltrate_armed_forces_navy}

实战 · 配合 · 坑

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

实战用法

is_preparing_operation 常用于谍报相关 mod 场景,例如在某国正在对目标策划特定行动时,动态调整 AI 决策或锁定某些外交选项。比如可在 available 块中判断己方是否已在针对特定目标准备行动,避免玩家重复发起冗余的谍报任务。

# 示例:某决策仅在尚未对意大利准备渗透行动时才可用
available = {
    NOT = {
        is_preparing_operation = {
            target = ITA
            operation = operation_infiltrate_armed_forces_navy
        }
    }
}

配合关系

  • [has_active_mission](/wiki/trigger/has_active_mission):常与本 trigger 搭配,先检查是否有进行中的任务,再判断是否同时在准备特定行动,形成多层条件保护。
  • [any_operative_leader](/wiki/trigger/any_operative_leader):用于进一步限定执行行动的特工是否满足特定条件,与本 trigger 共同构成"行动 + 执行者"的双重校验。
  • [add_operation_token](/wiki/effect/add_operation_token):在条件满足后奖励或消耗行动令牌,是谍报任务链中紧随条件判断的典型 effect。
  • [country_event](/wiki/effect/country_event):当检测到某国正在准备行动时触发剧情事件,实现谍报行动被察觉等叙事效果。

常见坑

  1. target 填写错误的 scope 对象target 必须填写国家 TAG(如 ITA),新手有时误填州 ID 或省份 ID,导致 trigger 永远返回假且不报错,难以排查。
  2. operation 字段填写非精确 keyoperation 必须填写 operation_ 开头的完整定义 key,与实际脚本文件中的 name 字段严格对应,填写本地化名称(如中文或英文显示名)会导致条件失效。

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

is_preparing_operation is commonly used in espionage-related mod scenarios, such as dynamically adjusting AI decisions or locking certain diplomatic options when a nation is planning a specific operation against a target. For example, you can check within an available block whether your nation is already preparing an operation against a specific target, preventing players from initiating redundant espionage tasks.

# Example: A decision is only available if you are not yet preparing an infiltration operation against Italy
available = {
    NOT = {
        is_preparing_operation = {
            target = ITA
            operation = operation_infiltrate_armed_forces_navy
        }
    }
}

Synergy

  • [has_active_mission](/wiki/trigger/has_active_mission): Often paired with this trigger to first check if there are active missions, then determine whether you are simultaneously preparing a specific operation, forming multi-layered condition protection.
  • [any_operative_leader](/wiki/trigger/any_operative_leader): Used to further restrict whether the operative executing the operation meets specific conditions, working together with this trigger to form a dual verification of "operation + executor".
  • [add_operation_token](/wiki/effect/add_operation_token): Rewards or consumes operation tokens after conditions are met, serving as a typical effect that immediately follows condition checks in espionage task chains.
  • [country_event](/wiki/effect/country_event): Triggers narrative events when detecting that a nation is preparing an operation, achieving storytelling effects such as espionage operations being discovered.

Common Pitfalls

  1. Incorrect scope object in target field: target must be filled with a country TAG (such as ITA). Beginners sometimes mistakenly fill in state IDs or province IDs, causing the trigger to always return false without error reporting, making it difficult to debug.
  2. Inaccurate key in operation field: operation must be filled with the complete definition key starting with operation_, strictly corresponding to the name field in the actual script file. Using localized names (such as Chinese or English display names) will cause the condition to fail.