Hands-On Usage
has_nationality is commonly used in espionage/operative system mod scenarios, such as determining whether an operative can execute specific missions based on their nationality, triggering exclusive events, or filtering target operatives for nationality conversion within limit blocks. The following example demonstrates how to restrict an operation to only German operatives:
# In the trigger block of operative_leader_event
trigger = {
is_operative = yes
has_nationality = GER
}
Synergy
[is_operative](/wiki/trigger/is_operative): Before using has_nationality, you must confirm the character is an operative, otherwise the game script will error. These two almost always appear together in pairs.
[set_nationality](/wiki/effect/set_nationality): Common in "turn/convert operative" logic—first use has_nationality to check the original nationality, then use set_nationality to convert them to the new faction.
[turn_operative](/wiki/effect/turn_operative): When turning an enemy operative into your own, typically filter operatives of the target nationality using has_nationality first, then trigger the defection effect.
[add_nationality](/wiki/effect/add_nationality): Before granting an operative dual nationality, you can use has_nationality to check their current primary nationality and avoid logical conflicts.
Common Pitfalls
- Using it under non-operative character scopes:
has_nationality has no effect on regular generals, advisors, and other non-operative characters. The script will not throw a syntax error but will always return false. You must filter in advance with is_operative = yes, otherwise the logic will silently fail.
- Confusing "nationality" with "employment nation": An operative's nationality and which country currently employs/controls them are two different concepts.
has_nationality checks the former and cannot be used to determine which nation an operative is currently loyal to. Beginners often conflate the two, resulting in incorrect condition logic.