命令百科

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 指向国家。