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
- 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 = { ... }.
- 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.