Wiki

trigger · num_nukes_left_to_drop

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

number of nukes left to drop during this game tick (only useful in-between nuke drops, like in on_nuke_drop on-action, for example)

实战 · 配合 · 坑

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

实战用法

此 trigger 最典型的应用场景是在 on_nuke_drop on-action 中,判断当前国家本轮核弹投放结束前还剩余多少枚,从而触发额外的事件链或惩罚逻辑(例如"多核连投"时额外扣除稳定度)。也可用于自定义决策的 available 块,在核打击进行中动态禁用某些外交选项。

on_nuke_drop = {
    trigger = {
        num_nukes_left_to_drop > 0
    }
    effect = {
        add_stability = -0.05
        country_event = { id = my_mod.nuke_chain.1 }
    }
}

配合关系

  • [has_country_flag](/wiki/trigger/has_country_flag):在核弹连投时先设置标记、再用此 trigger 判断剩余数量,可实现分步骤的多阶段事件链,避免重复触发。
  • [add_nuclear_bombs](/wiki/effect/add_nuclear_bombs):在 on-action 期间根据 trigger 结果动态补充或扣减核弹库存,形成"核弹数量联动"的设计。
  • [has_country_leader_with_trait](/wiki/trigger/has_country_leader_with_trait):与领袖特质联用,区分不同领袖在核打击时的剩余轮次判断,实现差异化的惩罚或奖励逻辑。
  • [add_war_support](/wiki/effect/add_war_support):核弹连投剩余量越多时额外调整战争支持度,模拟持续核轰炸对本国民心的冲击。

常见坑

  1. 在 on-action 之外使用意义不大:此 trigger 只在同一游戏 tick 的核弹投放过程中才有有效值,若放在普通决策或焦点的 available 块中(并非由投核事件驱动),返回值几乎始终为 0,导致条件永远不满足,新手容易误以为是语法错误。
  2. 比较运算符方向混淆num_nukes_left_to_drop > 1num_nukes_left_to_drop < 1 含义截然相反,脚本中若想检测"已是最后一枚"应使用 < 2(或 = 1),写成 > 1 则反而是"还有多枚未投",逻辑完全相反而游戏不会报错,极难排查。

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

This trigger is most commonly used within the on_nuke_drop on-action to determine how many nuclear warheads remain before the current nation finishes its nuclear strike round, thereby triggering additional event chains or penalty logic (for example, deducting stability when performing "rapid multi-nuke strikes"). It can also be employed in the available block of custom decisions to dynamically disable certain diplomatic options during an ongoing nuclear strike.

on_nuke_drop = {
    trigger = {
        num_nukes_left_to_drop > 0
    }
    effect = {
        add_stability = -0.05
        country_event = { id = my_mod.nuke_chain.1 }
    }
}

Synergy

  • [has_country_flag](/wiki/trigger/has_country_flag): Set a flag during multi-nuke strikes, then use this trigger to check remaining quantities, enabling multi-stage event chains with step-by-step progression and preventing duplicate triggers.
  • [add_nuclear_bombs](/wiki/effect/add_nuclear_bombs): Dynamically supplement or deduct nuclear warhead stockpiles based on trigger results during on-actions, creating a "nuclear quantity linkage" design pattern.
  • [has_country_leader_with_trait](/wiki/trigger/has_country_leader_with_trait): Combine with leader traits to differentiate remaining strike rounds between different leaders, implementing varied penalty or reward logic during nuclear strikes.
  • [add_war_support](/wiki/effect/add_war_support): Adjust war support proportionally with the remaining nuclear warhead count during multi-nuke strikes, simulating the impact of sustained nuclear bombardment on domestic morale.

Common Pitfalls

  1. Limited value outside on-actions: This trigger only holds valid values during the nuclear strike sequence within the same game tick. If placed in a regular decision or focus's available block (not driven by a nuke event), it almost always returns 0, causing conditions to never be satisfied. Newcomers often mistakenly assume this is a syntax error.
  2. Comparison operator direction confusion: num_nukes_left_to_drop > 1 and num_nukes_left_to_drop < 1 have completely opposite meanings. If the script intends to detect "this is the final warhead," use < 2 (or = 1); writing > 1 instead means "multiple warheads remain," reversing the logic entirely. The game will not report an error, making this extremely difficult to debug.