Hands-On Usage
This trigger is commonly used in AI behavior adjustment mods. It fires when you need to determine whether a nation has formed division templates with a specific unit type (such as armor or artillery) as the backbone force, then trigger subsequent strategies. Unlike simple visual inspection, it uses the AI's internal priority weights to calculate the "backbone unit type," making it more suitable for scenarios sensitive to AI logic such as AI decision paths and advisor activation conditions.
# Example: If a nation's AI determines it already possesses division templates with armor as the backbone, activate the corresponding advisor
advisor_activation_trigger = {
has_template_ai_majority_unit = {
unit_type = armor
}
}
Synergy
[ai_has_role_template](/wiki/trigger/ai_has_role_template): Both are AI-level judgments targeting division templates and are often combined to double-confirm whether the AI's division composition aligns with the expected strategy branch.
[ai_has_role_division](/wiki/trigger/ai_has_role_division): After confirming the template exists, further check whether the AI has actually deployed divisions of that role, forming a complete verification chain of "template → deployment."
[add_ai_strategy](/wiki/effect/add_ai_strategy): When the trigger condition is satisfied, use this effect to append or reinforce the AI's strategic inclination, allowing the AI to expand the backbone unit type that has been identified.
[add_tech_bonus](/wiki/effect/add_tech_bonus): After confirming the AI has adopted a certain unit type as its backbone, grant corresponding tech bonuses to guide the AI to deepen development along that unit type line.
Common Pitfalls
- Mistakenly assuming consistency with visual presentation: This trigger uses the AI's internal priority weights rather than the unit type ratios visible to the naked eye in the editor, and may produce results inconsistent with intuition on human player division templates. It should not be used in player-facing UI or event conditions.
- Mixing scopes: This trigger is only valid under COUNTRY scope. Beginners often misuse it in limit blocks under STATE or CHARACTER scopes, causing script errors or perpetually returning false, making it difficult to debug.