Hands-On Usage
set_division_template_cap is commonly used in focus trees, decisions, or events to impose division template caps on specific elite unit types (such as guard divisions or armored divisions), simulating real-world constraints from scarce resources or limited elite manpower. For example, after completing a focus tree, you might restrict the formation of a limited number of special forces units, reinforcing the game's sense of strategic trade-offs.
# After completing the focus, allow a maximum of 3 elite panzer divisions
focus = {
id = GER_elite_panzer_doctrine
# ...
completion_reward = {
set_division_template_cap = {
division_template = "Elite Panzer Division"
division_cap = 3
}
}
}
Synergy
[clear_division_template_cap](/wiki/effect/clear_division_template_cap) — Use this to remove old caps before resetting template limits (for example, when event branches lead to different paths). Clear first, then set anew.
[division_template](/wiki/effect/division_template) — Typically define or modify the template structure first within the same script block, then apply quantity restrictions to it, ensuring the template exists and the name matches exactly.
[country_lock_all_division_template](/wiki/effect/country_lock_all_division_template) — Combined use enables a strict control logic of "lock all templates + unlock only specific templates with limited quotas."
[has_completed_focus](/wiki/trigger/has_completed_focus) — Use as a trigger condition to confirm the player/AI has completed the corresponding focus tree before applying the cap, preventing premature allocation.
Common Pitfalls
- Template names must match exactly (case-sensitive and space-sensitive): The string in the
division_template field must match the actual in-game template name precisely; even a single extra space will cause a silent failure where the cap does not take effect and no error is reported, making it extremely difficult to debug.
- Omitting
division_cap does not mean unlimited: When division_cap is not specified, the default value is 1, not unlimited. If you intend to remove the limit, use clear_division_template_cap instead of relying on the default value.