Hands-On Usage
enemies_strength_ratio is commonly used in AI decision-making or events to assess the overall military strength comparison between your nation and all current enemies, thereby triggering peace negotiations, retreat, or counter-offensive logic. For example, in an event like "seeking armistice when war goes poorly," you can use it to filter out nations in a disadvantageous position:
# Trigger a peace event when your military strength is less than half of enemies'
country_event = {
id = my_mod.42
trigger = {
enemies_strength_ratio < 0.5
has_defensive_war = yes
}
}
Synergy
[fighting_army_strength_ratio](/wiki/trigger/fighting_army_strength_ratio): Both are strength comparison triggers. enemies_strength_ratio measures the aggregate estimated strength of all enemies, while fighting_army_strength_ratio focuses on actual combat forces in theater. They are often compared to distinguish between "paper strength" and "frontline pressure."
[has_defensive_war](/wiki/trigger/has_defensive_war): Typically used together to ensure strength comparison is only evaluated in defensive war scenarios, preventing unintended retreat logic from triggering during offensive operations.
[any_enemy_country](/wiki/trigger/any_enemy_country): When you need to further identify which specific enemy is dragging down the strength ratio, use this trigger to iterate through all enemies for granular analysis, forming a macro+micro two-layer check with enemies_strength_ratio.
[add_war_support](/wiki/effect/add_war_support): When your side has superior strength (ratio > 1.0), reward war support, or reduce it when at a disadvantage. Pair it with the strength ratio for dynamic morale management.
Common Pitfalls
- Mistakenly assuming the ratio is based on actual troop counts rather than estimates: This trigger uses the game's internal "estimated" strength values, not precise division counts or equipment levels. Fog of war and unexplored units all affect the result. Don't use it for precise numerical calculations—it's only suitable for threshold judgments.
- Forgetting that scope must be a nation currently at war: If the target nation has no active wars, the comparison pool becomes empty, and the trigger may return unexpected results (usually true or fail the condition). Always add protective checks using
[has_defensive_war](/wiki/trigger/has_defensive_war) or [any_enemy_country](/wiki/trigger/any_enemy_country) beforehand to ensure the scoped nation is actually in a state of war.