Hands-On Usage
has_operation_token is commonly used in intelligence and espionage system mods to check whether a nation has executed a specific spy operation against a target country or accumulated sufficient infiltration markers, thereby unlocking subsequent decisions or event options. A typical scenario: after the player completes an infiltration operation against Germany, a follow-up sabotage decision is only allowed to trigger.
# Decision is only available when this nation holds an infiltration token against GER
available = {
has_operation_token = {
tag = GER
token = infiltration_stage_1
}
}
Synergy
[add_operation_token](/wiki/effect/add_operation_token): First use this effect to add a token to the target nation, then use has_operation_token to detect whether the token exists, forming a complete "write-read" cycle.
[has_completed_focus](/wiki/trigger/has_completed_focus): Often paired with focus completion checks, requiring the player to both complete relevant intelligence focuses and hold the token, establishing a dual-threshold logic for decision validity.
[has_country_flag](/wiki/trigger/has_country_flag): When combining the token system with country flags, you can distinguish between two semantic states: "has executed before" (persistent flag record) and "currently holds token" (clearable state).
[any_operative_leader](/wiki/trigger/any_operative_leader): Used in scenarios requiring simultaneous detection of operative personnel existence, ensuring subsequent content only triggers when both an executor exists and the corresponding token is held.
Common Pitfalls
tag is filled with the scope's own value: Beginners often mistakenly set tag to their own country's tag (the current scope), but tag should actually reference the target country to which the token applies—this is a different nation from the token holder (the scope nation).
- Token ID case sensitivity or spelling mismatch: The value in the
token field must exactly match the ID written during add_operation_token (case-sensitive). Even a single extra underscore or incorrect capitalization will cause the check to permanently return false with no error message, making it extremely difficult to debug.