Wiki

trigger · has_mio_policy

Definition

  • Supported scope:INDUSTRIAL_ORG
  • Supported target:none

Description

Checks if the Military Industrial Organisation in scope has an allowed policy matching the input token.
ex:
mio:my_mio = {
	has_mio_policy = my_policy_token
}

实战 · 配合 · 坑

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

实战用法

has_mio_policy 常用于检查某个军事工业组织是否已解锁或允许特定政策,从而决定后续奖励、特性解锁或 UI 提示是否显示。例如,在设计某 MIO 的特性可用条件时,可以要求玩家必须先启用对应政策才能激活该特性:

# 在某个 MIO 特性的 available 块中检查政策
mio:my_arms_company = {
    is_mio_trait_available = my_advanced_trait
}

# 特性定义内部
available = {
    mio:my_arms_company = {
        has_mio_policy = my_production_policy
    }
}

配合关系

  • [has_mio_policy_active](/wiki/trigger/has_mio_policy_active)has_mio_policy 仅检查政策是否被允许(存在于允许列表),而 has_mio_policy_active 检查政策是否当前激活,两者常一起使用来区分"可用但未启用"与"已启用"的两种状态。
  • [has_mio_trait](/wiki/trigger/has_mio_trait):政策往往与特性联动,先用 has_mio_policy 确认政策允许,再用 has_mio_trait 确认对应特性已完成,构成双重前置条件检查。
  • [complete_mio_trait](/wiki/effect/complete_mio_trait):当政策检查通过后,在 effect 块中配合此命令自动授予特性,实现"满足政策条件即解锁特性"的逻辑。
  • [is_mio_trait_available](/wiki/trigger/is_mio_trait_available):与 has_mio_policy 嵌套使用,精确控制特性在特定政策下的可见与可用范围。

常见坑

  1. 作用域写错has_mio_policy 必须在 INDUSTRIAL_ORG 作用域下调用,直接写在国家作用域(country scope)的 trigger 块里会静默失败或报错,需要先通过 mio:my_mio = { ... } 进入正确作用域。
  2. 混淆 allowed 与 active:新手常误以为 has_mio_policy 等价于"政策已启用",实际上它只检查政策是否在允许列表中,政策是否真正生效需要用 has_mio_policy_active 来判断,两者语义不同,混用会导致条件判断逻辑错误。

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_policy is commonly used to check whether a military industrial organization has unlocked or permits a specific policy, thereby determining whether subsequent bonuses, trait unlocks, or UI prompts should be displayed. For example, when designing the availability conditions for an MIO trait, you can require players to enable the corresponding policy first before activating that trait:

# Check the policy in the available block of a certain MIO trait
mio:my_arms_company = {
    is_mio_trait_available = my_advanced_trait
}

# Inside the trait definition
available = {
    mio:my_arms_company = {
        has_mio_policy = my_production_policy
    }
}

Synergy

  • [has_mio_policy_active](/wiki/trigger/has_mio_policy_active): has_mio_policy only checks whether a policy is permitted (exists in the allowed list), whereas has_mio_policy_active checks whether a policy is currently active. The two are often used together to distinguish between "available but not enabled" and "already enabled" states.
  • [has_mio_trait](/wiki/trigger/has_mio_trait): Policies often work in conjunction with traits. First use has_mio_policy to confirm the policy is permitted, then use has_mio_trait to confirm the corresponding trait is completed, forming a dual prerequisite check.
  • [complete_mio_trait](/wiki/effect/complete_mio_trait): After the policy check passes, combine this command in the effect block to automatically grant traits, implementing the logic of "unlock trait upon meeting policy conditions".
  • [is_mio_trait_available](/wiki/trigger/is_mio_trait_available): Nested with has_mio_policy for precise control over trait visibility and availability under specific policies.

Common Pitfalls

  1. Incorrect scope: has_mio_policy must be called within the INDUSTRIAL_ORG scope. Writing it directly in a trigger block at country scope will fail silently or throw an error. You must first enter the correct scope through mio:my_mio = { ... }.
  2. Confusing allowed and active: Beginners often mistakenly assume has_mio_policy is equivalent to "policy is enabled". In reality, it only checks whether the policy is in the allowed list. To determine whether a policy is truly in effect, use has_mio_policy_active instead. The semantics are different, and mixing them up leads to incorrect conditional logic.