Hands-On Usage
num_battalions_in_states is commonly used to determine whether the player or AI has assembled sufficient forces in specific states, thereby triggering decisions, missions, or events—for example, as a prerequisite for "launching a special operation only after concentrating infantry battalions on a certain border state," or for performing dynamic checks on logistics and defense line density.
# Example: Requires the player to deploy more than 10 infantry or cavalry battalions in specified states to activate a decision
available = {
custom_trigger_tooltip = {
tooltip = tt_need_battalions_on_border
num_battalions_in_states = {
count > 10
states = { 9 10 11 }
types = { infantry cavalry }
}
}
}
Synergy
[divisions_in_state](/wiki/trigger/divisions_in_state): Both are used to check troop deployment, with the former operating at battalion level and the latter at division level; typically used together to simultaneously limit the number of divisions and the composition of battalions.
[controls_state](/wiki/trigger/controls_state): Confirms actual control of the target state before counting battalions, avoiding counting states that are occupied and cannot be reinforced.
[has_army_size](/wiki/trigger/has_army_size): Assesses overall national military size at the macro level, forming a "global + local" dual condition with num_battalions_in_states' local force check, making trigger logic more rigorous.
[activate_targeted_decision](/wiki/effect/activate_targeted_decision): Once battalion conditions are met, use this effect to activate the corresponding targeted decision, which is the most common follow-up action.
Common Pitfalls
- Forgetting to add
custom_tooltip: The default tooltip omits certain information (such as contents filtered by exclude), causing the tooltip players see to diverge from the actual judgment logic; it is strongly recommended to always wrap it with custom_trigger_tooltip.
- Confusion when
types and exclude are specified simultaneously: types is a whitelist (count only these), while exclude is a blacklist (exclude these); if the same battalion type is specified in both, conflicts arise. If you only want to exclude certain battalion types, use exclude alone rather than mixing it with types.