Hands-On Usage
any_state_division is commonly used to check whether any division within a given state meets specific conditions — for example, determining whether an enemy garrison contains armored divisions, or whether a friendly state still holds battered remnants with low strength. This makes it useful for triggering events or decisions. Typical scenarios include checking garrison quality before a border war, or gating event options based on the division templates present in a state.
# Check whether any division in the state has organization below a threshold;
# if so, the event option is unavailable
available = {
ROOT = {
any_state_division = {
unit_organization < 0.3
}
}
}
In the example above, ROOT is a country scope. By targeting OWNER or CONTROLLER instead, you can further narrow the check to the divisions belonging to the state's occupier or controller respectively.
Synergy
- unit_organization: The most frequent companion to
any_state_division — used to filter divisions with insufficient organization and assess whether a state's defenses are dangerously weak.
- unit_strength: Pair this with
any_state_division to check a division's current strength ratio and identify whether damaged remnants are still present in the state.
- division_has_majority_template: Used inside
any_state_division to evaluate division template types, distinguishing infantry divisions from armored divisions and so on.
- custom_trigger_tooltip: When the check logic is complex, wrap
any_state_division inside this trigger to provide players with a readable localized tooltip, preventing the UI from displaying a raw stack of raw conditions.
Common Pitfalls
- Scope confusion:
any_state_division can only be called within a STATE scope. If the current scope is a country or province, you must first transition into a STATE scope via any_state/all_state or an event target — otherwise the script will either throw an error or silently fail.
- Incorrect target leading to wrong check coverage: By default the trigger checks divisions belonging to
THIS (i.e., the current state). If you want to check the divisions of the controller specifically, you must explicitly write controller = { any_state_division = { ... } }. Omitting the scope transition means you end up checking the occupier rather than the controller, producing results that differ from what you intended.