Hands-On Usage
is_preparing_operation is commonly used in espionage-related mod scenarios, such as dynamically adjusting AI decisions or locking certain diplomatic options when a nation is planning a specific operation against a target. For example, you can check within an available block whether your nation is already preparing an operation against a specific target, preventing players from initiating redundant espionage tasks.
# Example: A decision is only available if you are not yet preparing an infiltration operation against Italy
available = {
NOT = {
is_preparing_operation = {
target = ITA
operation = operation_infiltrate_armed_forces_navy
}
}
}
Synergy
[has_active_mission](/wiki/trigger/has_active_mission): Often paired with this trigger to first check if there are active missions, then determine whether you are simultaneously preparing a specific operation, forming multi-layered condition protection.
[any_operative_leader](/wiki/trigger/any_operative_leader): Used to further restrict whether the operative executing the operation meets specific conditions, working together with this trigger to form a dual verification of "operation + executor".
[add_operation_token](/wiki/effect/add_operation_token): Rewards or consumes operation tokens after conditions are met, serving as a typical effect that immediately follows condition checks in espionage task chains.
[country_event](/wiki/effect/country_event): Triggers narrative events when detecting that a nation is preparing an operation, achieving storytelling effects such as espionage operations being discovered.
Common Pitfalls
- Incorrect scope object in
target field: target must be filled with a country TAG (such as ITA). Beginners sometimes mistakenly fill in state IDs or province IDs, causing the trigger to always return false without error reporting, making it difficult to debug.
- Inaccurate key in
operation field: operation must be filled with the complete definition key starting with operation_, strictly corresponding to the name field in the actual script file. Using localized names (such as Chinese or English display names) will cause the condition to fail.