Wiki

trigger · is_mio_assigned_to_task

Definition

  • Supported scope:INDUSTRIAL_ORG
  • Supported target:none

Description

Checks if the Military Industrial Organisation in scope is assigned to at least 1 task.
ex:
mio:my_mio = {
	is_mio_assigned_to_task = yes
	is_mio_assigned_to_task = no
}

实战 · 配合 · 坑

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

实战用法

is_mio_assigned_to_task 常用于军事工业组织的特质解锁或 UI 可用性判断,例如在某个 MIO 特质的 available 块中限定"只有当该 MIO 正在执行任务时才能激活"。也可用于事件或决议的 trigger 块,防止玩家在 MIO 空闲状态下触发某些奖励逻辑。

# 示例:某 MIO 特质仅在该组织被分配任务时才可解锁
some_mio_trait = {
    available = {
        is_mio_assigned_to_task = yes
    }
}

# 示例:事件触发条件中排除未分配任务的 MIO
trigger = {
    mio:my_mio = {
        is_mio_assigned_to_task = yes
        has_mio_size = { size > 2 }
    }
}

配合关系

  • [has_mio_size](/wiki/trigger/has_mio_size):常与本 trigger 联用,确保 MIO 不仅在执行任务,还达到足够规模,双重门控特质或奖励解锁。
  • [is_mio_available](/wiki/trigger/is_mio_available):配合使用可区分"MIO 是否可用"与"MIO 是否有任务在身",避免逻辑遗漏(可用但无任务是常见中间状态)。
  • [add_mio_task_capacity](/wiki/effect/add_mio_task_capacity):当检测到 MIO 已满载任务(yes)时,可通过此 effect 扩充任务槽位,作为奖励或事件结果触发。
  • [has_mio_trait](/wiki/trigger/has_mio_trait):常组合使用,判断"拥有某特质 正在执行任务"以激活更高阶的条件分支。

常见坑

  1. Scope 写错位置:本 trigger 必须在 INDUSTRIAL_ORG scope 下使用,直接写在国家 scope 的 trigger 块里不会报错但永远返回假——务必通过 mio:my_mio = { } 或类似方式先切换到正确 scope。
  2. yes/no 当动态数值:部分新手误以为可以通过某个字段获取"已分配任务数量",但本 trigger 只做有/无的布尔判断,无法直接区分分配了 1 个还是多个任务,需配合其他逻辑间接处理。

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

is_mio_assigned_to_task is commonly used to unlock Military Industrial Organization traits or determine UI availability. For example, you can use it within the available block of an MIO trait to restrict activation only when that MIO is actively assigned to a task. It can also be used in the trigger block of events or decisions to prevent players from triggering certain reward logic when the MIO is idle.

# Example: An MIO trait that can only be unlocked when the organization is assigned to a task
some_mio_trait = {
    available = {
        is_mio_assigned_to_task = yes
    }
}

# Example: In an event trigger condition, exclude MIOs that are not assigned tasks
trigger = {
    mio:my_mio = {
        is_mio_assigned_to_task = yes
        has_mio_size = { size > 2 }
    }
}

Synergy

  • [has_mio_size](/wiki/trigger/has_mio_size): Frequently used alongside this trigger to ensure the MIO is not only executing a task but also meets a minimum size threshold, providing dual-gate control for trait or reward unlocks.
  • [is_mio_available](/wiki/trigger/is_mio_available): Using both together helps distinguish between "whether the MIO is available" and "whether the MIO has an active task," preventing logical gaps (available but unassigned is a common intermediate state).
  • [add_mio_task_capacity](/wiki/effect/add_mio_task_capacity): When detecting that an MIO has reached full task capacity (yes), this effect can be used to expand task slots as a reward or event consequence.
  • [has_mio_trait](/wiki/trigger/has_mio_trait): Often combined together to check whether an organization "possesses a certain trait and is actively executing a task" to activate higher-order conditional branches.

Common Pitfalls

  1. Incorrect scope placement: This trigger must be used within the INDUSTRIAL_ORG scope. Placing it directly in a country-level trigger block will not error but will always return false—always ensure you switch to the correct scope first using mio:my_mio = { } or similar syntax.
  2. Treating yes/no as a dynamic value: Some newcomers mistakenly believe they can retrieve "the number of assigned tasks" through some field, but this trigger only performs a boolean check for presence or absence. It cannot directly distinguish between 1 assigned task versus multiple tasks; you must handle this indirectly through other logic.