Wiki

trigger · enemies_naval_strength_ratio

Definition

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

Description

Compares the estimated navy strength between the scope country and all its enemies

实战 · 配合 · 坑

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

实战用法

常用于判断己方海军是否足够强大以触发某些外交或战略决策,例如在海军扩张 mod 中当海军力量压倒敌方时解锁特殊决策,或在 AI 策略中控制是否对敌发起海上进攻。注意该 trigger 比较的是 scope 国与所有当前敌对国之间的海军估算实力比值,适合用在战时条件判断块中。

# 当己方海军实力超过所有敌人总和的 1.5 倍时,允许执行某项决策
available = {
    enemies_naval_strength_ratio > 1.5
}

配合关系

  • [enemies_strength_ratio](/wiki/trigger/enemies_strength_ratio):陆军实力比较的对应 trigger,常与本 trigger 同时使用,实现"陆海并重"的综合战略判断条件。
  • [alliance_naval_strength_ratio](/wiki/trigger/alliance_naval_strength_ratio):用于比较联盟整体海军实力,当需要区分"己方单独海军"与"整个阵营海军"时,两者配合使用逻辑更严密。
  • [has_enemy_naval_control](/wiki/trigger/has_enemy_naval_control):判断敌方是否掌握某海域制海权,与本 trigger 配合可形成"实力占优但尚未夺控"的复合触发条件。
  • [declare_war_on](/wiki/effect/declare_war_on):在 AI 决策或事件 effect 块中,先通过本 trigger 确认海军优势再触发宣战,避免弱势开战。

常见坑

  1. 无敌状态下行为未定义:若 scope 国当前没有任何敌人(不处于战争状态),该 trigger 的比较结果可能不符合预期(通常返回 false 或产生除零问题),需在外层先用 [any_enemy_country](/wiki/trigger/any_enemy_country) 确认存在敌国再使用本 trigger。
  2. 误用 scope:本 trigger 只支持 COUNTRY scope,新手容易将其写在 state 或 character 的条件块内,导致脚本报错或静默失效,务必确认外层 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

Commonly used to determine whether your own naval strength is sufficient to trigger certain diplomatic or strategic decisions. For example, in naval expansion mods, unlock special decisions when your naval power overwhelms enemies, or control whether AI should initiate naval attacks against opponents in strategy logic. Note that this trigger compares the naval strength ratio between the scoped country and all currently hostile nations, making it ideal for use in wartime condition check blocks.

# Allow executing a certain decision when your naval strength exceeds 1.5x the combined total of all enemies
available = {
    enemies_naval_strength_ratio > 1.5
}

Synergy

  • [enemies_strength_ratio](/wiki/trigger/enemies_strength_ratio): The corresponding trigger for land army strength comparison, commonly used together with this trigger to implement "balanced land and naval" comprehensive strategic condition checks.
  • [alliance_naval_strength_ratio](/wiki/trigger/alliance_naval_strength_ratio): Used to compare overall alliance naval strength. When you need to distinguish between "your nation's independent naval power" and "entire faction's naval power," using both triggers together creates more rigorous logic.
  • [has_enemy_naval_control](/wiki/trigger/has_enemy_naval_control): Determines whether enemies control naval supremacy in certain sea zones. Combined with this trigger, it forms a compound trigger condition of "superior strength but haven't secured control yet."
  • [declare_war_on](/wiki/effect/declare_war_on): In AI decision or event effect blocks, first confirm naval advantage through this trigger before triggering a declaration of war, avoiding disadvantageous warfare initiation.

Common Pitfalls

  1. Undefined behavior when no enemies exist: If the scoped country has no current enemies (not in a state of war), the trigger's comparison result may not behave as expected (typically returns false or produces division-by-zero issues). You must first use [any_enemy_country](/wiki/trigger/any_enemy_country) in an outer layer to confirm the existence of hostile countries before using this trigger.
  2. Incorrect scope usage: This trigger only supports COUNTRY scope. Beginners often mistakenly place it within condition blocks for state or character, causing script errors or silent failures. Always ensure the outer scope is at the country level.