Wiki

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,两者语义不同,混用会导致条件判断与预期不符。

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_mio_trait is commonly used to check whether a military industrial organization has already unlocked a specific trait, thereby determining whether subsequent effects should trigger or whether certain tasks become available. For example, within an MIO trait unlock chain, it can be used as a conditional gate to enforce "the prerequisite trait must be completed before the next trait can be unlocked."

# Allow unlocking an advanced trait only if the MIO already possesses a basic trait
mio:my_advanced_mio = {
    limit = {
        has_mio_trait = basic_manufacturing_trait
    }
    complete_mio_trait = advanced_manufacturing_trait
}

Synergy

  • [is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed): Often used together to distinguish between "a trait exists in the MIO trait tree" and "a trait has been completed/activated," avoiding logical confusion.
  • [is_mio_trait_available](/wiki/trigger/is_mio_trait_available): Paired with has_mio_trait in the same available block to both check if a trait exists and confirm it can currently be unlocked, forming a complete prerequisite chain.
  • [complete_mio_trait](/wiki/effect/complete_mio_trait): A typical "condition → execution" pairing where has_mio_trait first confirms the prerequisite trait, then this effect directly grants the target trait.
  • [unlock_mio_trait_tooltip](/wiki/effect/unlock_mio_trait_tooltip): Used in tandem when displaying tooltips to inform the player whether the prerequisites for unlocking that trait have been satisfied.

Common Pitfalls

  1. Incorrect Scope: has_mio_trait must be used within an INDUSTRIAL_ORG scope. Using it directly in a trigger block at the country or other scope level will fail silently or produce errors. You must first enter the correct scope via mio:my_mio = { ... }.
  2. Confusion with is_mio_trait_completed: has_mio_trait only checks whether the trait token belongs to this MIO's trait definition (i.e., whether the trait exists in its trait tree), and does not mean the trait has been activated or completed. If you need to check "already activated," use is_mio_trait_completed instead. The two have different semantics, and mixing them up will cause your conditions to behave unexpectedly.