Wiki

effect · damage_units

Definition

  • Supported scope:any
  • Supported target:any

Description

damages units for given conditions. no tooltip generated
damage_units = {
  #specify a location
  province = 42
  state = 5
  region = 5
  limit = { always = yes } #you can add a trigger for country check
  damage = 0.5 #if defined will damage both org & str damage with this amount
  org_damage = 0.5
  str_damage = 0.5
  ratio = yes #will damage a ratio damage to total org/str of unit if set
  template = "template_name" #you can limit army templates to damage  army = yes #will damage armies
  navy = yes #will damage navies
}

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

damage_units is commonly used in events, decisions, or scripted triggers to simulate battlefield attrition, disasters, or special combat effects—for example, an epidemic reducing the combat effectiveness of garrisoned troops, or bombing events damaging units within a province. It generates no native tooltip, so it is typically wrapped in hidden_effect and paired with custom_effect_tooltip to manually display explanatory text to the player.

# Event effect: disease outbreak in a province weakens local garrison organization and manpower
hidden_effect = {
    damage_units = {
        province = 1234
        org_damage = 0.3
        str_damage = 0.1
    }
}
custom_effect_tooltip = disease_weakens_garrison_tt

Synergy

  • [hidden_effect](/wiki/effect/hidden_effect): Since damage_units produces no native tooltip, it should almost always be nested within hidden_effect with a separate explanation provided.
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): Used in tandem with hidden_effect to display readable damage descriptions to the player, compensating for the lack of native feedback.
  • [if](/wiki/effect/if): Evaluate conditional branches before applying damage to verify that the target province or region meets specific criteria (such as having stationed units), preventing empty operations or logical errors.
  • [any_state](/wiki/trigger/any_state): Confirm at the trigger level that a state contains units before deciding whether to execute damage, improving script robustness.

Common Pitfalls

  1. Forgetting the override relationship when damage and org_damage/str_damage coexist: If both damage and org_damage/str_damage are written simultaneously, each field takes effect independently, easily causing damage to stack beyond expectations. It is recommended to use only one approach and avoid mixing them.
  2. Mistakenly assuming a tooltip is automatically generated: Beginners often write damage_units directly in an option block only to find no feedback in the player interface. The reason is that this effect explicitly states "no tooltip generated"—you must manually pair it with custom_effect_tooltip to provide an explanation, otherwise players see no damage indication whatsoever.