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
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_template_majority_unit 常用于根据国家现有师团模板的主力兵种来触发特定事件或决议,例如判断某国是否以装甲单位为主力从而解锁坦克强化相关的国策或决策。也可用于 AI 战略限制中,确认国家已完成特定兵种建设方向后再允许执行后续指令。
# 在某个决策的 available 块中,判断国家是否拥有以装甲单位为主力的模板
available = {
has_template_majority_unit = {
unit = armor
}
}
[has_army_size](/wiki/trigger/has_army_size):先用 has_army_size 确认国家拥有足够数量的部队,再用本 trigger 判断这些部队的兵种构成,两者结合能更精准地衡量军事实力方向。[any_country_division](/wiki/trigger/any_country_division):可在同一条件块中配合使用,any_country_division 用于细查具体师团是否满足某项属性,与本 trigger 互补,一宏观一微观。[add_tech_bonus](/wiki/effect/add_tech_bonus):当本 trigger 返回真(国家确实以某兵种为主)时,在 effect 块中给予对应兵种的科研加成,形成"侦测兵种路线 → 奖励专精方向"的完整逻辑链。[ai_has_role_template](/wiki/trigger/ai_has_role_template):同样是针对师团模板的判断 trigger,可与本 trigger 并列,一个判断 AI 模板角色,一个判断模板内兵种占比,组合使用避免条件过于宽松。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.