Wiki

effect · add_skill_level

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

Adds a skill level to a unit leader
Example: add_skill_level = 1

实战 · 配合 · 坑

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

实战用法

add_skill_level 常用于剧本事件或国策完成后为将领提升技能等级,例如让某位历史名将在完成特定任务后获得成长。在招募或晋升将领的 character 事件链中也常见其身影,赋予玩家操作感。

# 某将领完成战役后技能提升
country_event = {
    id = my_mod.1
    immediate = {
        random_army_leader = {
            limit = { has_trait = brilliant_strategist }
            add_skill_level = 2
        }
    }
}

配合关系

  • [skill](/wiki/trigger/skill) — 先检查当前技能等级是否低于上限,避免溢出或违反游戏逻辑再执行提升。
  • [add_trait](/wiki/effect/add_trait) / [add_unit_leader_trait](/wiki/effect/add_unit_leader_trait) — 技能提升往往伴随新特质,两者同步使用可塑造将领成长感。
  • [gain_xp](/wiki/effect/gain_xp) — 有时需要同时补充经验值,确保等级与 XP 状态保持一致,避免升级后经验显示异常。
  • [is_corps_commander](/wiki/trigger/is_corps_commander) / [is_field_marshal](/wiki/trigger/is_field_marshal) — 确认角色身份后再调用,防止对非单位指挥官角色(如顾问)错误执行。

常见坑

  1. 作用域错误add_skill_level 必须在 CHARACTER scope 下调用。直接写在 country 作用域里会静默失效,新手常因此以为效果没生效,需用 random_army_leaderspecific_character 等先进入正确 scope。
  2. 无视上限导致数值异常:游戏各技能项有隐性上限,盲目叠加大数值(如 add_skill_level = 10)可能产生超限的怪异显示;建议搭配 [skill](/wiki/trigger/skill) 做条件判断,或分多步小幅度提升。

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_skill_level is commonly used in scripted events or after focus completion to increase a commander's skill level, such as allowing a historical general to grow after completing specific objectives. It frequently appears in character event chains during recruitment or promotion, giving players a sense of agency.

# Skill increase after a commander completes a campaign
country_event = {
    id = my_mod.1
    immediate = {
        random_army_leader = {
            limit = { has_trait = brilliant_strategist }
            add_skill_level = 2
        }
    }
}

Synergy

  • [skill](/wiki/trigger/skill) — First verify that the current skill level is below the cap before executing the increase, preventing overflow or violating game logic.
  • [add_trait](/wiki/effect/add_trait) / [add_unit_leader_trait](/wiki/effect/add_unit_leader_trait) — Skill increases often come with new traits; using both together creates a sense of commander development.
  • [gain_xp](/wiki/effect/gain_xp) — Sometimes experience points need to be supplemented simultaneously to keep level and XP state consistent, preventing display anomalies after leveling.
  • [is_corps_commander](/wiki/trigger/is_corps_commander) / [is_field_marshal](/wiki/trigger/is_field_marshal) — Confirm the character's role before calling this effect to prevent incorrect execution on non-military commander characters (such as advisors).

Common Pitfalls

  1. Scope errors: add_skill_level must be called under CHARACTER scope. Writing it directly in a country scope will silently fail; newcomers often assume the effect didn't work. Use random_army_leader, specific_character, etc. to enter the correct scope first.
  2. Ignoring caps causes numerical anomalies: Each skill category has hidden upper limits. Blindly stacking large values (such as add_skill_level = 10) may produce odd display overflows; it's recommended to pair with [skill](/wiki/trigger/skill) for conditional checks, or increase in multiple small steps.