Wiki

effect · random_military_industrial_organization

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on a random Military Industrial Organisation of the country in scope, that fulfills the \"limit\" trigger.
tooltip=key can be added to override tooltip title.
ex: GER = {
  random_military_industrial_organization = {
	tooltip = my_loc_key # Optional
	include_invisible = yes # Optional - default = no
    ... MIO scope effects ...
  }
}

实战 · 配合 · 坑

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

实战用法

random_military_industrial_organization 常用于在事件或决议中随机为某国的一个军工组织添加资金、解锁特性或设置标记,适合"随机奖励"类 mod 场景,避免每次都作用于同一个 MIO。例如在一个科研事件中,随机挑选一个满足条件的 MIO 给予规模提升:

GER = {
    random_military_industrial_organization = {
        limit = {
            has_mio_trait = { trait = basic_infantry_focus }
        }
        add_mio_size = 1
        add_mio_funds = 50
    }
}

也可配合 include_invisible = yes 将隐藏的 MIO 也纳入随机池,适合对尚未解锁的组织预先操作的剧情脚本。

配合关系

  • has_mio_trait:在 limit 块中筛选具备特定研发特性的 MIO,精确缩小随机候选池。
  • add_mio_funds:随机选中 MIO 后直接注资,是最常见的奖励操作之一。
  • set_mio_flag:对随机选中的 MIO 打上标记,供后续事件或触发器通过 has_mio_flag 识别该次选中的组织。
  • complete_mio_trait:随机为一个 MIO 完成某条研发特性,常用于脚本化的"技术突破"事件。

常见坑

  1. 忘记 limit 导致选中不符预期的 MIO:不加 limit 时会从该国所有 MIO 中无差别随机,若只想对特定类型(如坦克制造商)操作,务必在 limit 内加上 has_mio_equipment_typehas_mio_trait 等条件加以过滤,否则效果可能施加在完全不相关的组织上。
  2. 在非 COUNTRY scope 下调用:此 effect 仅在国家 scope 下有效,若写在 STATE、MIO 等其他 scope 的执行块中会导致脚本报错或静默失效,需确保外层 scope 是具体国家标签或通过 OVERLORD / ROOT 等正确切换到国家 scope 后再调用。

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

random_military_industrial_organization is commonly used in events or decisions to randomly select one of a country's Military Industrial Organizations and apply funding, unlock traits, or set flags. It is well-suited for "random reward" mod scenarios where you want to avoid always targeting the same MIO. For example, in a research event, randomly pick one MIO that meets a condition and grant it a size increase:

GER = {
    random_military_industrial_organization = {
        limit = {
            has_mio_trait = { trait = basic_infantry_focus }
        }
        add_mio_size = 1
        add_mio_funds = 50
    }
}

You can also use include_invisible = yes to include hidden MIOs in the random pool, which is useful for narrative scripts that need to pre-operate on organizations not yet unlocked.

Synergy

  • has_mio_trait: Used inside a limit block to filter MIOs that have a specific research trait, narrowing the random candidate pool precisely.
  • add_mio_funds: Directly injects funding into the randomly selected MIO — one of the most common reward operations.
  • set_mio_flag: Sets a flag on the randomly selected MIO so that subsequent events or triggers can identify which organization was chosen via has_mio_flag.
  • complete_mio_trait: Randomly completes a research trait for one MIO; commonly used in scripted "technological breakthrough" events.

Common Pitfalls

  1. Forgetting limit and selecting an unintended MIO: Without a limit, the effect picks randomly from all MIOs belonging to that country with no filtering. If you only want to target a specific type (e.g., tank manufacturers), make sure to include conditions such as has_mio_equipment_type or has_mio_trait inside limit; otherwise the effect may be applied to a completely unrelated organization.
  2. Calling this effect outside a COUNTRY scope: This effect is only valid within a country scope. If it is placed inside an execution block belonging to a STATE, MIO, or any other scope, the script will either throw an error or silently fail. Make sure the enclosing scope is a concrete country tag, or switch to a country scope first via OVERLORD, ROOT, or a similar scope accessor before calling it.