Hands-On Usage
every_neighbor_country is commonly used in diplomatic or war-trigger scenarios — for example, having a country apply diplomatic pressure to all its neighbors, spread ideology, or bulk-invite nations into a faction. Pairing it with limit allows precise filtering of neighbors that meet specific conditions, such as only targeting countries that are not yet at war or not a member of any faction.
GER = {
every_neighbor_country = {
limit = {
is_in_faction = no
has_war = no
}
add_threat = 5
add_opinion = {
target = GER
value = -20
}
}
}
Synergy
- is_neighbor_of: Use this in an outer trigger block to first check whether two countries share a border, forming a condition-then-execute chain with
every_neighbor_country.
- has_war: Place inside
limit to filter neighbors by war status, preventing effects from being applied to countries already at war.
- is_in_faction: Use inside
limit to exclude neighbors already in a faction — a common pattern when trying to court or intimidate neutral neighbors.
- create_wargoal: Bulk-generate war goals against the filtered set of neighbors; a standard pattern in aggressive scripted events.
Common Pitfalls
- Forgetting
limit causes the effect to apply too broadly: every_neighbor_country targets all neighboring countries by default. Without a limit filter, you risk accidentally affecting friendly nations or allies. Always use a limit block to explicitly constrain which countries should be targeted.
- Assuming the scope can be STATE: This effect is only valid within a COUNTRY scope. Using it directly inside a state event or as a child block of
every_owned_state will cause a scope mismatch, resulting in the script silently failing or throwing an error. You must first switch back to a country scope — for example, by wrapping it as owner = { every_neighbor_country = { ... } }.