Hands-On Usage
This trigger is extremely useful when you need to check whether a certain nation is engaged in an offensive war but a specific ally is not participating in it. A typical scenario involves designing "isolationism" or "backstab" events—for example, triggering diplomatic penalties or special decisions when a nation declares war alone without pulling in key allies.
# Example: Trigger a diplomatic event when the player's nation launches an offensive war without a specific ally
country_event = {
id = my_mod.1
trigger = {
has_offensive_war_without_friend = {
target = GER # Check whether Germany is not participating as an ally
}
}
# ...
}
Synergy
[has_defensive_war](/wiki/trigger/has_defensive_war) — Often used in contrast with this trigger to distinguish whether the current nation is in an offensive or defensive war state, making the conditional logic more complete.
[any_allied_country](/wiki/trigger/any_allied_country) — Used to further enumerate allied status and verify which allies are actually participating in the war, forming a dual verification with this trigger.
[has_war_with](/wiki/trigger/has_war_with) (combined with [any_enemy_country](/wiki/trigger/any_enemy_country)) — Confirms the opposing combatant, making the determination of "isolated offense" more precise.
[add_opinion_modifier](/wiki/effect/add_opinion_modifier) — When this trigger evaluates to true, apply diplomatic opinion penalties to relevant nations, the most common follow-up effect pairing.
Common Pitfalls
- Mistaking target as the enemy: The
target parameter specifies the expected ally that should exist, not the opposing combatant. Beginners often fill in the enemy nation as the target, inverting the logic entirely and causing the trigger to always return false.
- Overlooking that scope must be COUNTRY: Using this trigger under STATE or CHARACTER scope will cause script errors or silent failures. Always ensure the outer scope is nation-level before writing this condition.