Wiki

trigger · attack_skill_level

Definition

  • Supported scope:CHARACTER, COMBATANT
  • Supported target:none

Description

Compares attack skill level of a unit leader.
Example: attack_skill_level > 5

实战 · 配合 · 坑

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

实战用法

attack_skill_level 常用于将领特性解锁、事件触发或决策 available 判断,例如只有当进攻技能达到一定水准的将领才能获得特定称号或触发专属事件。典型场景是在自定义将领成长体系中,作为晋升门槛条件。

# 仅当将领进攻技能大于 4 时,允许选择某项决策
available = {
    is_corps_commander = yes
    attack_skill_level > 4
}

配合关系

  • [defense_skill_level](/wiki/trigger/defense_skill_level):进攻与防御技能常组合使用,构建"全能将领"或"偏科将领"的综合判断条件。
  • [has_trait](/wiki/trigger/has_trait):在确认将领达到进攻技能阈值后,进一步检查是否已持有相关特性,避免重复授予。
  • [add_attack](/wiki/effect/add_attack):作为效果配合,当 attack_skill_level 满足前置条件时,通过该 effect 进一步提升进攻数值,实现条件式成长逻辑。
  • [skill](/wiki/trigger/skill)skill 检查将领综合等级,与 attack_skill_level 组合可区分"综合强但进攻弱"与"专攻型"将领,精细化筛选。

常见坑

  1. 比较运算符误用:新手有时写成 attack_skill_level = 5,但该 trigger 应使用 ><>=<= 等比较运算符而非等号,等号赋值写法在此处无效或行为不符合预期。
  2. Scope 未切换到将领:在国家 scope 下直接写该 trigger 会导致报错或静默失败,必须先通过 any_army_leaderevery_unit_leader 等方式将 scope 切换到 CHARACTER 或 COMBATANT 后再使用。

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

attack_skill_level is commonly used to unlock general traits, trigger events, or determine decision availability—for example, only generals with sufficient attack skill levels can receive specific titles or trigger exclusive events. A typical scenario is within custom general progression systems, where it serves as a promotion threshold condition.

# Only allow a decision to be selected when the general's attack skill exceeds 4
available = {
    is_corps_commander = yes
    attack_skill_level > 4
}

Synergy

  • [defense_skill_level](/wiki/trigger/defense_skill_level): Attack and defense skills are often used together to construct compound conditions for "well-rounded generals" or "specialized generals."
  • [has_trait](/wiki/trigger/has_trait): After confirming a general meets the attack skill threshold, further check whether they already possess the relevant trait to avoid duplicate grants.
  • [add_attack](/wiki/effect/add_attack): As a complementary effect, when attack_skill_level meets prerequisite conditions, use this effect to further boost attack values, enabling conditional growth logic.
  • [skill](/wiki/trigger/skill): The skill trigger checks a general's overall level; combining it with attack_skill_level allows you to distinguish between "high overall strength but weak attack" and "specialist-type" generals for refined filtering.

Common Pitfalls

  1. Comparison operator misuse: Beginners sometimes write attack_skill_level = 5, but this trigger should use comparison operators like >, <, >=, <= rather than the equals sign. Using assignment syntax here is ineffective or produces unexpected behavior.
  2. Scope not switched to general: Writing this trigger directly under a country scope will cause errors or silent failures. You must first switch the scope to CHARACTER or COMBATANT using constructs like any_army_leader or every_unit_leader before using it.