Wiki

trigger · has_doctrine

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if the given grand doctrine or subdoctrine is currently active for the country.

	### Examples
	```
	TAG = {
		has_doctrine = mobile_warfare # Grand doctrine
	}
	TAG = {
		has_doctrine = mobile_infantry # Subdoctrine
	}
	```

实战 · 配合 · 坑

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

实战用法

has_doctrine 常用于根据国家当前选择的作战教义来激活不同的奖励、事件或决策——例如为选择"机动战"教义的玩家解锁专属顾问,或为不同教义路线提供差异化的科技加成。结合 focus tree 或 event 脚本,可以实现教义感知的动态奖励体系。

# 在一个焦点的 available 块中,仅当国家已选机动战大教义时可用
focus = {
    id = ger_mechanized_push
    ...
    available = {
        has_doctrine = mobile_warfare
    }
}

# 在 event option 中,根据子教义区分奖励
option = {
    name = myevent.1.a
    trigger = {
        has_doctrine = mobile_infantry  # 机动战-步兵子教义
    }
    add_manpower = 5000
}

配合关系

  • [has_completed_focus](/wiki/trigger/has_completed_focus):先检查某个焦点是否完成,再配合 has_doctrine 双重限定,确保玩家既走了对应国策又选了对应教义才触发内容。
  • [has_any_grand_doctrine](/wiki/trigger/has_any_grand_doctrine):作为 has_doctrine 的宽松版前置检查,先确认国家已解锁任意大教义,再用 has_doctrine 细化判断具体路线。
  • [has_completed_subdoctrine](/wiki/trigger/has_completed_subdoctrine):两者常并列使用,has_doctrine 判断当前激活状态,has_completed_subdoctrine 判断是否已研究完毕,组合可区分"正在使用"与"已研究但未激活"的情形。
  • [add_doctrine_cost_reduction](/wiki/effect/add_doctrine_cost_reduction):在满足 has_doctrine 条件后给予教义研究折扣,形成"选了某条路线则该路线后续更便宜"的正反馈设计。

常见坑

  1. 激活态 vs 研究态混淆has_doctrine 检查的是当前激活的教义(玩家已选定的大教义/子教义),而不是"是否已研究过"。如果玩家研究了某子教义但随后切换到另一条线,该 trigger 会返回假,新手常在此出现逻辑错误,应与 has_completed_subdoctrine 区分使用。
  2. Scope 写错位置:该 trigger 只在 COUNTRY scope 下有效,若误写在 STATECHARACTER 等 scope 内会导致脚本报错或静默失效,务必确认外层 scope 是国家标签或 ROOT/FROM 指向国家。

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_doctrine is commonly used to activate different rewards, events, or decisions based on the nation's currently selected combat doctrine—for example, unlocking exclusive advisors for players who choose the "Mobile Warfare" doctrine, or providing differentiated tech bonuses for different doctrine paths. Combined with focus tree or event scripts, it enables the implementation of doctrine-aware dynamic reward systems.

# In a focus's available block, only available when the nation has selected Mobile Warfare grand doctrine
focus = {
    id = ger_mechanized_push
    ...
    available = {
        has_doctrine = mobile_warfare
    }
}

# In an event option, differentiate rewards by subdoctrine
option = {
    name = myevent.1.a
    trigger = {
        has_doctrine = mobile_infantry  # Mobile Warfare - Infantry subdoctrine
    }
    add_manpower = 5000
}

Synergy

  • [has_completed_focus](/wiki/trigger/has_completed_focus): First check whether a certain focus is completed, then combine with has_doctrine for dual restriction, ensuring the player has both completed the corresponding focus and selected the matching doctrine before triggering content.
  • [has_any_grand_doctrine](/wiki/trigger/has_any_grand_doctrine): Serves as a lenient preliminary check before has_doctrine, first confirming the nation has unlocked any grand doctrine, then use has_doctrine to refine judgment on specific paths.
  • [has_completed_subdoctrine](/wiki/trigger/has_completed_subdoctrine): The two are often used in parallel; has_doctrine checks the currently active state, while has_completed_subdoctrine checks whether research is completed. The combination can distinguish between "currently in use" and "researched but not active" situations.
  • [add_doctrine_cost_reduction](/wiki/effect/add_doctrine_cost_reduction): After the has_doctrine condition is satisfied, grant doctrine research discounts, forming a positive feedback design of "selecting a certain path makes subsequent research on that path cheaper."

Common Pitfalls

  1. Confusion between active state and research state: has_doctrine checks the currently active doctrine (the grand/subdoctrine the player has selected), not "whether it has been researched." If a player researches a certain subdoctrine but later switches to another line, this trigger will return false. Beginners often make logic errors here; it should be distinguished from has_completed_subdoctrine.
  2. Scope written in the wrong location: This trigger is only valid within COUNTRY scope. If mistakenly written within STATE or CHARACTER scopes, it will cause script errors or silent failures. Always confirm that the outer scope is a country tag or ROOT/FROM pointing to a country.