Wiki

effect · random_army_leader

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on a random Army Leader of the country in scope, that fulfills the \"limit\" trigger.
tooltip=key can be added to override tooltip title.
ex: GER = {
  random_army_leader = {
	tooltip = my_loc_key # Optional
	include_invisible = yes # Optional - default = no
    ... character scope effects ...
  }
}

实战 · 配合 · 坑

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

实战用法

random_army_leader 常用于在国家事件或焦点效果中对随机一名陆军将领施加 buff 或特质,无需指定具体角色,非常适合"随机奖励某位将领"类的剧情设计。例如在某国完成某个国策后,给一位满足条件的将领添加特质并提升技能:

GER = {
    random_army_leader = {
        limit = {
            is_corps_commander = yes
            has_trait = skilled_staffer
        }
        add_trait = brilliant_strategist
        add_skill_level = 1
    }
}

配合关系

  • is_corps_commander — 在 limit 块内筛选军团指挥官,避免误选元帅级角色。
  • has_trait — 在 limit 块内进一步过滤已拥有特定特质的将领,精确定位目标。
  • add_unit_leader_trait — 与本指令配合为随机将领赋予单位领袖特质,是最常见的奖励手段。
  • add_skill_level — 搭配使用可在赋予特质的同时提升将领综合技能等级,增强奖励感。

常见坑

  1. 忘写 limit 导致选中意外角色:不加 limit 时会从所有陆军将领中随机选取,包括当前正在指挥关键战役的元帅或已退休角色,建议始终用 limit 配合 is_corps_commanderis_field_marshal 等触发器做范围限定。
  2. scope 使用错误random_army_leader 必须在国家 scope 下调用,若在州(state)或角色 scope 内直接使用会导致脚本报错或静默失效,需确保外层 scope 为目标国家标签或 THIS/ROOT 指向国家。

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

random_army_leader is commonly used in country events or focus effects to apply buffs or traits to a randomly selected army leader, without needing to target a specific character. This makes it ideal for "random leader reward" narrative designs. For example, after a country completes a focus, you can add a trait and increase the skill level of a leader who meets certain conditions:

GER = {
    random_army_leader = {
        limit = {
            is_corps_commander = yes
            has_trait = skilled_staffer
        }
        add_trait = brilliant_strategist
        add_skill_level = 1
    }
}

Synergy

  • is_corps_commander — Use inside a limit block to filter for corps commanders, preventing field marshals from being accidentally selected.
  • has_trait — Use inside a limit block to further narrow down leaders who already possess a specific trait, allowing precise targeting.
  • add_unit_leader_trait — Pair with this effect to grant a unit leader trait to the randomly selected leader; this is the most common form of reward.
  • add_skill_level — Combine with the above to simultaneously boost the leader's overall skill level alongside the trait grant, making the reward feel more impactful.

Common Pitfalls

  1. Forgetting limit and selecting an unintended character: Without a limit block, the effect picks from all army leaders at random, including field marshals currently commanding critical operations or characters who have already retired. Always use limit with triggers such as is_corps_commander or is_field_marshal to constrain the selection pool.
  2. Wrong scope: random_army_leader must be called within a country scope. Using it directly inside a state or character scope will cause a script error or silent failure. Make sure the enclosing scope resolves to the intended country tag, or that THIS/ROOT points to a country.