trigger · has_template_majority_unit
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
check if country has a division template that is majority of specific unit
has_template_majority_unitCOUNTRYnonecheck if country has a division template that is majority of specific unit
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.
has_template_majority_unit is commonly used to trigger specific events or decisions based on the primary unit type in a nation's existing division templates. For example, you can check whether a country primarily deploys armor units to unlock tank-related focuses or decisions. It can also be used in AI strategy constraints to confirm that a nation has completed a specific unit composition direction before allowing subsequent commands to execute.
# In the available block of a decision, check if the country has a template with armor as the majority unit type
available = {
has_template_majority_unit = {
unit = armor
}
}
[has_army_size](/wiki/trigger/has_army_size): First use has_army_size to confirm the country possesses a sufficient number of troops, then use this trigger to evaluate the unit type composition of those troops. Combining both provides a more precise assessment of military capability direction.[any_country_division](/wiki/trigger/any_country_division): Can be used together in the same condition block. any_country_division performs detailed checks on whether specific divisions meet certain attributes, complementing this trigger with both macro and micro perspectives.[add_tech_bonus](/wiki/effect/add_tech_bonus): When this trigger returns true (the country indeed has a certain unit type as primary), grant corresponding tech bonuses for that unit type in the effect block, forming a complete logical chain of "detect unit composition → reward specialization direction".[ai_has_role_template](/wiki/trigger/ai_has_role_template): Also a template-focused judgment trigger that can be used alongside this one. One evaluates AI template roles while the other checks unit type proportions within templates, combining them prevents conditions from becoming too permissive.