Hands-On Usage
any_other_country_of is commonly used in alliance/faction events to check whether any country in a specified list — excluding the current scope country — meets certain conditions, such as determining whether any of the Nordic nations is currently engaged in a defensive war. It is also well-suited for country group checks in script constant management, avoiding the need to write large blocks of repetitive OR conditions.
# This event option is only available when any other country in the Nordic group (excluding self) is at war
country_event = {
id = nordic.1
option = {
name = nordic.1.a
trigger = {
any_other_country_of = {
target = { SWE NOR FIN DEN }
has_war = yes
}
}
add_war_support = 0.05
}
}
Synergy
- has_war — The most typical pairing: checks whether any other country in the target list has entered a state of war, triggering aid or diplomatic events.
- has_defensive_war — Combined with
any_other_country_of, this precisely determines whether any country in the list is currently under attack, as opposed to being the aggressor.
- is_in_faction — Used to check whether any other country in the target list has already joined a faction, helping to design faction expansion logic.
- has_government — Pairing these allows you to check whether any other country in the list has undergone a change of government, making it suitable for ideology-spread mods.
Common Pitfalls
- Misunderstanding the "excludes self" behavior: This trigger automatically excludes the current scope country, so adding yourself to the
target list has no effect — the scope country is never counted in the evaluation. There is no need to manually write NOT = { tag = ROOT } to filter yourself out, but assuming you will be included in the check will lead to logic errors.
target only accepts a list of country tags or script constants — scope keywords cannot be used as list entries: For example, writing target = { ALLIES } is invalid because ALLIES is not a legitimate country tag. If you need a dynamic set of countries, use a pre-defined constant: script constant; otherwise the condition will fail silently.