Hands-On Usage
any_enemy_country is commonly used to check whether the current country is at war with a specific type of enemy — for example, whether any enemy is a major power or follows a particular ideology — in order to trigger decisions or events. It also appears frequently in alliance/faction mods to dynamically unlock special options based on the state of current enemies.
# Check if any enemy country is a fascist major power; if so, make a decision available
available = {
any_enemy_country = {
has_government = fascism
is_major = yes
}
}
Synergy
- has_war_with — Complements
any_enemy_country: the former checks whether the country is at war with a specific nation, while the latter checks whether any enemy meets a condition. Combining the two allows for fine-grained control over trigger scope.
- has_war — Typically used as a prerequisite guard before
any_enemy_country, confirming that the country is actually at war before evaluating enemy properties, which prevents unexpected results during peacetime.
- is_major — Used inside
any_enemy_country to filter for major powers among enemies; a common unlock condition for high-level strategic decisions.
- has_government — Used inside
any_enemy_country to filter enemies by ideology; a core pairing in ideology-conflict mods.
Common Pitfalls
- Scope direction confusion:
any_enemy_country operates in the COUNTRY scope, and the inner block automatically switches to the scope of each iterated enemy country. If you need to reference conditions on the original country inside the block (e.g., checking your own technology), you must explicitly use ROOT or PREV — otherwise the check will incorrectly evaluate against the enemy country itself.
- Confusing
any_enemy_country with all_enemy_country: any_enemy_country returns true as long as at least one enemy satisfies the condition, whereas all_enemy_country requires every enemy to satisfy it. Beginners often mix the two up, resulting in conditions that are either far too strict or far too loose, causing unexpected behavior.