命令百科

trigger · has_mio_trait

Definition

  • Supported scope:INDUSTRIAL_ORG
  • Supported target:none

Description

Checks if the Military Industrial Organisation in scope has a trait matching the input token.
ex:
mio:my_mio = {
	has_mio_trait = my_trait_token
	has_mio_trait = {
		trait = my_trait_token
	}
}

实战 · 配合 · 坑

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

实战用法

has_mio_trait 常用于判断军事工业组织是否已解锁特定特性,从而决定后续 effect 是否触发或某项任务是否可用。例如在 MIO 特性解锁链中,可以用它做"前置特性已完成才允许解锁下一个"的条件门控。

# 当 MIO 已拥有某初级特性时,才允许解锁进阶特性
mio:my_advanced_mio = {
    limit = {
        has_mio_trait = basic_manufacturing_trait
    }
    complete_mio_trait = advanced_manufacturing_trait
}

配合关系

  • [is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed):两者常联用来区分"特性存在于 MIO 特性树上"与"特性已被完成/激活",避免逻辑混淆。
  • [is_mio_trait_available](/wiki/trigger/is_mio_trait_available):在同一 available 块中与 has_mio_trait 搭配,既检查特性是否存在,又确认其当前可被解锁,构成完整的前置链。
  • [complete_mio_trait](/wiki/effect/complete_mio_trait):典型的"条件→执行"搭配,先用 has_mio_trait 确认前置特性,再用此 effect 直接授予目标特性。
  • [unlock_mio_trait_tooltip](/wiki/effect/unlock_mio_trait_tooltip):在 tooltip 展示时配合使用,向玩家说明解锁该特性所需的前置条件是否已满足。

常见坑

  1. Scope 写错has_mio_trait 必须在 INDUSTRIAL_ORG scope 内使用,直接写在国家或其他 scope 的 trigger 块中会静默失败或报错,需要先通过 mio:my_mio = { ... } 进入正确 scope。
  2. is_mio_trait_completed 混用has_mio_trait 仅检查该特性 token 是否属于此 MIO 的特性定义(即特性存在于其特性树中),并等同于该特性已被激活完成;若需判断"已激活"应改用 is_mio_trait_completed,两者语义不同,混用会导致条件判断与预期不符。