Wiki

trigger · any_army_leader

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if at least one Army Leader of the Country in scope matches the triggers.
tooltip=key can be defined to override title.
ex: GER = {
  any_army_leader = {
	tooltip = my_loc_key # Optional
	include_invisible = yes # Optional - default = no
    ... character scope triggers ...
  }
}

实战 · 配合 · 坑

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

实战用法

any_army_leader 常用于检查某国是否拥有至少一名满足特定条件的陆军将领,例如判断某国是否有高技能或带有特定 trait 的将领,再决定是否触发事件、解锁决议或允许某些选项。典型场景包括:某国拥有带有"攻击大师"特性的将领时才能选择特定国策分支,或在 AI 逻辑中评估敌方将领能力。

# 检查德国是否有一名陆军将领拥有 trait 且技能达标
GER = {
    any_army_leader = {
        has_trait = brilliant_strategist
        skill > 3
    }
}

配合关系

  • has_trait:与 any_army_leader 嵌套使用,筛选带有特定将领特性(如 panzer_leader)的陆军将领,是最常见的内层条件。
  • is_field_marshal:在 any_army_leader 块内用于进一步区分该将领是否已晋升为元帅,避免误判阶级。
  • planning_skill_level:用于检查将领的计划技能等级是否达到阈值,常用于衡量战略准备度的触发条件。
  • logistics_skill_level:与 any_army_leader 配合检查后勤技能,在补给系统 mod 中判断国家是否具备高效后勤保障能力。

常见坑

  1. 作用域错误any_army_leader 只能在 COUNTRY scope 下使用,若在 STATECHARACTER 等 scope 内调用会静默失效或报错,需确保外层 scope 已切换至国家。
  2. 将内层当 effect 使用any_army_leader 是纯 trigger,块内只能写 trigger 条件(如 has_traitskill),不可直接写 add_trait 等 effect;若要对满足条件的将领执行操作,应改用 effect 侧的 every_army_leader 配合 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

any_army_leader is commonly used to check whether a country has at least one army leader meeting specific conditions — for example, determining whether a country has a high-skill leader or one with a particular trait, then deciding whether to fire an event, unlock a decision, or enable certain options. Typical use cases include: gating a specific focus branch behind a country having a leader with the brilliant_strategist trait, or evaluating enemy leader capability inside AI logic.

# Check whether Germany has an army leader with a specific trait and sufficient skill
GER = {
    any_army_leader = {
        has_trait = brilliant_strategist
        skill > 3
    }
}

Synergy

  • has_trait: Nested inside any_army_leader to filter for leaders carrying a specific trait (e.g. panzer_leader). This is the most common inner condition.
  • is_field_marshal: Used inside an any_army_leader block to further distinguish whether the matched leader has already been promoted to field marshal, preventing false positives across ranks.
  • planning_skill_level: Checks whether a leader's planning skill level meets a threshold; frequently used as a trigger condition for measuring strategic readiness.
  • logistics_skill_level: Paired with any_army_leader to check logistics skill, useful in supply-system mods for determining whether a country has efficient logistical support.

Common Pitfalls

  1. Wrong scope: any_army_leader can only be used inside a COUNTRY scope. Calling it inside a STATE, CHARACTER, or other scope will cause it to silently fail or throw an error. Make sure the outer scope has been switched to a country before using it.
  2. Treating the inner block as an effect: any_army_leader is a pure trigger — only trigger conditions (such as has_trait or skill) may be written inside its block. Effects like add_trait cannot be placed there directly. If you need to perform operations on leaders that match the conditions, use the effect-side every_army_leader with a limit block instead.