Wiki

trigger · has_design_based_on

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check if country has a buildable non-obsolete design based on an archetype

实战 · 配合 · 坑

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

实战用法

当你的 mod 希望检查某国是否具备可建造的、基于特定原型(archetype)的非过时舰船/装甲等设计方案时,此 trigger 非常实用。常见场景包括:在国策或决议的 available 块中要求玩家已经为某种武器平台设计了可用方案,才能解锁后续生产奖励或科技加成。

# 示例:仅当国家拥有基于重型坦克原型的可用设计时,才允许激活某决议
available = {
    has_design_based_on = heavy_tank
}

配合关系

  • [has_built](/wiki/trigger/has_built):配合使用,可进一步确认该国不仅有设计方案,还已实际建造并装备了相关装备,避免只有图纸却未生产时也触发奖励。
  • [add_tech_bonus](/wiki/effect/add_tech_bonus):当条件满足后作为 effect 奖励触发,给予与该装备类型相关的研究加成,形成"有设计→加速研究"的逻辑链。
  • [create_equipment_variant](/wiki/effect/create_equipment_variant):在确认原型存在之前用本 trigger 做保护性检查,防止尝试基于不存在的原型创建变体而报错。
  • [any_purchase_contract](/wiki/trigger/any_purchase_contract):若 mod 涉及生产授权或外购逻辑,可与本 trigger 组合,区分"自研设计"与"外购授权"两种来源的装备路线。

常见坑

  1. 误将 archetype 与具体装备 key 混淆has_design_based_on 的参数必须是装备原型(如 medium_tankdestroyer),而非某个具体的装备变体或科技 key。新手常把已研究的具体科技名填进去,导致条件永远不成立。
  2. 忽略"非过时"限制:该 trigger 只对可建造且未被标记为过时的设计返回真,如果玩家的所有相关设计都已因科技推进而变为 obsolete,条件同样不满足——这在后期游戏中容易造成困惑,需在文档或 tooltip 中向玩家说明。

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

When your mod needs to check whether a nation possesses buildable, non-obsolete ship/armor designs based on a specific archetype, this trigger is extremely useful. Common scenarios include: in the available block of national focuses or decisions, requiring the player to have designed an available blueprint for a certain weapon platform before unlocking subsequent production bonuses or tech bonuses.

# Example: Allow activation of a decision only when the nation has an available design based on the heavy tank archetype
available = {
    has_design_based_on = heavy_tank
}

Synergy

  • [has_built](/wiki/trigger/has_built): Use in conjunction to further confirm that the nation not only has a design, but has also actually constructed and equipped the relevant hardware, avoiding triggering rewards when only blueprints exist without production.
  • [add_tech_bonus](/wiki/effect/add_tech_bonus): When conditions are met, triggers as an effect reward, granting research bonuses related to that equipment type, forming a "design exists → accelerate research" logic chain.
  • [create_equipment_variant](/wiki/effect/create_equipment_variant): Use this trigger as a protective check before attempting to create variants, preventing errors from trying to create variants based on non-existent archetypes.
  • [any_purchase_contract](/wiki/trigger/any_purchase_contract): If your mod involves production licenses or foreign procurement logic, combine with this trigger to distinguish between "self-developed designs" and "licensed procurement" sources of equipment paths.

Common Pitfalls

  1. Confusing archetype with concrete equipment keys: The parameter for has_design_based_on must be an equipment archetype (such as medium_tank, destroyer), not a specific equipment variant or tech key. Beginners often input the name of a researched specific tech, causing the condition to never evaluate true.
  2. Overlooking the "non-obsolete" restriction: This trigger only returns true for designs that are buildable and not marked as obsolete. If all of the player's related designs have become obsolete due to tech advancement, the condition remains unsatisfied—this easily causes confusion in late-game scenarios and requires explanation to players in documentation or tooltips.