Wiki

trigger · all_navy_leader

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if all Navy Leaders of the Country in scope match the triggers.
tooltip=key can be defined to override title.
ex: GER = {
  all_navy_leader = {
	tooltip = my_loc_key # Optional
	include_invisible = yes # Optional - default = no
    ... character scope triggers ...
  }
}

实战 · 配合 · 坑

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

实战用法

all_navy_leader 常用于检查某国所有海军将领是否都满足特定条件,例如验证是否每位海军指挥官都具备某个特质、达到某个技能等级,或作为国策/事件可用条件的前置判断。典型场景包括:触发特殊事件前确保全体海军精英已就位,或在 mod 中为"海军强国"成就设置解锁门槛。

# 检查德国所有海军将领是否都拥有 bold trait 且技能 >= 3
GER = {
    all_navy_leader = {
        has_trait = bold
        skill > 2
    }
}

配合关系

  • any_of_scopes — 当需要"至少一位"海军将领满足条件时,与 all_navy_leader 形成对比,两者常在同一 trigger 块中搭配,覆盖"全部"与"任意"两种判断逻辑。
  • is_navy_leader — 在进入角色 scope 后用来二次确认该角色确实是海军将领身份,避免误判兼任多职的人物。
  • has_trait — 最常见的内层判断,用于检测将领是否持有特定特质,是 all_navy_leader 块内最核心的子条件。
  • skill — 与 all_navy_leader 搭配检查将领综合技能值,常与 attack_skill_leveldefense_skill_level 等同时出现以精确限定将领质量门槛。

常见坑

  1. scope 填错导致静默失败all_navy_leader 只能在 COUNTRY scope 下调用,若在 state scope 或 character scope 中直接使用,脚本不会报错但条件永远不会按预期求值,排查时要确认外层 scope 是国家。
  2. 空集默认返回 true:若某国当前没有任何海军将领,all_navy_leader 会对空集返回 true("全部满足"在空集上成立),新手容易将此误解为条件有效触发,建议同时搭配 count_triggers 或前置检查确保将领数量大于 0,再依赖此 trigger 的结果。

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

all_navy_leader is commonly used to check whether every naval leader of a given country meets specific conditions — for example, verifying that all naval commanders possess a certain trait, have reached a particular skill level, or satisfy prerequisites for a focus or event. Typical use cases include ensuring that all elite naval commanders are in place before triggering a special event, or setting unlock thresholds for a "naval superpower" achievement in a mod.

# Check whether all of Germany's naval leaders have the bold trait and skill >= 3
GER = {
    all_navy_leader = {
        has_trait = bold
        skill > 2
    }
}

Synergy

  • any_of_scopes — Used when you need "at least one" naval leader to satisfy a condition, forming a natural counterpart to all_navy_leader. The two are often paired within the same trigger block to cover both "all" and "any" evaluation logic.
  • is_navy_leader — Used after entering a character scope to confirm that the character is indeed a naval leader, preventing false positives for characters who hold multiple roles simultaneously.
  • has_trait — The most common inner condition, used to check whether a leader possesses a specific trait. It is the most essential sub-condition inside an all_navy_leader block.
  • skill — Paired with all_navy_leader to check a leader's overall skill value. Frequently appears alongside attack_skill_level, defense_skill_level, and similar fields to precisely define a minimum quality threshold for leaders.

Common Pitfalls

  1. Silent failure caused by wrong scope: all_navy_leader can only be called within a COUNTRY scope. If used directly inside a state scope or character scope, the script will not throw an error, but the condition will never evaluate as expected. When debugging, always confirm that the enclosing scope is a country.
  2. Empty set defaults to true: If a country currently has no naval leaders at all, all_navy_leader returns true over the empty set (vacuous truth — "all members satisfy the condition" holds trivially when there are no members). Beginners often mistake this for a valid trigger firing. It is recommended to pair this trigger with count_triggers or a prior check that ensures the leader count is greater than 0 before relying on its result.