Wiki

effect · set_division_template_cap

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Set division cap for a division template
Example: set_division_template_cap = { division_template = <name> division_cap = <int (default:1)> }

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

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

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