Wiki

effect · every_country_division

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on every Division of the country in scope (or \"random_select_amount\" of random divisions if specified) that fulfills the \"limit\" trigger.
tooltip=key can be added to override tooltip title.
By default the effects are only displayed once, you may display them for each matching division with display_individual_scopes.
ex:
SOV = {
	every_country_division = {
		tooltip = my_loc_key # Optional
		random_select_amount = 3 # Optional
		display_individual_scopes = yes # Optional - default = no
		... division scope effects ...
	}
}

实战 · 配合 · 坑

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

实战用法

every_country_division 常用于 mod 中批量修改一国所有师的模板、组织度或指挥官属性,例如在某事件发生后给苏联全国部队降低组织度来模拟大清洗,或对特定条件下的师统一换装新模板。也可搭配 random_select_amount 实现"随机抽取若干师"的特效,如精锐部队演习奖励。

SOV = {
    every_country_division = {
        limit = {
            unit_organization > 50
        }
        set_unit_organization = 0.5
        reseed_division_commander = yes
    }
}

配合关系

  • unit_organization:在 limit 块中按当前组织度筛选师,确保只对满足条件的部队执行效果。
  • unit_strength:与 unit_organization 类似,用于筛选兵力损耗严重的师,再配合 damage_unitsset_unit_organization 做进一步处理。
  • change_division_templateevery_country_division 迭代所有师后,用此命令批量替换模板,是换装/重组剧本事件的核心搭档。
  • hidden_effect:将批量操作包裹在 hidden_effect 内,避免 tooltip 刷屏,提升玩家体验。

常见坑

  1. 忘记写 limit 导致误操作全部师:不加 limit 时效果会作用于该国每一支师,包括训练中或预备役师,容易造成意料之外的全军状态重置;应始终用 limit 配合 unit_organizationdivision_has_majority_template 等触发器缩小范围。
  2. 在非 COUNTRY scope 下调用every_country_division 只能在国家 scope 内使用,若在 state scope 或 division scope 中误调用会导致脚本静默失效或报错,需确认外层 scope 已正确定位到目标国家。

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

every_country_division is commonly used in mods to bulk-modify the templates, organization, or commander attributes of all divisions belonging to a country. For example, it can reduce the organization of all Soviet forces after a specific event fires to simulate the Great Purge, or uniformly swap divisions to a new template under certain conditions. It can also be combined with random_select_amount to implement a "randomly select a number of divisions" effect, such as an elite forces exercise reward.

SOV = {
    every_country_division = {
        limit = {
            unit_organization > 50
        }
        set_unit_organization = 0.5
        reseed_division_commander = yes
    }
}

Synergy

  • unit_organization: Filter divisions by their current organization inside a limit block, ensuring effects are only applied to units that meet the condition.
  • unit_strength: Similar to unit_organization, used to select divisions that have suffered heavy attrition, then paired with damage_units or set_unit_organization for further processing.
  • change_division_template: After every_country_division iterates over all divisions, use this effect to bulk-replace templates — the core companion for re-equipping or reorganization scripted events.
  • hidden_effect: Wrap bulk operations inside hidden_effect to prevent tooltip spam and improve the player experience.

Common Pitfalls

  1. Forgetting limit and accidentally affecting every division: Without a limit, the effect applies to every single division in the country, including those in training or in reserve, which can easily cause an unintended full-army state reset. Always narrow the scope using limit in combination with triggers such as unit_organization or division_has_majority_template.
  2. Calling it outside a COUNTRY scope: every_country_division can only be used inside a country scope. Calling it mistakenly from a state scope or division scope will cause the script to silently fail or throw an error. Always verify that the enclosing scope is correctly targeting the intended country.