Wiki

trigger · num_of_nukes

Definition

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

Description

check amount of nukes

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

num_of_nukes is commonly used to check whether a country has accumulated enough nuclear warheads to unlock special decisions, diplomatic options, or event branches. For example, in "nuclear deterrence"-themed mods, it can restrict war declarations or trigger diplomatic pressure events. It can also be used to verify completion conditions in achievement-focused mods.

# Example: Activate the "Nuclear Deterrence Declaration" decision when the country's nuclear warhead count reaches a threshold
available = {
    num_of_nukes > 5
}

Synergy

  • [add_nuclear_bombs](/wiki/effect/add_nuclear_bombs) — When used together, first check the current stockpile with num_of_nukes, then decide whether to increase or decrease warheads via this effect to avoid exceeding limits or duplicate rewards.
  • [has_completed_focus](/wiki/trigger/has_completed_focus) — Typically requires both completing a specific focus research and possessing sufficient nuclear warheads to satisfy all prerequisites for a particular decision.
  • [has_war_support](/wiki/trigger/has_war_support) (corresponding to has_bombing_war_support / has_casualties_war_support in the whitelist) — In nuclear deterrence-related events, combine nuclear warhead count with war support to simulate the population's threshold of acceptance toward nuclear strikes.
  • [exists](/wiki/trigger/exists) — Used together with target scope to ensure the checked country tag currently exists in the game, preventing trigger errors due to the country having been eliminated.

Common Pitfalls

  1. Scope Confusion: num_of_nukes is only valid under COUNTRY scope. Beginners often write it directly within STATE or UNIT_LEADER scope, causing script errors or permanently returning false. Always ensure the outer scope is a country, or explicitly convert via OWNER or similar targets.
  2. Missing Comparison Operators: This trigger must be paired with comparison operators (> < = etc.). Writing num_of_nukes = 0 and num_of_nukes < 1 are semantically identical but easily confused in meaning. Beginners often mistakenly use boolean syntax like num_of_nukes = yes, preventing the condition from evaluating correctly.