Wiki

trigger · num_battalions_in_states

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Checks number of battalions in states (optionally filtering on battalion types). Using a custom tooltip is highly recommended since the default tooltip leaves out some information for the sake of readability.
Example:
num_battalions_in_states = {
	count > 5 (or <, =)
	states = { 550 559 }
	types = { infantry cavalry } [optional - will count all except excluded if not specified]
	exclude = { light_armor } [optional - will count all (included) if not specified]
}

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

num_battalions_in_states 常用于判断玩家或 AI 是否在特定省份集结了足够的兵力,从而触发决策、任务或事件——例如"在某边境州集结步兵营方可发动特别行动"的前置条件,或对后勤/防线密度进行动态检查。

# 示例:要求玩家在指定州部署超过 10 个步兵或骑兵营才能激活决策
available = {
    custom_trigger_tooltip = {
        tooltip = tt_need_battalions_on_border
        num_battalions_in_states = {
            count > 10
            states = { 9 10 11 }
            types = { infantry cavalry }
        }
    }
}

配合关系

  • [divisions_in_state](/wiki/trigger/divisions_in_state):两者都用于检查兵力部署情况,前者精度到营级、后者到师级,通常搭配使用以同时限定师的数量与营的构成。
  • [controls_state](/wiki/trigger/controls_state):确认己方实际控制目标州后再统计营数,避免统计到被占领而无法调兵的州。
  • [has_army_size](/wiki/trigger/has_army_size):在宏观上判断全国军队规模,与 num_battalions_in_states 的局部兵力检查形成"全局 + 局部"双重条件,令触发逻辑更严谨。
  • [activate_targeted_decision](/wiki/effect/activate_targeted_decision):当兵力条件满足后用此 effect 激活对应的针对性决策,是最常见的后续动作。

常见坑

  1. 忘记加 custom_tooltip:默认 tooltip 会省略部分信息(如 exclude 过滤的内容),导致玩家看到的提示与实际判断逻辑不符,强烈建议始终配合 custom_trigger_tooltip 包裹使用。
  2. typesexclude 同时指定时逻辑混淆types 是白名单(只数这些)、exclude 是黑名单(排除这些),两者若同时写入同一营种会产生冲突;如果只想排除个别营种,应单独使用 exclude 而非与 types 混用。

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

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

  1. 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.
  2. 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.