Wiki

trigger · alliance_naval_strength_ratio

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Compares the estimated naval strength between the scope country, his allies and his enemies.

实战 · 配合 · 坑

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

实战用法

alliance_naval_strength_ratio 常用于判断玩家或 AI 国家的海军联合实力相对于敌方是否占优,例如在海军扩张决策、外交事件或战争准备 focus 中作为解锁条件。典型场景是:当己方及盟友的海军优势尚未确立时,阻止 AI 贸然开战,或在海军劣势时触发紧急补充事件。

# 仅当己方联盟海军实力不低于敌方 1.2 倍时才允许执行该决策
available = {
    alliance_naval_strength_ratio > 1.2
}

配合关系

  • [alliance_strength_ratio](/wiki/trigger/alliance_strength_ratio):陆军综合实力对比,常与本 trigger 同时评估,确保制海权与制陆权都满足后再触发进攻性决策。
  • [enemies_naval_strength_ratio](/wiki/trigger/enemies_naval_strength_ratio):从敌方视角衡量海军力量,与本 trigger 形成互补校验,避免因盟友贡献被重复计算而误判。
  • [has_defensive_war](/wiki/trigger/has_defensive_war):判断当前是否处于防御战,通常与本 trigger 配合使用——海军劣势 + 防御战状态可触发紧急强化 AI 策略或特殊援助事件。
  • [add_ai_strategy](/wiki/effect/add_ai_strategy):在海军比值不足时,通过该 effect 向 AI 注入加大海军建造的战略权重,与本 trigger 形成"判断→响应"闭环。

常见坑

  1. 忽略"盟友"的动态性:该 trigger 计算的是当前盟友总和,若盟友在脚本执行期间退出同盟或被占领,比值会发生突变,导致原本满足条件的判断失效,建议配合 [any_allied_country](/wiki/trigger/any_allied_country) 提前确认关键盟友仍然存在。
  2. 阈值方向写反:新手常将 > 1.0 误写成 < 1.0 来表示"我方占优",需要明确该 ratio 大于 1 表示己方联盟强于敌方,小于 1 表示劣势,逻辑写反会导致条件与预期完全相反。

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

alliance_naval_strength_ratio is commonly used to evaluate whether a player's or AI nation's combined naval strength relative to enemies is advantageous. Typical applications include naval expansion decisions, diplomatic events, or war preparation focuses as unlock conditions. Common scenarios include: preventing AI from rashly starting wars when allied naval superiority hasn't been established, or triggering emergency reinforcement events when facing naval inferiority.

# Only allow this decision to execute when allied naval strength is at least 1.2x that of enemies
available = {
    alliance_naval_strength_ratio > 1.2
}

Synergy

  • [alliance_strength_ratio](/wiki/trigger/alliance_strength_ratio): Measures combined land military strength. Often evaluated alongside this trigger to ensure both naval and land supremacy are satisfied before triggering offensive decisions.
  • [enemies_naval_strength_ratio](/wiki/trigger/enemies_naval_strength_ratio): Evaluates naval power from the enemy perspective. Complements this trigger with mutual validation, avoiding misjudgments caused by duplicate counting of ally contributions.
  • [has_defensive_war](/wiki/trigger/has_defensive_war): Determines if currently in a defensive war. Typically used with this trigger—naval inferiority combined with defensive war status can trigger emergency AI reinforcement strategies or special aid events.
  • [add_ai_strategy](/wiki/effect/add_ai_strategy): When naval ratio is insufficient, use this effect to inject increased naval construction weight into AI strategic priorities, forming a "judgment→response" feedback loop with this trigger.

Common Pitfalls

  1. Overlooking the dynamic nature of allies: This trigger calculates the current sum of allies. If allies leave the faction or are occupied during script execution, the ratio will shift dramatically, invalidating previously satisfied conditions. It's recommended to pair this with [any_allied_country](/wiki/trigger/any_allied_country) to confirm key allies still exist beforehand.
  2. Reversing the threshold direction: Beginners often mistakenly write < 1.0 instead of > 1.0 to represent "my side has superiority." Clarify that a ratio greater than 1 means the allied side is stronger than enemies, while less than 1 means inferiority. Inverted logic will make conditions work opposite to expectations.