Wiki

trigger · division_has_majority_template

Definition

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

Description

checks if division template has majority of subunit type.

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

division_has_majority_template is commonly used to perform specialized checks on divisions with specific unit composition types. For example, in events or decisions, it can detect whether a division is primarily composed of armor or infantry units, allowing you to grant corresponding bonuses or trigger different narrative branches. In equipment/training mods, it is also frequently used to restrict certain special commands to only apply to divisions that are "primarily of a certain unit type."

# Example: Trigger an event check when a division is primarily composed of armor sub-units
division_has_majority_template = {
    type = armor  # Check if this division template has armor-type sub-units as the majority
}

Synergy

Since the current whitelist contains no other effect or trigger commands within the same scope, no cross-reference entries can be listed. For combined usage, please use general condition blocks (such as limit) to compose at higher scope levels.

Common Pitfalls

  1. Incorrect scope usage: This trigger's supported scope list is empty, meaning it can only be correctly invoked in specific contexts (such as loops iterating over divisions). Writing it directly under country or character scope often results in script errors or silent failures. You must ensure the outer context is already within the correct division scope.
  2. type field entry errors: The sub-unit type name must strictly match the actual key defined in /common/units/ (case-sensitive). Entering display names or localization text will cause the condition to never trigger, and the game typically will not provide an obvious error message.