trigger · has_active_rule
Definition
- Supported scope:
COUNTRY - Supported target:
any
Description
Checks if the country's faction has a specific active rule
### Examples
TAG = { has_active_rule = rule_key }
has_active_ruleCOUNTRYanyChecks if the country's faction has a specific active rule
### Examples
TAG = { has_active_rule = rule_key }
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.
has_active_rule is commonly used in faction/alliance mods to dynamically enable or restrict decisions, national focuses, and technology rewards based on the current faction rules. For example, when a faction activates a rule prohibiting separate peace, it can be used to hide related diplomatic options or trigger warning events.
# If the faction currently has the "no_separate_peace" rule active, disable this decision
GER = {
available = {
NOT = { has_active_rule = no_separate_peace }
}
}
[compare_ideology_with_faction](/wiki/trigger/compare_ideology_with_faction): Checks the country's ideological alignment with its faction. Combined with has_active_rule, it can simultaneously constrain both "whether the faction rule is active" and "whether ideology matches", implementing more granular conditional thresholds.[has_completed_faction_goal](/wiki/trigger/has_completed_faction_goal): First determines if a faction goal is completed, then checks if the corresponding rule is active. Commonly used for chained logic where rules are triggered after goal completion.[faction_goal_fulfillment](/wiki/trigger/faction_goal_fulfillment): Evaluates the completion progress of a faction goal. Combined with has_active_rule, it can determine "whether rule activation aligns with goal progress", preventing desynchronization between rule state and goal state.[clear_rule](/wiki/effect/clear_rule): Called to remove rules when conditions no longer apply. Used in tandem with has_active_rule to create a complete lifecycle management pattern of "check → clear".has_active_rule uses exact string matching. If the rule_key differs in spelling from the key name defined in the faction template (including underscores and capitalization), the condition will silently return false without error, making it extremely difficult to debug.[any_allied_country](/wiki/trigger/any_allied_country) before making the judgment.