Wiki

effect · add_unit_leader_trait

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

Add trait to unit leader.
Example: SOV_konstantin_rokossovsky = { add_unit_leader_trait = media_personality }

实战 · 配合 · 坑

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

实战用法

add_unit_leader_trait 常用于剧本事件或国策完成时,为某位将领解锁特定特质,例如让一名指挥官在完成特定战役后获得"老练老兵"或"媒体红人"之类的特质,增强其属性或触发特殊机制。在自定义将领成长体系类 mod 中,也常通过事件链逐步为将领追加特质来模拟成长路径。

# 某国策完成后,为指定将领添加特质
complete_national_focus = {
    SOV_konstantin_rokossovsky = {
        add_unit_leader_trait = brilliant_strategist
    }
}

配合关系

  • [has_trait](/wiki/trigger/has_trait):在添加特质之前先检查将领是否已拥有该特质,避免重复添加造成逻辑混乱。
  • [remove_unit_leader_trait](/wiki/effect/remove_unit_leader_trait):常与之配对使用,先移除旧特质再添加新特质,实现特质的"升级替换"效果。
  • [add_timed_unit_leader_trait](/wiki/effect/add_timed_unit_leader_trait):作为对比选项,当需要临时性特质时改用此命令,明确两者的适用场景。
  • [add_skill_level](/wiki/effect/add_skill_level):常在同一事件选项中同步提升将领技能等级,与特质添加共同构成对将领的"奖励包"。

常见坑

  1. Scope 错误:此命令必须在 CHARACTER scope 下执行,直接写在 COUNTRY scope(如国策 effect 块)中而不先进入对应角色的 scope,会导致命令静默失效,且游戏日志中不一定给出明显报错。
  2. 特质名拼写或类型不匹配:填入的特质必须是已在 unit_leader_traits 中定义的合法特质 token,且要与将领类型(陆军指挥官、海军指挥官等)相符——将海军专属特质添加给陆军将领不会报错但通常不会生效或显示。

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

add_unit_leader_trait is commonly used in scripted events or upon national focus completion to unlock specific traits for a leader. For example, you might grant a commander the "Hardened Veteran" or "Media Personality" trait after completing a specific campaign, enhancing their attributes or triggering special mechanics. In custom leader progression system mods, event chains frequently use this command to progressively add traits to leaders, simulating their growth path.

# Upon completion of a certain focus, add a trait to a specified leader
complete_national_focus = {
    SOV_konstantin_rokossovsky = {
        add_unit_leader_trait = brilliant_strategist
    }
}

Synergy

  • [has_trait](/wiki/trigger/has_trait): Check whether a leader already possesses a trait before adding it, avoiding logic confusion from duplicate additions.
  • [remove_unit_leader_trait](/wiki/effect/remove_unit_leader_trait): Often paired with this command—remove an old trait first, then add a new one to achieve a "trait upgrade/replacement" effect.
  • [add_timed_unit_leader_trait](/wiki/effect/add_timed_unit_leader_trait): As an alternative option, use this command when temporary traits are needed, clarifying the appropriate use case for each.
  • [add_skill_level](/wiki/effect/add_skill_level): Frequently used in the same event option to simultaneously raise a leader's skill level, forming a complete "reward package" together with trait additions.

Common Pitfalls

  1. Scope Error: This command must execute within a CHARACTER scope. Writing it directly in a COUNTRY scope (such as within a national focus effect block) without first entering the corresponding character's scope will cause the command to silently fail, and the game log may not provide an obvious error message.
  2. Trait Name Misspelling or Type Mismatch: The trait entered must be a valid trait token already defined in unit_leader_traits, and must match the leader type (army commander, navy commander, etc.). Adding a navy-exclusive trait to an army leader will not produce an error but typically will not take effect or display.