Wiki

effect · launch_nuke

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

launch nuke at a state. usage : 
launch_nuke = { 
   provinve = 42 #will nuke this province if specified
   state = 42 #use either province or state. if state is used it will prefer enemies first while picking a province to nuke. otherwise it will pick one of the neutrals
   controller = GER #if state and controller is specified, the effect will pick a province that is controlled by this tag
   use_nuke = yes #will consume nuke if specified
   nuke_type = nuclear_bomb # type of nuke to use (e.g. nuclear_bomb, thermonuclear_bomb etc.)
}

实战 · 配合 · 坑

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

实战用法

launch_nuke 常用于剧情事件或决策中触发核打击,例如在玩家完成特定核武器项目后赋予一次"战略核打击"选项,或在 AI 脚本中模拟历史上的核武器使用。下面示例演示在一个国家事件中对指定州发动核打击并消耗核弹:

country_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        # 对目标州发动核打击,优先选择敌方省份,并消耗一枚核弹
        launch_nuke = {
            state = 42
            controller = GER
            use_nuke = yes
            nuke_type = nuclear_bomb
        }
    }
}

配合关系

  • [add_nuclear_bombs](/wiki/effect/add_nuclear_bombs):在核打击前先通过此命令确保库存中有足够核弹,再配合 use_nuke = yes 使用,逻辑上形成"生产→使用"闭环。
  • [has_breakthrough_points](/wiki/trigger/has_breakthrough_points):可在触发条件块中用来判断玩家是否完成了核技术突破,满足条件才允许执行核打击事件。
  • [add_named_threat](/wiki/effect/add_named_threat):核打击后往往需要同步提升全球紧张度,二者配合可模拟核使用对国际局势的政治后果。
  • [country_event](/wiki/effect/country_event):核打击后可向目标国或第三方国家触发外交抗议或战争宣言事件,丰富叙事链条。

常见坑

  1. provincestate 混用导致无效provincestate 只能二选一;若同时写入两个字段,脚本行为不可预期,应明确选择其中一种定位方式。controller 字段仅在使用 state 时生效,若配合 province 使用会被忽略。
  2. 忘记检查核弹库存就写 use_nuke = yes:若当前国家核弹数量为零却仍指定消耗核弹,效果可能静默失败或触发异常,务必在条件块(trigger)中先用 [has_army_manpower](/wiki/trigger/has_army_manpower) 类似的判断思路验证库存,或在调用前用 [add_nuclear_bombs](/wiki/effect/add_nuclear_bombs) 补充库存。

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

launch_nuke is commonly used in scripted events or decisions to trigger nuclear strikes, such as granting players a "strategic nuclear strike" option after completing a specific nuclear weapons project, or simulating historical nuclear weapon usage in AI scripts. The example below demonstrates launching a nuclear strike against a specified state in a country event and consuming a nuclear warhead:

country_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        # Launch nuclear strike against target state, prioritizing enemy provinces, and consume one nuclear warhead
        launch_nuke = {
            state = 42
            controller = GER
            use_nuke = yes
            nuke_type = nuclear_bomb
        }
    }
}

Synergy

  • [add_nuclear_bombs](/wiki/effect/add_nuclear_bombs): Before executing a nuclear strike, use this command to ensure sufficient nuclear warheads in inventory, then combine with use_nuke = yes. This creates a logical "production → deployment" loop.
  • [has_breakthrough_points](/wiki/trigger/has_breakthrough_points): Can be used in trigger blocks to check whether the player has completed nuclear technology breakthroughs, allowing the nuclear strike event to execute only when conditions are met.
  • [add_named_threat](/wiki/effect/add_named_threat): After a nuclear strike, it is often necessary to simultaneously increase global tension. Using both commands together simulates the political consequences of nuclear weapon use on the international situation.
  • [country_event](/wiki/effect/country_event): After a nuclear strike, you can trigger diplomatic protest or war declaration events to the target nation or third parties, enriching the narrative chain.

Common Pitfalls

  1. Mixing province and state causes invalid targeting: Only one of province or state can be used; writing both fields simultaneously results in unpredictable script behavior. Always explicitly choose one targeting method. The controller field only takes effect when using state; if combined with province it will be ignored.
  2. Forgetting to verify nuclear warhead inventory before setting use_nuke = yes: If the current nation has zero nuclear warheads yet you still specify consuming warheads, the effect may silently fail or trigger exceptions. Always validate inventory using trigger conditions (trigger) with logic similar to [has_army_manpower](/wiki/trigger/has_army_manpower), or replenish inventory with [add_nuclear_bombs](/wiki/effect/add_nuclear_bombs) before execution.