Hands-On Usage
any_core_state is commonly used to check whether a country has at least one core state that meets a specific condition — for example, detecting whether any core state is under hostile control or has reached a certain compliance threshold, in order to fire an event or unlock a decision. A typical use case is a reconquest decision chain, where this trigger ensures the relevant decisions only appear when at least one of the player's core states is still occupied by another country.
# Check whether any of ROOT's core states is currently not controlled by ROOT itself
any_core_state = {
NOT = { is_controlled_by = ROOT }
}
Synergy
- is_controlled_by — Nested inside
any_core_state to check whether a given core state is controlled by a specific country; this combination is the backbone of most reconquest logic.
- is_core_of — When iterating over states, used in the reverse direction to confirm whether a state is a core of a given country; complements
any_core_state for cross-checking ownership.
- compliance — Nested inside
any_core_state to check whether a core state's compliance has reached the threshold required to unlock occupation laws.
- has_state_flag — Used inside
any_core_state to exclude states that have already been flagged as processed, preventing decisions or events from firing more than once.
Common Pitfalls
- Scope mismatch:
any_core_state can only be called from a COUNTRY scope. Using it directly inside a STATE scope (for example, within the body of every_state) will cause a script error or silent failure. You must first switch back to a country scope via OWNER or ROOT before calling it.
- Assuming it checks all core states:
any_core_state returns true as soon as one core state satisfies the condition. If you need every core state to satisfy the condition, use all_core_state instead; otherwise your logic will produce false positives.