Wiki

trigger · is_unit_template_reserves

Definition

  • Supported scope:(none)
  • Supported target:any

Description

returns true if this unit's template has the reserves priority

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

If you want to distinguish between "reserves priority templates" and regular combat division templates in your mod, you can use this trigger to decide whether to apply special rules to certain units. For example, you might restrict reserves divisions from participating in specific tasks or event options. Common scenarios include: checking within the trigger block of a country event whether the division currently being iterated belongs to a reserves priority template, thereby providing different narrative descriptions or conditional branches.

# Example: checking in an on_action or unit_leader scope event
division_trigger = {
    is_unit_template_reserves = yes
    # Condition is true when the division template is marked as reserves priority
}

Synergy

Since there are no cross-referencing effect or trigger commands listed under the same scope in the current whitelist, there are no whitelist entries to fill. It is recommended to use this with outer limit blocks or any_of logical operators in your actual scripts, but these fall outside the scope of this whitelist. Please consult the official wiki to confirm their scope compatibility.

Common Pitfalls

  1. Scope Mixing: This trigger must be called under the correct division/unit scope; if you write it directly in a country scope (TAG = { is_unit_template_reserves = yes }) without first iterating into a specific unit scope, the script will fail silently or throw an error. When debugging, check error.log.

  2. Mistakenly Using = no to Detect Non-Reserves: Although is_unit_template_reserves = no is typically syntactically valid, some developers overlook that "reserves priority" is a template-level attribute rather than a division-level attribute. After modifying the template, you must reassign divisions for the change to take effect, which can result in runtime behavior differing from expectations.