Wiki

trigger · dig_in

Definition

  • Supported scope:COMBATANT
  • Supported target:none

Description

check if we have digin level (lowest)

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

dig_in is commonly used to determine whether one side in a battle has constructed entrenchments, making it suitable for use in custom battle events or special tactical modifier trigger conditions—for example, granting additional bonuses to the defending side when entrenchments are in place, or triggering specific scripted events. A typical scenario is defensive line holding mods that need to distinguish between "hasty engagement" and "prepared position defense" states.

# Check within a battle event's trigger block whether the defender has dug in
trigger = {
    is_defender = yes
    dig_in = yes
}

Synergy

  • [is_defender](/wiki/trigger/is_defender) — Entrenchment typically only has meaning for the defending side; combining the two allows precise filtering of "defending and dug in" battle states, avoiding unintended triggers.
  • [has_combat_modifier](/wiki/trigger/has_combat_modifier) — After confirming dig_in, you can further check whether specific combat modifiers have been stacked, useful for evaluating compound conditions of reinforced defense.
  • [min_planning](/wiki/trigger/min_planning) — Entrenchment is closely tied to planning percentage; combined use allows distinguishing between "planned entrenchment" and "improvised digging in" scenarios.
  • [is_fighting_in_terrain](/wiki/trigger/is_fighting_in_terrain) — Entrenchment effectiveness varies significantly across different terrains; combined terrain checks allow designing dedicated trigger logic for mountainous or fortress terrain.

Common Pitfalls

  1. Using dig_in outside COMBATANT scope: This trigger only functions within battle-internal scope (COMBATANT); if mistakenly written under country or leader scope, the script will fail silently or error out. Newcomers often overlook scope switching due to copy-pasting.
  2. Mistaking it for a way to check entrenchment level values: dig_in only returns a boolean (whether minimum entrenchment exists), not specific entrenchment tier numbers. For finer-grained checks, consult other related fields instead; do not attempt to pass numeric parameters to it.