Wiki

trigger · has_tech_bonus

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

checks if the country has a bonus for the specified technology or category
Example:
has_tech_bonus = {
	technology =  <tech>
	category = <tech cat>
	}

实战 · 配合 · 坑

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

实战用法

has_tech_bonus 常用于 focus tree 或 decision 的 available / trigger 块中,判断某国是否已通过某条科技奖励路径获得了特定技术或类别的加成,从而决定是否解锁后续选项或显示提示。例如在自定义国策树中,要求玩家先通过某条国策获得装甲科技加成才能推进下一步:

available = {
    has_tech_bonus = {
        category = armor
    }
}

配合关系

  • [add_tech_bonus](/wiki/effect/add_tech_bonus):两者是一对经典组合——先用 has_tech_bonus 检查某类别的加成是否已存在,再用 add_tech_bonus 给予新的加成,避免重复叠加或形成逻辑冲突。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):常见于"完成某国策后才拥有科技加成"的验证链,与 has_tech_bonus 并列写在同一 trigger 块中,确保条件严格。
  • [can_research](/wiki/trigger/can_research):在判断某技术加成是否有实际意义时,配合 can_research 检查该技术当前是否可研究,避免加成生效在已研究或未解锁的技术上造成无效判断。
  • [has_doctrine](/wiki/trigger/has_doctrine):当科技加成与学说相关联时,常用 has_doctrinehas_tech_bonus 共同限制某条路径,确保国家走在正确的军事学说分支上。

常见坑

  1. technologycategory 混用理解错误:新手常误以为两个字段必须同时填写,实际上填其中一个即可达成判断目的;若同时填写,需注意它们是"且"的关系,指定的 technology 必须同时属于指定 category,否则条件永远为假。
  2. 把它当作"已研究该技术"的替代判断has_tech_bonus 检查的是"是否拥有该科技的研究加成",而非"是否已研究完成该科技",两者含义截然不同——后者应使用 has_tech 来判断,混用会导致逻辑完全错误。

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_tech_bonus is commonly used within available / trigger blocks of focus trees or decisions to check whether a country has obtained a specific technology or category bonus through a particular tech bonus path, thereby determining whether to unlock subsequent options or display hints. For example, in a custom focus tree where players must first acquire an armor tech bonus through a certain focus before progressing further:

available = {
    has_tech_bonus = {
        category = armor
    }
}

Synergy

  • [add_tech_bonus](/wiki/effect/add_tech_bonus): These two form a classic pairing—first use has_tech_bonus to check whether a category bonus already exists, then use add_tech_bonus to grant a new bonus, avoiding duplicate stacking or logical conflicts.
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Commonly found in verification chains of "possessing a tech bonus only after completing a certain focus," written alongside has_tech_bonus in the same trigger block to ensure strict conditions.
  • [can_research](/wiki/trigger/can_research): When assessing whether a tech bonus has practical value, pair it with can_research to verify whether the technology is currently researchable, preventing the bonus from being applied to already-researched or unlocked technologies, which would result in invalid checks.
  • [has_doctrine](/wiki/trigger/has_doctrine): When tech bonuses are linked to doctrines, commonly use has_doctrine alongside has_tech_bonus to restrict a certain path, ensuring the nation follows the correct military doctrine branch.

Common Pitfalls

  1. Misunderstanding the mixing of technology and category fields: Beginners often mistakenly assume both fields must be filled simultaneously, but in reality, filling one is sufficient to achieve the intended check. If both are filled, note that they have an "AND" relationship—the specified technology must also belong to the specified category, otherwise the condition will always be false.
  2. Treating it as a substitute for "technology already researched": has_tech_bonus checks for "whether the country possesses a research bonus for that technology," not "whether that technology has already been fully researched." These are entirely different meanings—the latter should use has_tech for checking, and mixing them up will result in completely incorrect logic.