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