Wiki

trigger · has_subdoctrine_in_track

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if any subdoctrine is currently assigned to (any instance of) the given track

	### Examples
	```
	TAG = {
		has_subdoctrine_in_track = infantry
	}
	```

实战 · 配合 · 坑

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

实战用法

在自定义学说系统的 mod 中,常用于检测某条学说轨道是否已被分配了子学说,从而决定是否解锁额外的决策、国策或修正。例如,当玩家已在步兵轨道上选择了任意子学说时,才允许触发相关的军事改革事件:

available = {
    has_subdoctrine_in_track = infantry
}

配合关系

  • [has_completed_subdoctrine](/wiki/trigger/has_completed_subdoctrine):常与本 trigger 联用,先用 has_subdoctrine_in_track 确认该轨道已有分配,再用 has_completed_subdoctrine 进一步验证特定子学说是否研究完毕,形成两层条件过滤。
  • [has_completed_track](/wiki/trigger/has_completed_track):用于区分"已分配子学说"和"已完整完成整条轨道"的不同进度阶段,两者组合可实现阶段性奖励逻辑。
  • [has_doctrine](/wiki/trigger/has_doctrine):检查更上层的主学说是否已解锁,与本 trigger 搭配可确保学说体系的前置条件完整。
  • [add_doctrine_cost_reduction](/wiki/effect/add_doctrine_cost_reduction):在 trigger 满足后作为 effect 端奖励,给予学说费用折扣,是学说相关事件链的典型奖励输出。

常见坑

  1. 轨道名称拼写错误infantryarmor 等轨道名必须与 mod 中学说定义文件里的 track 标识符完全一致(大小写敏感),写成本地化显示名(如中文名或英文全称)会导致条件永远无法为真且不会报错,极难排查。
  2. 误用于子学说 key 而非轨道 key:本 trigger 的值填的是**轨道(track)**的标识符,而不是某个具体子学说的 key;若想判断某个特定子学说是否被分配,应改用 has_completed_subdoctrine,混用两者是新手最常见的逻辑错误。

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

Commonly used in custom doctrine system mods to check whether a doctrine track has been assigned any subdoctrine, thereby determining whether to unlock additional decisions, focuses, or modifiers. For example, allow a military reform event to trigger only after the player has selected any subdoctrine in the infantry track:

available = {
    has_subdoctrine_in_track = infantry
}

Synergy

  • [has_completed_subdoctrine](/wiki/trigger/has_completed_subdoctrine): Often used in conjunction with this trigger—first use has_subdoctrine_in_track to confirm the track has an assignment, then use has_completed_subdoctrine to further verify whether a specific subdoctrine has been researched, forming a two-layer condition filter.
  • [has_completed_track](/wiki/trigger/has_completed_track): Used to distinguish between different progress stages of "subdoctrine assigned" and "entire track fully completed"; combining both enables phased reward logic.
  • [has_doctrine](/wiki/trigger/has_doctrine): Checks whether the parent doctrine has been unlocked; pairing with this trigger ensures the doctrine system's prerequisites are complete.
  • [add_doctrine_cost_reduction](/wiki/effect/add_doctrine_cost_reduction): Serves as a reward on the effect side after the trigger is satisfied, granting doctrine cost reduction—a typical reward output in doctrine-related event chains.

Common Pitfalls

  1. Track name spelling errors: Track identifiers like infantry, armor must exactly match the track identifiers in the mod's doctrine definition files (case-sensitive); writing localized display names (such as Chinese names or full English names) will cause the condition to never evaluate to true without error reporting, making it extremely difficult to debug.
  2. Confusing subdoctrine key with track key: The value for this trigger is the identifier of a track, not a specific subdoctrine's key; if you want to check whether a specific subdoctrine is assigned, use has_completed_subdoctrine instead. Mixing the two is the most common logical mistake among newcomers.