Hands-On Usage
any_allied_country is commonly used to check whether at least one of the current country's allies meets a given condition — for example, whether any ally has already researched a specific technology, is at war, or has reached a particular political alignment — in order to fire chained events or unlock decisions. A typical use case in alliance-diplomacy mods is blocking certain democratic cooperation options when a fascist regime exists among the player's allies.
# Check whether any ally is currently at war and is a major country
available = {
any_allied_country = {
has_war = yes
is_major = yes
}
}
Synergy
- is_ally_with: Directly checks the alliance relationship with a specific country. Pair it with
any_allied_country to first narrow down the ally pool and then apply precise filtering.
- has_government: Used inside
any_allied_country to filter allies by ideology, commonly seen when evaluating the political landscape of a coalition.
- is_in_faction: When combined with
any_allied_country, helps distinguish between "faction members" and "bilateral allies" — two distinct ally types — preventing logical confusion.
- has_war_with: Used inside an ally loop to check whether a given ally is at war with a specific country, useful for determining whether a chain of war-entry events should fire.
Common Pitfalls
- Assuming it includes the current country:
any_allied_country explicitly excludes the country in the current scope. If you also need to evaluate conditions on the country itself, add the relevant trigger separately in the outer scope — you cannot rely on this trigger to cover the current country.
- Confusing allies with faction members: This trigger checks bilateral alliance relationships (in the sense of
is_ally_with), not faction membership. Countries within the same faction are not necessarily mutual allies. If you want to iterate over faction members, use all_allied_country in combination with is_in_faction, or handle faction logic separately.