Wiki

effect · complete_mio_trait

Definition

  • Supported scope:INDUSTRIAL_ORG
  • Supported target:none

Description

Complete a trait in the military industrial organization in scope.
This effect will not take into account the current state of the trait tree and will allow you to unlock a trait even if the one before is not unlocked.
Will also add 1 size to the MIO so that size and numbers of unlocked traits are always aligned.
ex:
var:my_mio_var = {
  complete_mio_trait = my_trait_token
  complete_mio_trait = {
	trait = my_trait_token
	show_modifiers = no # Optional, default = yes
  }
}

实战 · 配合 · 坑

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

实战用法

complete_mio_trait 常用于剧本事件或国策完成时,为特定军工组织强制解锁某个特性,无需玩家手动在特性树中逐级点选,适合制作"剧情奖励"或"历史节点触发解锁"的 mod 场景。例如,当某国完成特定国策后,立即赋予其主力军工组织一个高级特性:

# 在某国策完成效果中
if = {
    limit = { has_mio_flag = mio_upgraded }
    var:target_mio = {
        complete_mio_trait = {
            trait = advanced_manufacturing_trait
            show_modifiers = no
        }
    }
}

配合关系

  • [is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed) — 在执行前先检查该特性是否已解锁,避免重复触发造成逻辑混乱。
  • [has_mio_number_of_completed_traits](/wiki/trigger/has_mio_number_of_completed_traits) — 用于判断当前已完成特性数量,决定是否满足触发额外奖励的条件。
  • [add_mio_size](/wiki/effect/add_mio_size) — 虽然本指令会自动增加 1 个 size,但若需要额外奖励成长,可在同一块中再手动叠加 size。
  • [set_mio_flag](/wiki/effect/set_mio_flag) — 解锁特性后立即打上标记,防止同一事件链重复执行相同的解锁逻辑。

常见坑

  1. 忘记切换到 INDUSTRIAL_ORG scope:此 effect 只能在军工组织 scope 内使用,若直接写在国家 scope(如 country_event 的 option 块)中而不通过变量或专属 scope 进入 MIO,脚本会静默失效且不报错,特性不会被解锁。
  2. 误以为 show_modifiers = no 会阻止 size 增长show_modifiers 仅控制界面提示是否显示加成内容,不影响 size 自动 +1 的行为;若在短时间内批量解锁多个特性,size 会累加多次,需提前规划好特性数量与 size 的对应关系。

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

complete_mio_trait is commonly used in scripted events or focus completion to forcibly unlock a specific trait for a designated military industrial organization without requiring the player to manually progress through the trait tree level by level. This is ideal for mod scenarios involving "story rewards" or "historical milestone-triggered unlocks". For example, when a certain nation completes a specific focus, immediately grant its primary military industrial organization an advanced trait:

# In a focus completion effect block
if = {
    limit = { has_mio_flag = mio_upgraded }
    var:target_mio = {
        complete_mio_trait = {
            trait = advanced_manufacturing_trait
            show_modifiers = no
        }
    }
}

Synergy

  • [is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed) — Check whether the trait is already unlocked before execution to avoid repeated triggers causing logic conflicts.
  • [has_mio_number_of_completed_traits](/wiki/trigger/has_mio_number_of_completed_traits) — Judge the current number of completed traits to determine whether conditions for triggering additional rewards are met.
  • [add_mio_size](/wiki/effect/add_mio_size) — Although this command automatically increases size by 1, if additional growth rewards are needed, you can manually stack additional size within the same block.
  • [set_mio_flag](/wiki/effect/set_mio_flag) — Apply a flag immediately after unlocking the trait to prevent the same event chain from repeatedly executing the same unlock logic.

Common Pitfalls

  1. Forgetting to switch to INDUSTRIAL_ORG scope: This effect can only be used within a military industrial organization scope. If written directly in a country scope (such as an option block in country_event) without transitioning to the MIO through variables or a dedicated scope, the script will silently fail without error and the trait will not be unlocked.
  2. Mistakenly believing that show_modifiers = no prevents size growth: show_modifiers only controls whether interface tooltips display modifier values; it does not affect the automatic +1 size behavior. If multiple traits are unlocked in quick succession, size will accumulate multiple times, requiring advance planning of the correspondence between trait quantity and size.