Hands-On Usage
has_mines is commonly used in mod scenarios involving naval blockades, port defense, or strategic resource competition. For example, it can be used in a decision or mission to detect whether a specified sea region has sufficient mine deployments, thereby determining whether to unlock subsequent options or grant rewards. A typical scenario is in a naval strategy mod where players must lay mines in a specific strait to reach a threshold before triggering a blockade event chain.
# In the available block of a decision, check if the Baltic region has sufficient mine deployments
available = {
has_mines = {
region = 12 # Corresponds to the target sea region region_id
amount = 50
}
}
Synergy
[add_mines](/wiki/effect/add_mines): The most direct companion—first use add_mines to lay mines in a sea region, then use has_mines to check if the trigger threshold is reached, forming a complete "lay mines → verify → reward" logic loop.
[controls_state](/wiki/trigger/controls_state): Often checked simultaneously to ensure the player controls key coastal states near the sea region, guaranteeing that only nations with true naval supremacy can trigger the related condition.
[has_navy_size](/wiki/trigger/has_navy_size) (note: synergy concept only; refer to whitelist for accuracy)—can be replaced with [any_controlled_state](/wiki/trigger/any_controlled_state): Combine with territorial control triggers to stack mine deployment checks with territory control conditions, preventing enemies from accidentally triggering faction-exclusive decisions.
[building_count_trigger](/wiki/trigger/building_count_trigger): When requiring simultaneously built ports or naval bases, work together with has_mines to form a "infrastructure + mine deployment" dual prerequisite, enhancing the military realism of the mod.
Common Pitfalls
- Filling
region with state_id instead of region_id: has_mines requires the numeric ID of a strategic region (sea area), not a land state ID; the two ID ranges overlap, and filling in the wrong value won't trigger a script error but the condition will never evaluate correctly. You must cross-reference the corresponding .txt file ID in the map/strategicregions/ folder.
- Using on land strategic regions: The mine mechanism only applies to ocean/coastal strategic regions. If
region points to a purely land-based area, amount will always be 0, making the condition permanently false, preventing any decision or mission relying on this trigger from satisfying available. Beginners often mistakenly believe this is a script syntax error and repeatedly debug the wrong area.