Wiki

effect · every_navy_leader

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on every Navy Leader (or \"random_select_amount\" of random leader if specified) of the country in scope, that fulfills the \"limit\" trigger.
tooltip=key can be added to override tooltip title.
By default the effects are only displayed once, you may display them for each matching unit leader with display_individual_scopes.
ex: GER = {
  every_navy_leader = {
	tooltip = my_loc_key # Optional
	random_select_amount = 3 # Optional
	include_invisible = yes # Optional - default = no
	display_individual_scopes = yes # Optional - default = no
    ... character scope effects ...
  }
}

实战 · 配合 · 坑

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

实战用法

every_navy_leader 常用于国家事件或决策中批量修改所有海军将领的属性,例如某 mod 剧情触发后为一个国家全体海军领袖提升技能或加挂特质。也可以结合 limit 块对符合条件的海军将领定向施加效果,例如仅对缺乏某特质的将领进行补强。

GER = {
    every_navy_leader = {
        limit = {
            NOT = { has_trait = old_guard }
        }
        add_unit_leader_trait = naval_invader
        add_skill_level = 1
    }
}

配合关系

  • has_trait — 在 limit 块中筛选已拥有或缺少特定特质的海军将领,确保效果只施加在目标将领身上。
  • add_unit_leader_trait — 最常见的子效果,用于批量为满足条件的海军将领添加新特质。
  • add_skill_level — 与该命令组合,可在剧情或事件中一次性提升多名海军将领的综合技能等级。
  • remove_unit_leader_trait — 搭配使用可实现"先清除旧特质、再赋予新特质"的替换逻辑,常见于重大国家事件后的将领重塑。

常见坑

  1. scope 用错every_navy_leader 只能在 COUNTRY scope 下调用,若在 STATE 或 CHARACTER scope 下直接写会导致效果静默失效,新手常因为外层 scope 不对而调试困难。
  2. 遗漏 limit 导致意外覆盖:不加 limit 时效果会作用于该国所有海军将领(包括尚未入伍的角色),如果改动不可逆(如 remove_unit_leader_trait),可能破坏预设将领的初始设计,应养成显式写 limit 的习惯。

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

every_navy_leader is commonly used in country events or decisions to batch-modify the attributes of all naval leaders — for example, boosting skills or attaching traits to every naval leader of a country after a mod story event fires. It can also be combined with a limit block to target only leaders that meet specific conditions, such as reinforcing only those who lack a certain trait.

GER = {
    every_navy_leader = {
        limit = {
            NOT = { has_trait = old_guard }
        }
        add_unit_leader_trait = naval_invader
        add_skill_level = 1
    }
}

Synergy

  • has_trait — Used inside a limit block to filter naval leaders who already have or are missing a specific trait, ensuring the effect is applied only to the intended targets.
  • add_unit_leader_trait — The most common child effect; used to bulk-add a new trait to all qualifying naval leaders.
  • add_skill_level — Combined with this command, it allows you to raise the overall skill level of multiple naval leaders in a single event or story beat.
  • remove_unit_leader_trait — Pairing this with every_navy_leader enables a "strip old trait, apply new trait" replacement pattern, commonly seen in leader reworks triggered by major national events.

Common Pitfalls

  1. Wrong scope: every_navy_leader can only be called within a COUNTRY scope. Writing it directly inside a STATE or CHARACTER scope will cause the effect to silently fail — a frequent source of debugging headaches for newcomers who don't realize the outer scope is wrong.
  2. Omitting limit causes unintended overwrites: Without a limit block, the effect applies to every naval leader belonging to that country, including characters not yet recruited. If the change is irreversible (e.g. remove_unit_leader_trait), it can corrupt the intended initial setup of predefined leaders. Always make it a habit to write an explicit limit block.