Hands-On Usage
This trigger is commonly used in mod scenarios where "a general activates special events or rewards in a specific province," such as triggering a commemorative event when a commander's forces enter a historically significant city, or detecting frontline commanders in border provinces to restrict certain decision execution.
# Example: Allow a military decision to execute only when the general's forces are in a specified province
custom_trigger_tooltip = {
tooltip = leader_must_be_in_target_province_tt
is_leading_army_in_province = 9999 # Target province ID
}
Synergy
[is_army_leader](/wiki/trigger/is_army_leader): First confirm the character is a land force commander before checking their unit's province location, avoiding invalid checks against non-army characters.
[is_corps_commander](/wiki/trigger/is_corps_commander) / [is_field_marshal](/wiki/trigger/is_field_marshal): Use in conjunction with is_leading_army_in_province to distinguish different trigger logic for corps commanders versus field marshals in that province.
[has_trait](/wiki/trigger/has_trait): After confirming the general is stationed in the target province, further filter for generals with specific traits, enabling precise condition stacking.
[add_timed_unit_leader_trait](/wiki/effect/add_timed_unit_leader_trait): Once conditions are met, temporarily grant the general a province-related trait (such as "urban assault specialist"), forming a complete logic chain of "location → temporary bonus."
Common Pitfalls
- Confusing province ID with state ID: This trigger accepts province ID, not state ID—the two numbering systems are completely different. Using the wrong one causes the condition to never trigger silently without error, making it very difficult to debug.
- Incorrect scope targeting: Must be called within a
CHARACTER scope. If written in a condition block under country or state scope, the script will not execute as expected. Always verify the current scope has been properly switched to a character context via any_army_leader / any_corps_commander, etc.