Hands-On Usage
has_wargoal_against is commonly used to check whether a nation has already declared a war goal against a target nation, allowing you to control the availability of decisions or focuses—for example, "only allow subsequent diplomatic events or war escalation options to trigger if the player already holds a specific war goal against the target nation." In multi-path mods, it's also frequently used for mutual exclusion checks to prevent players from repeatedly adding war goals of the same type.
# Decision is only available if this nation holds a "take state" type war goal against Germany
available = {
has_wargoal_against = {
target = GER
type = take_state
}
}
Synergy
[create_wargoal](/wiki/effect/create_wargoal): The most direct companion effect. Use has_wargoal_against to check if the war goal exists first; only execute create_wargoal if it doesn't, avoiding duplicate creation.
[declare_war_on](/wiki/effect/declare_war_on): Typically triggered after confirming that a war goal already exists, maintaining the logical sequence of "establish goal before declaring war."
[has_defensive_war_with](/wiki/trigger/has_defensive_war_with): Combined together, these allow you to distinguish between "I actively hold a war goal" and "I am in a defensive war," enabling more granular conditional branching.
[any_enemy_country](/wiki/trigger/any_enemy_country): Pairing with has_wargoal_against allows you to iterate through current enemies and check whether you hold a specific type of war goal against each, suitable for multi-target scenarios.
Common Pitfalls
- Confusing "having a war goal" with "being in active combat":
has_wargoal_against only checks whether a war goal exists; it returns true even if war hasn't been declared yet. Beginners often mistakenly treat it as equivalent to "currently at war with that nation," requiring additional use of [has_defensive_war_with](/wiki/trigger/has_defensive_war_with) or other war status triggers for accurate detection.
- Using unsupported scope keywords in the target field: The
target field only accepts whitelisted scope references (such as THIS, ROOT, FROM, etc.) or concrete nation tags. Writing provinces or state IDs directly will cause script errors or the condition to never evaluate true. Always ensure the value you provide is a valid nation scope.