Wiki

trigger · mine_threat

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

A trigger to check how dangerous enemy mines are for a country. Controlled by NAVAL_MINE_DANGER defines. Returns a value between 0 and 1. Example mine_threat > 0.5

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

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

  1. 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.
  2. 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.