Wiki

trigger · has_mastery_level

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if the country has reached the specified number of mastery levels (rewards) for the given subdoctrine

	### Examples
	```
	TAG = {
		has_mastery_level = {
			amount = 2
			sub_doctrine = mobile_infantry
		}
	}
	```

实战 · 配合 · 坑

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

实战用法

has_mastery_level 常用于自定义学说 mod 中,根据玩家在某个子学说上累积的精通奖励数量来解锁额外决议或顾问。例如在一个强调陆军精通进度的 mod 里,可以用它作为决议的 available 条件,确保玩家达到足够精通层级才能激活:

available = {
    has_mastery_level = {
        amount = 3
        sub_doctrine = mobile_infantry
    }
}

配合关系

  • [has_completed_subdoctrine](/wiki/trigger/has_completed_subdoctrine):先检查子学说是否研究完毕,再用 has_mastery_level 判断奖励层级,两者构成"完成研究且达到精通"的完整条件链。
  • [add_mastery](/wiki/effect/add_mastery):在 effect 块中通过该 effect 增加精通值,与 has_mastery_level 组成"达到阈值 → 给予额外奖励"的正反馈循环。
  • [add_mastery_bonus](/wiki/effect/add_mastery_bonus):用于在满足精通层级条件后叠加额外的学说增益,常放在同一 if 结构下作为奖励发放。
  • [has_any_grand_doctrine](/wiki/trigger/has_any_grand_doctrine):先过滤国家是否持有对应大学说,再嵌套 has_mastery_level,避免对未选择该学说路线的国家产生无效判断。

常见坑

  1. sub_doctrine 填写错误:必须填写游戏内实际定义的子学说 token(即 sub_doctrines 下的 key 名),直接写学说显示名称或父级学说名会导致条件永远为假且不报错,调试时极难发现。
  2. amount 的含义是"至少达到 N 层"而非"恰好等于 N 层:如需精确匹配某个层级(例如恰好第 2 层触发特殊事件),需配合另一个取反的 has_mastery_level 检查上限,否则高层级玩家会重复触发。

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_level is commonly used in custom doctrine mods to unlock additional decisions or advisors based on the cumulative mastery rewards a player has accumulated in a specific sub-doctrine. For example, in a mod emphasizing army doctrine mastery progression, you can use it as an available condition for a decision to ensure the player reaches sufficient mastery tier before activation:

available = {
    has_mastery_level = {
        amount = 3
        sub_doctrine = mobile_infantry
    }
}

Synergy

  • [has_completed_subdoctrine](/wiki/trigger/has_completed_subdoctrine): First check whether the sub-doctrine is researched, then use has_mastery_level to determine reward tier, forming a complete conditional chain of "research completed and mastery reached".
  • [add_mastery](/wiki/effect/add_mastery): In effect blocks, increase mastery value through this effect, combining with has_mastery_level to create a positive feedback loop of "reach threshold → grant additional rewards".
  • [add_mastery_bonus](/wiki/effect/add_mastery_bonus): Used to stack additional doctrine bonuses after mastery tier conditions are met, commonly placed in the same if structure as reward distribution.
  • [has_any_grand_doctrine](/wiki/trigger/has_any_grand_doctrine): First filter whether a nation holds the corresponding grand doctrine, then nest has_mastery_level within it, avoiding invalid evaluation against nations that haven't chosen that doctrine path.

Common Pitfalls

  1. Incorrect sub_doctrine specification: Must use the actual sub-doctrine token defined in-game (the key name under sub_doctrines). Writing the doctrine display name or parent doctrine name directly will cause the condition to always evaluate false without error, making debugging extremely difficult.
  2. amount means "at least tier N", not "exactly tier N": If you need to precisely match a specific tier (for example, trigger a special event only at exactly tier 2), you must pair it with an inverted has_mastery_level check to set an upper limit, otherwise higher-tier players will trigger it repeatedly.