Wiki

trigger · has_mastery

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if any track of the given type has at least X mastery.

	### Examples
	```
	TAG = {
		has_mastery = {
			amount = 200
			track = infantry
		}
	}
	```

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

has_mastery 常用于设计国家专注树或决策的解锁条件,例如要求玩家在特定兵种方向积累足够经验后才能触发强化性奖励,从而鼓励玩家专注发展某一作战路线。在自定义战役 mod 中,也可用它来分阶段释放剧情事件,使叙事推进与军事成长挂钩。

# 当步兵精通达标时才允许触发某个决策
available = {
    has_mastery = {
        amount = 150
        track = infantry
    }
}

配合关系

  • [has_completed_track](/wiki/trigger/has_completed_track):常与 has_mastery 并列使用,前者检查某条路线是否已全部完成,后者检查累计精通量,两者共同构成"质量 + 数量"的双重门槛。
  • [add_mastery](/wiki/effect/add_mastery):作为奖励效果与该 trigger 配合——先用 has_mastery 判断精通值是否达到阶段目标,再用 add_mastery 叠加额外奖励,形成"检查 → 奖励"闭环。
  • [add_mastery_bonus](/wiki/effect/add_mastery_bonus):用于在精通量满足条件后进一步提升后续获取速率,与 has_mastery 配合实现滚雪球式成长设计。
  • [has_completed_subdoctrine](/wiki/trigger/has_completed_subdoctrine):精通值往往与子学说解锁挂钩,两者结合可精确限定"解锁了某子学说且精通量达标"的复合条件。

常见坑

  1. track 字段值拼写错误track 必须填写游戏内实际存在的精通轨道标识符(如 infantryarmor 等),若拼错或使用中文名,trigger 会静默失败(始终返回假),且不会给出报错提示,调试时极易忽视。
  2. 误以为检查的是单条轨道的精确值:官方描述明确是"any track of the given 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

has_mastery is commonly used to design unlock conditions for national focus trees or decisions, for example requiring players to accumulate sufficient experience in a specific unit type before triggering enhancement rewards, thereby encouraging players to focus on developing a particular combat line. In custom campaign mods, it can also be used to release story events in stages, linking narrative progression to military development.

# Only allow a decision to trigger when infantry mastery reaches the threshold
available = {
    has_mastery = {
        amount = 150
        track = infantry
    }
}

Synergy

  • [has_completed_track](/wiki/trigger/has_completed_track): Commonly used in conjunction with has_mastery, the former checks whether a track has been fully completed, the latter checks cumulative mastery amount, and together they form a dual threshold of "quality + quantity".
  • [add_mastery](/wiki/effect/add_mastery): Functions as a reward effect paired with this trigger—first use has_mastery to check if mastery value reaches the phase goal, then use add_mastery to stack additional bonuses, forming a "check → reward" loop.
  • [add_mastery_bonus](/wiki/effect/add_mastery_bonus): Used to further increase the acquisition rate thereafter once mastery amount meets the condition, working with has_mastery to implement snowball-style growth design.
  • [has_completed_subdoctrine](/wiki/trigger/has_completed_subdoctrine): Mastery values are often tied to subdoctrine unlocks; combining the two allows precise specification of the composite condition "unlocked a certain subdoctrine and mastery amount is reached".

Common Pitfalls

  1. Typos in the track field value: The track field must contain the actual mastery track identifier that exists in the game (such as infantry, armor, etc.). If misspelled or if a Chinese name is used, the trigger will silently fail (always return false) without an error message, making it easy to overlook during debugging.
  2. Mistakenly thinking it checks the exact value of a single track: The official description clearly states "any track of the given type", meaning as long as any one track of that type reaches the specified amount, it returns true—not summing all tracks or requiring all to reach the threshold. When designing multi-track gates, additional conditions must be added to constrain the scope.