Wiki

trigger · defense_skill_level

Definition

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

Description

Compares defense skill level of a unit leader.
Example: defense_skill_level > 5

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

defense_skill_level is commonly used to evaluate whether a commander's defense skill meets a threshold, thereby triggering exclusive events, unlocking special traits, or restricting the assignment of certain advisor roles. For example, in a custom commander growth system, automatically grant a new trait when defense skill exceeds a certain value:

# Grant enhanced defense trait when commander's defense skill exceeds 4
if = {
    limit = {
        defense_skill_level > 4
        is_corps_commander = yes
    }
    add_trait = { trait = defensive_doctrine_expert }
}

Synergy

  • [attack_skill_level](/wiki/trigger/attack_skill_level): Often used in parallel with attack skill checks to construct "balanced offense-defense" commander filtering conditions, avoiding bias toward a single dimension.
  • [has_trait](/wiki/trigger/has_trait): Combined with trait checks to ensure the commander does not already possess the target trait before triggering, preventing duplicate trait grants.
  • [skill](/wiki/trigger/skill): Used to simultaneously constrain the commander's overall skill level, forming a dual threshold with defense skill to precisely identify elite commanders.
  • [add_trait](/wiki/effect/add_trait): The most common follow-up effect, granting defense-related traits as a reward after defense skill conditions are met.

Common Pitfalls

  1. Confusing defense_skill_level with add_defense: The former is a conditional check (trigger), while the latter is an effect that modifies game state; they cannot be used interchangeably and defense_skill_level cannot be placed inside an effect block.
  2. Ignoring scope restrictions: This trigger is only valid under CHARACTER or COMBATANT scope. If called directly under a country scope without first switching scope (such as through any_army_leader), the condition will never evaluate and produce no error, making it difficult to troubleshoot.