Hands-On Usage
has_mio_flag is commonly used to track specific states of military industrial organizations, such as determining whether a particular MIO has completed a special task, triggered a scripted event, or achieved a custom milestone. Typical use cases appear in the trait unlock conditions or available blocks of an MIO, where you check for markers previously set via script to implement phased unlock logic.
# In an MIO trait's available block, check if the "first phase research complete" marker has been set
some_mio_trait = {
available = {
has_mio_flag = first_phase_complete
}
}
# You can also combine this with values or days for more granular checks
available = {
has_mio_flag = {
flag = production_boosted
days < 180
}
}
Synergy
[set_mio_flag](/wiki/effect/set_mio_flag): The flags checked by has_mio_flag are written by set_mio_flag; together they form a complete "write-read" logical loop that requires both to function.
[clr_mio_flag](/wiki/effect/clr_mio_flag): When you need to reset state after a condition is met, use clr_mio_flag to clear the flag, then have has_mio_flag re-evaluate it in the next phase. This is ideal for implementing cycles or multi-stage workflows.
[modify_mio_flag](/wiki/effect/modify_mio_flag): modify_mio_flag can modify the numeric value of a flag; combined with the value comparison field in has_mio_flag, this enables counter-like cumulative logic.
[is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed): Typically written alongside has_mio_flag in the same trigger block to simultaneously check both the MIO's trait completion status and custom flags, forming a composite unlock condition.
Common Pitfalls
- Scope placed incorrectly:
has_mio_flag can only be used within an INDUSTRIAL_ORG scope. Beginners often write it directly in a country or character scope's trigger block, resulting in silent failure or errors. Always confirm you've switched to the correct scope using any_mio / every_mio or similar constructs before use.
- Flag name spelling inconsistency: The flag names referenced by
set_mio_flag and has_mio_flag must match exactly (case-sensitive). When copying and pasting across different files, beginners often introduce case or underscore differences, causing conditions to always return false while remaining difficult to debug.