trigger · is_in_faction_with
Definition
- Supported scope:
COUNTRY - Supported target:
THIS,ROOT,PREV,FROM,OWNER,CONTROLLER,OCCUPIED,CAPITAL
Description
check if member of same faction as specified country
is_in_faction_withCOUNTRYTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALcheck if member of same faction as specified country
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.
is_in_faction_with is commonly used in alliance diplomacy mods to determine whether two countries belong to the same faction, thereby deciding whether to trigger specific events, unlock decisions, or restrict war goals. For example, when designing a decision like "only allies can share intelligence," you can use this trigger as an available condition:
# Check if the current country belongs to the same faction as Germany before executing this decision
available = {
is_in_faction_with = GER
}
[any_allied_country](/wiki/trigger/any_allied_country): When iterating through all allies, combine with is_in_faction_with to further confirm whether a specific ally truly belongs to the same faction (allies and faction members are not entirely equivalent in edge cases).[exists](/wiki/trigger/exists): Before using is_in_faction_with, first verify that the target country exists to avoid trigger errors or silent failures caused by a defunct target nation.[add_to_faction](/wiki/effect/add_to_faction): Commonly used in logic like "if not already in the same faction, force them to join." Execute the join operation after negating is_in_faction_with.[has_defensive_war_with](/wiki/trigger/has_defensive_war_with): Combined judgment for "allies in a defensive war" scenarios to determine whether to trigger aid or auto-join war events.exists and faction-related triggers beforehand.is_in_faction_with is the country being judged, and the target is the country for comparison. When used within nested every_faction_member or any_allied_country loops, it's easy to misalign THIS/ROOT/PREV relationships, resulting in comparing the same country with itself, always returning true.