Wiki

effect · add_mastery

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Adds doctrine mastery.

	You can use flexible filters to have this effect apply to all tracks that match the specified
	folder, grand doctrine, subdoctrine or specific track. If a certain filter is not present, it will be counted as a pass.
	For example, you can add mastery to all active tracks in all folders by not specifying any filters at all.

	### Examples
	```
	GER = {
		add_mastery = {
			amount = 100						# Amount of mastery to add

			# FILTERS:
			folder = land						# Optional - will filter by tracks in the specified folder
			grand_doctrine = mobile_warfare		# Optional - will filter by tracks in folders with the specified grand doctrine
			sub_doctrine = mobile_infantry		# Optional - will filter by tracks with the specified subdoctrine
			track = infantry					# Optional - will filter by tracks of the specified type
			index = 1							# Optional - will filter by the track index within the folder (0-indexed).
		}
	}
	```

实战 · 配合 · 坑

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

实战用法

add_mastery 常用于国策、事件或决议触发后奖励玩家在特定学说方向的精通进度,例如完成某条军事改革国策后批量提升陆地文件夹中的精通值,或在特定战争胜利条件触发后加速解锁特定大学说的子轨道。下面是一个完成国策后奖励机动战争相关精通的典型写法:

# 国策完成后奖励精通
focus = {
    id = GER_mobile_warfare_reform
    # ...
    completion_reward = {
        add_mastery = {
            amount = 150
            folder = land
            grand_doctrine = mobile_warfare
        }
    }
}

配合关系

  • [has_completed_track](/wiki/trigger/has_completed_track):在给予精通奖励前,先检查玩家是否已完成特定轨道,避免奖励落空或逻辑矛盾。
  • [has_any_grand_doctrine](/wiki/trigger/has_any_grand_doctrine):判断国家当前是否持有某大学说,只在符合学说路线时才触发 add_mastery,防止给错学说方向加点。
  • [add_daily_mastery](/wiki/effect/add_daily_mastery):两者搭配可区分"一次性大额奖励"与"持续小额增长"的应用场景,实现更细腻的学说成长节奏设计。
  • [add_doctrine_cost_reduction](/wiki/effect/add_doctrine_cost_reduction):常与 add_mastery 同时出现在国策奖励中,一个降低后续解锁成本,一个直接推进进度,双管齐下加速学说树推进。

常见坑

  1. 忘记 amount 字段add_mastery 没有默认值,漏写 amount 会导致脚本报错或效果静默失效,务必显式填写数值。
  2. 过度依赖无过滤器写法:不加任何过滤器时效果会作用于所有活跃轨道,初学者容易误以为只影响当前主学说,实际上可能把精通意外分散到不相关的学说方向,建议在奖励设计时至少指定 foldergrand_doctrine 进行限定。

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

add_mastery is commonly used to reward players with mastery progress in specific doctrine directions when national focuses, events, or decisions are triggered. For example, upon completing a military reform focus, you can batch increase mastery values in the land folder, or accelerate the unlocking of specific grand doctrine sub-tracks after achieving certain war victory conditions. Below is a typical implementation that rewards mobile warfare-related mastery upon focus completion:

# Reward mastery upon focus completion
focus = {
    id = GER_mobile_warfare_reform
    # ...
    completion_reward = {
        add_mastery = {
            amount = 150
            folder = land
            grand_doctrine = mobile_warfare
        }
    }
}

Synergy

  • [has_completed_track](/wiki/trigger/has_completed_track): Check whether the player has already completed a specific track before granting mastery rewards, preventing wasted rewards or logical contradictions.
  • [has_any_grand_doctrine](/wiki/trigger/has_any_grand_doctrine): Determine whether the country currently possesses a grand doctrine, only triggering add_mastery when the doctrine path is valid, preventing mastery points from being added to the wrong doctrine direction.
  • [add_daily_mastery](/wiki/effect/add_daily_mastery): Used together with add_mastery, these can differentiate between "one-time bulk rewards" and "continuous incremental growth" scenarios, enabling more granular doctrine progression design.
  • [add_doctrine_cost_reduction](/wiki/effect/add_doctrine_cost_reduction): Frequently appears alongside add_mastery in focus rewards. One reduces subsequent unlock costs while the other directly advances progress, working in tandem to accelerate doctrine tree progression.

Common Pitfalls

  1. Forgetting the amount field: add_mastery has no default value. Omitting amount causes script errors or silent effect failure. Always explicitly specify a numeric value.
  2. Over-relying on unfiltered implementation: Without any filters, the effect applies to all active tracks. Beginners often mistakenly assume it only affects the current primary doctrine, when in reality mastery can be unexpectedly scattered across unrelated doctrine directions. It is recommended to specify at least folder or grand_doctrine as a limiting parameter when designing rewards.