trigger · is_operation_type
Definition
- Supported scope:
OPERATION - Supported target:
THIS,ROOT,PREV,FROM,OWNER,CONTROLLER,OCCUPIED,CAPITAL
Description
checks the type of operation
is_operation_typeOPERATIONTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALchecks the type of operation
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
is_operation_type 常用于情报与特工系统的 mod 中,针对不同类型的行动执行差异化的判断逻辑,例如区分渗透、破坏或刺杀行动以触发不同的后续事件或限制条件。典型场景是在某个行动的 available 或 trigger 块中,仅允许特定类型的行动满足条件。
# 示例:仅当当前行动为特定类型时才允许执行
available = {
is_operation_type = operation_steal_the_enigma
}
[any_operative_leader](/wiki/trigger/any_operative_leader):常配合使用,先用 is_operation_type 确认行动类型,再通过 any_operative_leader 检查参与该类型行动的特工是否满足特定特质或技能要求。[all_operative_leader](/wiki/trigger/all_operative_leader):当需要对行动内所有特工施加严格限制时,与 is_operation_type 组合使用,确保只有特定行动类型才触发全员检查。[every_operative](/wiki/effect/every_operative):在 effect 块中,先以 is_operation_type 为前提判断,再用 every_operative 对参与该行动的所有特工批量施加效果,逻辑层次清晰。OPERATION scope 下使用,新手容易在国家 scope 或特工 scope 中直接调用,导致脚本报错或判断永远为假,需确认已通过事件或行动上下文正确进入 OPERATION scope。common/operations/ 目录下定义的文件名或 id 字段完全一致,随意猜测类型名会导致条件静默失败而不报错,调试时极难排查。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.
is_operation_type is commonly used in intelligence and operative system mods to execute differentiated logic for different types of operations, such as distinguishing between infiltration, sabotage, or assassination operations to trigger different subsequent events or constraints. A typical scenario is within an operation's available or trigger block, where only specific operation types are allowed to satisfy the condition.
# Example: Allow execution only when the current operation is of a specific type
available = {
is_operation_type = operation_steal_the_enigma
}
[any_operative_leader](/wiki/trigger/any_operative_leader): Commonly used in combination. First use is_operation_type to confirm the operation type, then check through any_operative_leader whether operatives involved in that operation type meet specific trait or skill requirements.[all_operative_leader](/wiki/trigger/all_operative_leader): When strict restrictions need to be applied to all operatives in an operation, combine with is_operation_type to ensure only specific operation types trigger a full-team check.[every_operative](/wiki/effect/every_operative): In effect blocks, first use is_operation_type as a prerequisite condition, then apply effects in bulk to all operatives involved in that operation using every_operative, with clear logical hierarchy.OPERATION scope. Beginners often call it directly in country scope or operative scope, causing script errors or conditions that always evaluate to false. Ensure you have correctly entered the OPERATION scope through events or operation context.id field defined in the common/operations/ directory. Guessing type names carelessly will cause conditions to fail silently without error reporting, making debugging extremely difficult.