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
has_design_based_onCOUNTRYnonecheck 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 组合,区分"自研设计"与"外购授权"两种来源的装备路线。has_design_based_on 的参数必须是装备原型(如 medium_tank、destroyer),而非某个具体的装备变体或科技 key。新手常把已研究的具体科技名填进去,导致条件永远不成立。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.
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
}
[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.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.