Wiki

effect · add_attack

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

Adds attack skill to a character
Example: add_attack = 1

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_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
        }
    }
}

Synergy

  • [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.

Common Pitfalls

  1. Incorrect Scope: 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 = { ... }).
  2. Using on Non-Military Characters: Applying this effect to advisors, scientists, or other non-military commander types will not produce meaningful game effects even if the script doesn't error, since attack attributes only apply to land/naval commanders. Newcomers often overlook the distinction between character types.