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