Hands-On Usage
all_neighbor_country is commonly used in diplomatic or technology focus/decision conditions — for example, requiring that all neighboring countries meet a specific government type, faction membership, or war status before an event can fire or a decision becomes available. Typical use cases include: checking whether a country has brought all its neighbors into its faction, or unlocking an endgame option only after all neighbors have been incorporated into a puppet network.
# Allow a decision to trigger only when all of the country's neighbors are its puppets
available = {
all_neighbor_country = {
is_subject_of = ROOT
}
}
You can also combine it with the tooltip key to override the default tooltip text:
trigger = {
all_neighbor_country = {
tooltip = neighbor_must_be_in_faction_tt
is_in_faction = yes
}
}
Synergy
- any_neighbor_country: The natural counterpart to
all_neighbor_country — the former requires "at least one neighbor satisfies the condition" while the latter requires "every neighbor satisfies the condition." They frequently appear together in condition branches of varying difficulty.
- is_subject_of: Often used as the inner condition to check whether each neighbor is a subject of a specific country, paired with
all_neighbor_country to implement a "all surrounding nations subjugated" check.
- has_government: Used inside
all_neighbor_country to check the government type of every neighboring country; commonly found in ideology-expansion mods to verify that all neighbors have been "converted."
- has_war: Used inside
all_neighbor_country to check whether all neighbors are currently at war, typically to fire events related to encirclement or blockade scenarios.
Common Pitfalls
- Confusing
any_neighbor_country semantics: Beginners often mix up "all neighbors" with "any neighbor," accidentally writing all_neighbor_country when they only need at least one neighbor to satisfy the condition. This makes the condition nearly impossible to fulfill, especially for major powers with many neighbors.
- Forgetting scope restrictions:
all_neighbor_country can only be used within a COUNTRY scope. Calling it directly inside a limit block that is in a STATE or PROVINCE scope will cause the script to silently fail or throw an error. You must first switch back to a COUNTRY scope using keywords such as OWNER before invoking it.