effect · add_attack
Definition
- Supported scope:
CHARACTER - Supported target:
none
Description
Adds attack skill to a character
Example: add_attack = 1
add_attackCHARACTERnoneAdds attack skill to a character
Example: add_attack = 1
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
add_attack 常用于 mod 中为特定角色提供成长奖励,例如在将领完成特定战役任务后动态强化其进攻属性,或作为国家焦点/决议的奖励提升关键指挥官的能力值。该效果只能在 CHARACTER scope 下执行,因此通常需要先通过事件或焦点将 scope 切换到目标角色。
# 国家焦点奖励:强化某位将领的进攻技能
focus = {
id = train_elite_commander
...
completion_reward = {
# 假设已通过 characters 列表定义了 GER_erwin_rommel
GER_erwin_rommel = {
add_attack = 2
}
}
}
[add_defense](/wiki/effect/add_defense):进攻与防御技能通常成对调整,用于塑造一个攻守兼备或偏科型的将领形象。[add_skill_level](/wiki/effect/add_skill_level):整体技能等级提升往往与单项属性增强同步使用,避免角色属性分布过于失衡。[add_trait](/wiki/effect/add_trait):为将领添加特质与属性加成组合使用,可以更立体地体现某种战术风格(如同时给"进攻专家"特质和攻击加成)。[attack_skill_level](/wiki/trigger/attack_skill_level):在给予加成前用触发器检查当前进攻等级,防止属性溢出或超出设计上限,做条件保护。add_attack 必须在 CHARACTER scope 下执行,直接写在 COUNTRY scope 的 completion_reward 或 immediate 块中会导致脚本报错或静默失败。需要先用角色 token(如 GER_erwin_rommel = { ... })显式切换到对应角色的 scope。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.
add_attack is commonly used in mods to provide growth bonuses to specific characters, such as dynamically enhancing a general's attack attribute after completing a specific campaign objective, or as a reward from national focuses/decisions to boost the capability values of key commanders. This effect can only be executed within CHARACTER scope, so it typically requires first switching scope to the target character through events or focuses.
# National focus reward: enhance a general's attack skill
focus = {
id = train_elite_commander
...
completion_reward = {
# Assuming GER_erwin_rommel has been defined in the characters list
GER_erwin_rommel = {
add_attack = 2
}
}
}
[add_defense](/wiki/effect/add_defense): Attack and defense skills are typically adjusted in pairs to create a general with balanced or specialized combat profiles.[add_skill_level](/wiki/effect/add_skill_level): Overall skill level increases are often used in conjunction with individual attribute enhancements to prevent character stat distribution from becoming too imbalanced.[add_trait](/wiki/effect/add_trait): Combining trait additions with attribute bonuses creates a more multidimensional representation of a specific tactical style (e.g., granting both an "Aggressive" trait and attack bonus simultaneously).[attack_skill_level](/wiki/trigger/attack_skill_level): Use triggers to check current attack level before granting bonuses, preventing attribute overflow or exceeding design caps as a conditional safeguard.add_attack must be executed within CHARACTER scope. Writing it directly in a COUNTRY scope's completion_reward or immediate block will cause script errors or silent failures. You must first explicitly switch to the target character's scope using a character token (e.g., GER_erwin_rommel = { ... }).