Hands-On Usage
mine_threat is commonly used in naval-related decisions or events to assess the degree of enemy mine threat a country is currently facing, thereby triggering mine-sweeping mobilization, port blockade countermeasures, and similar logic. For example, when the threat exceeds a threshold, it can automatically grant relevant ideas or trigger warning events:
# In the available block of a decision, emergency mine-sweeping orders can only be activated when mine threat is severe
available = {
mine_threat > 0.5
has_war = yes
}
Synergy
[convoy_threat](/wiki/trigger/convoy_threat): Mine threat and convoy threat typically rise in tandem; evaluating both together allows for more precise description of the degree of sea control deterioration.
[fuel_ratio](/wiki/trigger/fuel_ratio): Low fuel ratio often indicates disrupted maritime supply lines; combined with high mine threat, it portrays a severe maritime situation.
[add_ideas](/wiki/effect/add_ideas): When mine_threat exceeds a certain threshold, use this effect to grant mine-sweeping mobilization or shipping crisis ideas, forming a complete "threat → response" logic chain.
[add_mines](/wiki/effect/add_mines): From the enemy's perspective, after evaluating mine_threat, you can decide whether to continue laying mines to create sustained pressure.
Common Pitfalls
- Forgetting it only works in COUNTRY scope: Placing it in a limit block within state or unit_leader scope will cause the script to silently fail or error out; always ensure the outer scope is a country.
- Mistaking the return value as directly assignable to a variable:
mine_threat is a numerical comparison trigger that must be used with comparison operators (>, <, =). Writing mine_threat = 1 means "equals 1" rather than "set to 1"; beginners often confuse it with effects or omit the comparison operator, causing syntax errors.