Hands-On Usage
num_owned_neighbour_states is commonly used to determine whether a state is heavily surrounded by a particular country, making it ideal for detecting strategic encirclement in occupation mechanics, decisions, or events. For example, in an "isolated enclave" decision, you can check whether all neighboring states adjacent to a target state are controlled by the same enemy nation, thereby triggering special diplomatic options or surrender mechanics.
# Decision available example: only available when a state is surrounded by the target nation
available = {
ROOT = { # ROOT refers to the current state
num_owned_neighbour_states = {
count > 3
owner = FROM # FROM refers to the country that triggered the decision
}
}
}
Synergy
[any_neighbor_state](/wiki/trigger/any_neighbor_state): Use any_neighbor_state to iterate through and check each neighboring state's properties first, then use this trigger to count the total, and combining both achieves "number of neighbor states meeting specific conditions" logic.
[is_owned_by](/wiki/trigger/is_owned_by): Pair is_owned_by within any_neighbor_state or all_neighbor_state alongside this trigger to cross-verify and confirm specific ownership relationships.
[every_neighbor_state](/wiki/effect/every_neighbor_state): Once this trigger evaluates to true, use every_neighbor_state to apply effects in bulk to all neighboring states meeting the conditions, forming a complete "detect→execute" workflow.
[is_core_of](/wiki/trigger/is_core_of): Use in parallel with this trigger to simultaneously limit neighbor states to being cores of a specific nation while judging encirclement count, suited for more precise territorial claim scenarios.
Common Pitfalls
- Incorrect scope placement: This trigger must be placed within a
STATE scope to take effect; placing it directly in a country scope will silently fail or throw an error. Beginners often forget to switch scope first using capital_scope or an explicit state scope.
- Misusing the target field: The target values filled in the
owner field (such as ROOT, FROM) are resolved relative to the context in which this trigger is invoked. If nesting levels are deep, ROOT/FROM may not point to the intended nation, requiring careful tracking of the scope chain.