Hands-On Usage
num_of_available_military_factories is commonly used to check the current number of idle (unassigned to production queues) military factories owned by a country. It's ideal for restricting player activation of production plans in decision available blocks—only allowing them when sufficient spare capacity exists—or triggering different branches in AI strategy events based on industrial surplus.
# Example: Decision can only be activated if the country has at least 5 available military factories
available = {
num_of_available_military_factories > 4
}
Synergy
[building_count_trigger](/wiki/trigger/building_count_trigger): Often used in tandem with this trigger to first confirm total military factory count before checking idle capacity, preventing logic errors from all factories being fully queued.
[add_equipment_production](/wiki/effect/add_equipment_production): After this trigger's conditions pass, use this effect to issue new production orders, ensuring spare capacity actually exists to handle them.
[has_country_flag](/wiki/trigger/has_country_flag): Pair with country flags to prevent repeated activation—execute follow-up logic only when available factories meet the threshold AND the flag isn't set, avoiding event/decision spam.
[focus_progress](/wiki/trigger/focus_progress): When checking national focus progress, simultaneously verify available military factories to simulate narrative scenarios like "the focus requires industrial spare capacity to advance."
Common Pitfalls
- "Available" is not "total": This trigger counts only military factories currently not occupied by production queues. If a player fills every factory with queued items, the value may be 0 even with dozens of factories—don't use it as a substitute for logic that counts total military factory capacity.
- Scope must be COUNTRY: This trigger only works in COUNTRY scope. Placing it incorrectly in state scope (e.g.,
limit nested inside every_owned_state without switching back to country scope) will cause script errors or silent failure.