Hands-On Usage
add_mines is commonly used in naval warfare mods to simulate a nation deploying mine barriers in specific strategic sea regions. For example, after an event triggers, you can have the player or AI nation increase mine density in critical straits, forcing opponents to slow their naval advance. It's also suitable for scenario-based mods, where you automatically place initial mine defenses for the defending side when war breaks out, creating a realistic naval defense posture.
country_event = {
id = my_mod.42
# ...
option = {
name = my_mod.42.a
# Deploy 100 mines in strategic region 42
add_mines = {
region = 42
amount = 100
}
}
}
Synergy
[has_country_flag](/wiki/trigger/has_country_flag): Check first whether the nation has already triggered a mine-laying event to prevent mine counts from stacking repeatedly; commonly placed in trigger conditions as an idempotency guard.
[clr_country_flag](/wiki/effect/clr_country_flag) / [set_country_flag](/wiki/effect/set_country_flag) (use [clr_country_flag](/wiki/effect/clr_country_flag) here): Clear or set a flag after laying mines, working with the flag mechanism to ensure a mine-laying event executes only once or tracks state.
[create_wargoal](/wiki/effect/create_wargoal): Use together with mine deployment in the same event option as declaring war, so that mine-laying and war status take effect simultaneously, aligning with the narrative logic of war's opening.
[convoy_threat](/wiki/trigger/convoy_threat): After laying mines, continuously monitor changes to convoy threat values in that sea region with this trigger to verify the actual suppression effect of mines on enemy supply lines; commonly used in AI decision-making.
Common Pitfalls
region expects a strategic region ID, not a state ID: Beginners often directly fill in the number of a regular state into the region field, causing the effect to fail or target the wrong area. You must verify the correct strategic sea region ID in the /map/strategicregions/ directory, and that region must be a naval strategic region; using it on land regions has no practical effect.
scope must be COUNTRY, not STATE: add_mines executes under country scope. If mistakenly placed inside state-level scopes like every_owned_state or any_controlled_state, the script will error or silently fail. Ensure the outer scope points to a concrete country tag or uses legitimate targets like OWNER/ROOT to trace back to country scope.