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
num_of_naval_factoriesCOUNTRYTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALcheck amount of naval factories
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
num_of_naval_factories 常见于判断一个国家是否具备足够的海军工业基础,以解锁特定国策、决议或顾问选项——例如,只有拥有一定数量海军工厂的国家才能获得某艘超级战列舰的建造计划。也可用于 AI 策略判断,限制弱小内陆国或无海岸线国家触发海军相关事件链。
# 示例:仅当拥有足够海军工厂时,才允许激活某个海军扩张决议
available = {
num_of_naval_factories > 5
}
[has_navy_size](/wiki/trigger/has_navy_size) —— 常与本 trigger 搭配,同时检查海军工厂数量与现有海军规模,确保国家既有生产能力又有实战需求,避免国策/决议对小国无意义触发。(注:请以白名单中实际存在的 trigger 替换,此处仅作说明逻辑)[building_count_trigger](/wiki/trigger/building_count_trigger) —— 可以更精细地检查特定州的工厂建筑数量,与 num_of_naval_factories 从国家层面的全局检查形成互补,用于区分工厂集中在核心领土还是占领地的情况。[controls_state](/wiki/trigger/controls_state) —— 海军工厂通常集中在沿海州,配合此 trigger 可确认关键造船州仍在玩家控制下,避免已被占领的工厂被错误计入判断依据。[add_offsite_building](/wiki/effect/add_offsite_building) —— 作为满足条件后的奖励效果,给予额外的海军工厂产能,与本 trigger 构成"检查达标 → 给予更强产能"的正向激励设计。num_of_naval_factories 统计的是该国实际可用(含占领地受控)的海军工厂总数,而不是仅限本土核心州。新手若想只计算本土工厂,直接用此 trigger 会产生误判,需配合 controls_state 或 all_owned_state 做进一步筛选。limit 块内(例如 every_owned_state 的内部限制里未切换回国家 scope),脚本不会报错但条件永远不会按预期生效,需确保调用时已处于正确的国家 scope 下。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.
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
}
[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."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.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.