Wiki

effect · every_army_leader

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on every Army 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.
ex: GER = {
  every_army_leader = {
	tooltip = my_loc_key # Optional
	random_select_amount = 3 # Optional
	include_invisible = yes # Optional - default = no
    ... character scope effects ...
  }
}

实战 · 配合 · 坑

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

实战用法

every_army_leader 常用于在特定事件或决议触发时批量修改国家所有陆军将领的属性,例如在某场战争爆发时为全部将领添加特定特质,或在国家意识形态转变后清除某类特质。也常用于技能加成活动,如在某国庆事件中批量提升将领等级。

# 在某决议通过后,为所有攻击技能达标的陆军将领添加特质并提升技能
GER = {
    every_army_leader = {
        limit = {
            attack_skill_level > 2
            NOT = { has_trait = brilliant_strategist }
        }
        add_trait = { trait = skilled_staffer }
        add_skill_level = 1
    }
}

配合关系

  • has_trait — 在 limit 块中过滤已拥有特定特质的将领,避免重复添加造成报错或逻辑混乱。
  • add_unit_leader_trait — 与 every_army_leader 配合批量添加单位指挥官特质,适合一次性给全部将领赋予战时特质。
  • attack_skill_level — 在 limit 中按攻击技能数值筛选将领,实现按能力分档的差异化效果。
  • add_skill_level — 直接提升将领技能等级,是批量奖励将领时最常用的子效果之一。

常见坑

  1. scope 用错every_army_leader 只能在 COUNTRY scope 下调用,若写在 STATE 或 CHARACTER scope 内会导致脚本报错或静默失效,需确保外层是国家 scope(如 GER = { ... }ROOT = { ... } 且 ROOT 为国家)。
  2. limit 缺失导致全量误操作:不加 limit 时效果会作用于该国所有陆军将领(包括尚未上场的预备将领),在数量较多时可能造成意外的全局属性变化,建议养成始终写 limit 的习惯,哪怕条件是 always = yes 也能明确意图。

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_army_leader is commonly used to bulk-modify the attributes of all army leaders in a country when a specific event or decision fires — for example, adding a particular trait to every general when a war breaks out, or stripping certain traits after an ideological shift. It is also frequently used in bonus events, such as raising all generals' skill levels during a national holiday event.

# After a decision passes, add a trait and increase skill for all army leaders whose attack skill meets the threshold
GER = {
    every_army_leader = {
        limit = {
            attack_skill_level > 2
            NOT = { has_trait = brilliant_strategist }
        }
        add_trait = { trait = skilled_staffer }
        add_skill_level = 1
    }
}

Synergy

  • has_trait — Filter leaders who already possess a specific trait inside a limit block, preventing duplicate additions that would cause errors or logical inconsistencies.
  • add_unit_leader_trait — Pair with every_army_leader to bulk-add unit leader traits, ideal for granting all generals a wartime trait in a single pass.
  • attack_skill_level — Use inside limit to select leaders by attack skill value, enabling tiered effects based on capability.
  • add_skill_level — Directly increases a leader's skill level; one of the most commonly used sub-effects when rewarding generals in bulk.

Common Pitfalls

  1. Wrong scope: every_army_leader can only be called within a COUNTRY scope. Placing it inside a STATE or CHARACTER scope will cause a script error or silent failure. Make sure the enclosing scope is a country scope (e.g. GER = { ... } or ROOT = { ... } where ROOT is a country).
  2. Missing limit causes unintended mass changes: Without a limit, the effect applies to every army leader in the country — including reserve generals who have not yet been deployed — which can produce unexpected global attribute changes when the roster is large. It is good practice to always write a limit block; even always = yes makes the intent explicit.