Wiki

trigger · num_divisions_in_states

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Checks number of divisions in states (optionally filtering on majority division types). Using a custom tooltip is highly recommended since the default tooltip leaves out some information for the sake of readability.
Example:
num_divisions_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_divisions_in_states 常用于判断某国在特定省份/战略区是否集结了足够数量的特定兵种部队,例如检查玩家是否在登陆目标州完成了两栖集结,或用于 AI 决策中评估某条战线的兵力是否达到发起进攻的门槛。结合 custom_trigger_tooltip 包裹使用,可以向玩家清晰展示"在目标州拥有 X 个步兵师"这样的可读条件。

# 检查是否在指定州部署了足够的装甲与摩托化师以解锁某决策
available = {
    custom_trigger_tooltip = {
        tooltip = tt_armor_concentration_ready
        num_divisions_in_states = {
            count > 3
            states = { 8 9 10 }
            types = { armor motorized }
            exclude = { infantry }
        }
    }
}

配合关系

  • [divisions_in_state](/wiki/trigger/divisions_in_state) — 当只需检查单个州的兵力时,divisions_in_state 更简洁;两者对比使用有助于选择合适粒度的检测范围。
  • [has_army_size](/wiki/trigger/has_army_size) — 用于在宏观层面验证整体军队规模,与 num_divisions_in_states 配合可同时保证"总兵力足够"与"前线集结到位"两个条件。
  • [controls_state](/wiki/trigger/controls_state) — 通常需要先确认目标州在己方控制下,再检测驻守师数,避免出现"师在但州已失"的逻辑漏洞。
  • [activate_targeted_decision](/wiki/effect/activate_targeted_decision) — 满足兵力集结条件后,触发激活针对特定目标的决策,是进攻类事件链的常见后续 effect。

常见坑

  1. 忘记添加 custom_tooltip:默认 tooltip 会省略 types/exclude 的过滤信息,玩家看不到实际检查的兵种条件,容易造成"条件明明满足却不通过"的困惑——官方描述也明确建议强制使用自定义提示。
  2. typesexclude 的逻辑关系理解错误types 是白名单(只数这些类型),exclude 是黑名单(从所有类型中剔除),两者不能混用来表达"除了 X 都算"的意图——若想排除某类型,应只填 exclude 而不填 types,否则逻辑会变成"既要在 types 白名单里,又不在 exclude 里",结果可能与预期完全不同。

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_divisions_in_states is commonly used to verify whether a country has assembled a sufficient number of specific unit types in particular states or strategic regions. For example, checking whether the player has completed an amphibious concentration at a landing objective, or evaluating in AI decision-making whether a front line has enough forces to initiate an offensive. When wrapped with custom_trigger_tooltip, it provides players with clear, readable conditions such as "possesses X infantry divisions in the target state."

# Check if enough armor and motorized divisions are deployed in specified states to unlock a decision
available = {
    custom_trigger_tooltip = {
        tooltip = tt_armor_concentration_ready
        num_divisions_in_states = {
            count > 3
            states = { 8 9 10 }
            types = { armor motorized }
            exclude = { infantry }
        }
    }
}

Synergy

  • [divisions_in_state](/wiki/trigger/divisions_in_state) — When checking a single state's forces, divisions_in_state offers greater conciseness; comparing both helps select the appropriate granularity for your detection scope.
  • [has_army_size](/wiki/trigger/has_army_size) — Used to verify overall army size at a macro level; combining with num_divisions_in_states ensures both "sufficient total manpower" and "frontline concentration in position" conditions are met simultaneously.
  • [controls_state](/wiki/trigger/controls_state) — Typically requires first confirming the target state is under your control before checking garrisoned divisions, preventing logical errors such as "divisions present but state lost."
  • [activate_targeted_decision](/wiki/effect/activate_targeted_decision) — After meeting force concentration requirements, triggers activation of decisions targeting specific objectives; a common subsequent effect in offensive event chains.

Common Pitfalls

  1. Forgetting to add custom_tooltip: The default tooltip omits filtering information from types/exclude, leaving players unaware of the actual unit type conditions being checked. This easily causes confusion about "conditions supposedly met but still failing"—official documentation explicitly recommends mandatory use of custom tooltips.
  2. Misunderstanding the logical relationship between types and exclude: types is a whitelist (count only these types), while exclude is a blacklist (remove from all types). These cannot be mixed to express "everything except X counts"—if you want to exclude a type, use only exclude without types. Otherwise, the logic becomes "must be in the types whitelist AND not in exclude," potentially producing completely unexpected results.