Wiki

trigger · has_tactic

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Check if the given tactic is unlocked (or active by default) for the country.

	### Examples
	```
	TAG = {
		has_tactic = tactic_masterful_blitz
	}
	```

实战 · 配合 · 坑

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

实战用法

has_tactic 常用于 mod 中根据国家是否解锁特定战术来决定是否可用某决议、显示特殊事件选项或激活 advisor。例如,当玩家设计一条"精锐装甲"科技线时,可以用它确保只有真正解锁了闪电战战术的国家才能触发相关奖励事件。

# 仅当国家已解锁 tactic_masterful_blitz 时才允许激活该决议
available = {
    has_tactic = tactic_masterful_blitz
}

配合关系

  • [has_doctrine](/wiki/trigger/has_doctrine):战术通常随学说研究解锁,两者联用可精确区分"已研究学说但战术尚未默认激活"与"战术完全可用"的边界情况。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):部分战术通过国策而非科技解锁,与本 trigger 配合可构建"国策完成 → 战术可用 → 决议开放"的完整逻辑链。
  • [can_research](/wiki/trigger/can_research):用于判断是否还有战术相关科技待研究,与 has_tactic 互补,一个检测"已有",另一个检测"能研究",避免重复提示。
  • [add_tech_bonus](/wiki/effect/add_tech_bonus):在确认国家已持有某战术后,通过该 effect 给予后续科技加速,形成"解锁战术 → 享受研究红利"的激励设计。

常见坑

  1. 将战术 key 与科技 key 混淆has_tactic 的参数是战术本身的标识符(如 tactic_masterful_blitz),而不是解锁该战术的科技 token,直接填写科技名会导致 trigger 永远返回 false 且不报错,难以排查。
  2. 忽略"默认激活"的战术:官方描述明确指出默认激活的战术也会返回 true,因此若你的逻辑想区分"主动研究解锁"与"初始自带",仅靠本 trigger 无法做到,需结合 [has_doctrine](/wiki/trigger/has_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

has_tactic is commonly used in mods to determine whether a country has unlocked a specific tactic, and then conditionally enable a decision, display special event options, or activate an advisor. For example, when designing an "Elite Armor" technology tree, you can use it to ensure that only nations that have truly unlocked the Blitzkrieg tactic can trigger the associated reward events.

# Only allow this decision to be available if the country has unlocked tactic_masterful_blitz
available = {
    has_tactic = tactic_masterful_blitz
}

Synergy

  • [has_doctrine](/wiki/trigger/has_doctrine): Tactics are typically unlocked through doctrine research. Using both together allows precise distinction between the boundary case of "doctrine researched but tactic not yet activated by default" and "tactic fully available".
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Some tactics are unlocked through focuses rather than technologies. Combined with this trigger, you can construct a complete logic chain of "focus completed → tactic available → decision unlocked".
  • [can_research](/wiki/trigger/can_research): Used to determine whether there are still tactic-related technologies pending research. It complements has_tactic—one checks "already has", the other checks "can research"—avoiding duplicate prompts.
  • [add_tech_bonus](/wiki/effect/add_tech_bonus): After confirming that a country possesses a certain tactic, use this effect to grant subsequent technology acceleration, creating an incentive design of "unlock tactic → enjoy research bonuses".

Common Pitfalls

  1. Confusing tactic keys with technology keys: The parameter for has_tactic is the identifier of the tactic itself (such as tactic_masterful_blitz), not the technology token that unlocks it. Directly entering a technology name will cause the trigger to always return false without error, making it difficult to debug.
  2. Overlooking "default-activated" tactics: The official description explicitly states that default-activated tactics also return true. Therefore, if your logic wants to distinguish between "actively researched unlock" and "initial default", this trigger alone cannot achieve it—you need secondary filtering using [has_doctrine](/wiki/trigger/has_doctrine) or focus completion status.