Wiki

trigger · num_of_naval_factories

Definition

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

Description

check amount of naval factories

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_naval_factories is commonly used to check whether a country has sufficient naval industrial capacity to unlock specific national focuses, decisions, or advisor options—for example, only nations possessing a certain number of naval factories may gain access to construction plans for a super battleship. It can also be employed in AI strategy logic to restrict weak landlocked or coastless nations from triggering naval-related event chains.

# Example: Allow activation of a naval expansion decision only when sufficient naval factories are present
available = {
    num_of_naval_factories > 5
}

Synergy

  • [has_navy_size](/wiki/trigger/has_navy_size) —— Often paired with this trigger to simultaneously check both naval factory count and current navy size, ensuring the nation has both production capacity and practical military need, preventing national focuses or decisions from triggering meaninglessly for minor powers. (Note: replace with actual triggers from the whitelist; this illustrates the logic only)
  • [building_count_trigger](/wiki/trigger/building_count_trigger) —— Allows more granular inspection of factory building counts in specific states, complementing num_of_naval_factories' global country-level check, useful for distinguishing whether factories are concentrated in core territory or occupied regions.
  • [controls_state](/wiki/trigger/controls_state) —— Naval factories typically concentrate in coastal states; pairing with this trigger confirms key shipbuilding states remain under player control, preventing already-occupied factories from being incorrectly counted in the evaluation.
  • [add_offsite_building](/wiki/effect/add_offsite_building) —— As a reward effect upon meeting conditions, grants additional naval factory production capacity, forming a positive incentive design with this trigger: "check threshold → grant enhanced capacity."

Common Pitfalls

  1. Including occupied territory naval factories in the count: num_of_naval_factories tallies all naval factories actually available to the nation (including those in controlled occupied territory), not just core homeland states. Newcomers wanting to count only homeland factories will encounter miscalculations using this trigger alone; further filtering via controls_state or all_owned_state is necessary.
  2. Using it in non-COUNTRY scope blocks: This trigger is valid only under country scope. If mistakenly placed within a state (STATE) scope limit block (for example, inside restrictions within every_owned_state without switching back to country scope), the script will not error but the condition will never function as intended. Ensure the correct country scope context when calling it.