Wiki

trigger · naval_strength_comparison

Definition

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

Description

Compares navies of two sides.
naval_strength_comparison = {
	other = GER # by default compares to the from scope
  tooltip = 'key' #tooltip is 'navy strength' by default, the key can be overridden if wanted 
	ratio > 1.5   # default is 1
	sub_unit_def_weights = { # if not specified, it will weigh all ships as 1. otherwise only specified sub unit types will be counted
		carrier = 1
		battleship = 2
	}
}

实战 · 配合 · 坑

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

实战用法

naval_strength_comparison 常用于判断某国海军是否已达到足以压制对手的规模,适合用在聚焦树解锁条件、决策可用判断或 AI 战略触发点中。例如,可以在"称霸大西洋"决策里要求本国海军实力至少是英国的 1.5 倍才能激活:

available = {
    naval_strength_comparison = {
        other = ENG
        ratio > 1.5
        sub_unit_def_weights = {
            battleship = 2
            destroyer = 1
            submarine = 1
        }
    }
}

配合关系

  • [enemies_naval_strength_ratio](/wiki/trigger/enemies_naval_strength_ratio):两者都衡量海军相对实力,但前者针对当前交战敌国整体,可与 naval_strength_comparison 组合形成"对特定国家"与"对所有敌人"双重校验。
  • [has_navy_size](/wiki/trigger/has_navy_size)(注:此处可用 [has_army_size](/wiki/trigger/has_army_size) 类比)与 naval_strength_comparison 搭配,先用绝对规模门槛过滤再做比值判断,避免双方都几乎无舰队时比值失真。
  • [declare_war_on](/wiki/effect/declare_war_on):通常在 naval_strength_comparison 返回真后才触发宣战 effect,确保 AI 或玩家在海军占优时才开战。
  • [alliance_naval_strength_ratio](/wiki/trigger/alliance_naval_strength_ratio):当需要把盟友舰队一同计入时用此 trigger 替代或并列使用,与 naval_strength_comparison 形成"单国 vs 联盟"的对比逻辑。

常见坑

  1. 忘记 sub_unit_def_weights 会把所有舰船等权计算:若不填该字段,航母和潜艇权重相同,导致拥有大量廉价潜艇的国家比值虚高;需要按作战价值手动赋权,否则触发条件会在意料之外的情况下成立。
  2. other 目标指向可能为空的 scope:若省略 other 字段,游戏默认使用 FROM scope,而在聚焦树或许多决策上下文中 FROM 并不存在,会导致 trigger 静默失败或报错;务必显式写明 other 指向具体国家标签或合法 scope。

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

naval_strength_comparison is commonly used to determine whether a nation's navy has reached sufficient strength to suppress its opponent, making it suitable for focus tree unlock conditions, decision availability checks, or AI strategic triggers. For example, you can require that a nation's naval strength be at least 1.5 times that of Britain in a "Dominate the Atlantic" decision to activate:

available = {
    naval_strength_comparison = {
        other = ENG
        ratio > 1.5
        sub_unit_def_weights = {
            battleship = 2
            destroyer = 1
            submarine = 1
        }
    }
}

Synergy

  • [enemies_naval_strength_ratio](/wiki/trigger/enemies_naval_strength_ratio): Both measure relative naval strength, but the former targets all current enemies in combat. They can be combined to form a dual verification of "against a specific country" and "against all enemies."
  • [has_navy_size](/wiki/trigger/has_navy_size) (by analogy, [has_army_size](/wiki/trigger/has_army_size)) pairs well with naval_strength_comparison. Use an absolute size threshold first to filter, then apply ratio comparisons, avoiding distorted ratios when both sides have nearly no fleets.
  • [declare_war_on](/wiki/effect/declare_war_on): Typically triggered only after naval_strength_comparison returns true, ensuring that the AI or player declares war only when enjoying naval superiority.
  • [alliance_naval_strength_ratio](/wiki/trigger/alliance_naval_strength_ratio): Use this trigger as a replacement or in parallel when you need to include allied fleets in the calculation, creating a "single nation vs coalition" comparison logic with naval_strength_comparison.

Common Pitfalls

  1. Forgetting sub_unit_def_weights calculates all ships with equal weight: If this field is omitted, carriers and submarines receive the same weight, causing nations with large numbers of cheap submarines to show artificially inflated ratios. You must manually assign weights according to combat value; otherwise, the trigger condition may activate in unexpected situations.
  2. The other target may point to a non-existent scope: If the other field is omitted, the game defaults to using the FROM scope, which often doesn't exist in focus tree or many decision contexts, causing the trigger to fail silently or error. Always explicitly specify other pointing to a concrete country tag or legal scope.