Hands-On Usage
any_neighbor_country is commonly used to check whether a country is surrounded by hostile major powers, whether any of its neighbors are at war, or to restrict a decision so it is only available when nearby countries meet certain political criteria. For example, in a "democratic expansion" decision, the trigger fires only when at least one neighbor is a democratic government at peace:
available = {
any_neighbor_country = {
has_government = democratic
has_war = no
}
}
You can also pair it with the tooltip parameter to give players clearer UI feedback:
trigger = {
any_neighbor_country = {
tooltip = NEIGHBOR_IS_AT_WAR_TT
has_war = yes
is_major = yes
}
}
Synergy
- is_neighbor_of: Complements
any_neighbor_country — the former checks, within a given country's scope, whether that country is adjacent to a specific nation, while the latter iterates over all neighbors. Used together, they allow precise control over bidirectional border relationships.
- has_government: Checks a neighbor's ideology inside an
any_neighbor_country block; the core pairing for constructing "ideological encirclement" trigger conditions.
- has_war_with: Checks inside a neighbor block whether that neighbor is currently at war with a specific country, useful for determining whether surrounding conflicts should influence the player's own decisions.
- is_in_faction: Confirms inside a neighbor block whether the neighbor has already joined a faction; commonly used as a prerequisite for alliance expansion or diplomatic events.
Common Pitfalls
- Wrong scope:
any_neighbor_country can only be used within a COUNTRY scope. Calling it directly inside a STATE or PROVINCE scope will cause the script to fail silently or throw an error. You must first transition back to a country scope via OWNER, CONTROLLER, or similar before using it.
- Misunderstanding what "neighbor" means: This trigger considers only countries connected by land or a short strait — not every country with which a diplomatic relationship exists. If the target country is separated from the current country by an ocean, it will not be counted as a neighbor. Do not use this trigger as a substitute for checks targeting distant nations.