Hands-On Usage
add_decryption is commonly used in espionage-related mod scenarios, such as granting decryption progress against a specific enemy nation after completing national focuses, decisions, or events. This helps establish intelligence advantage quickly. A typical use case is when a player establishes an intelligence agency and completes specific upgrades, then receives a one-time decryption progress boost against a target nation via an event reward.
country_event = {
id = spy_ops.5
title = spy_ops.5.t
option = {
name = spy_ops.5.a
# Add a percentage of decryption progress against Germany
add_decryption = {
target = GER
ratio = 0.25
}
}
}
Synergy
[decryption_progress](/wiki/trigger/decryption_progress) — Before or after using add_decryption, use this trigger to check the current decryption progress percentage against the target nation, allowing you to decide whether to grant additional bonuses or trigger subsequent events.
[add_intel](/wiki/effect/add_intel) — These two effects are frequently paired together in intelligence mods. add_decryption increases decryption progress while add_intel directly increases intelligence quantity against the target nation, forming a complete intelligence reward package.
[create_intelligence_agency](/wiki/effect/create_intelligence_agency) — Typically used to ensure your nation has an intelligence agency before applying decryption bonuses, avoiding wasted effects when no agency exists. This is commonly seen in script sequences that create the agency first before executing decryption.
[compare_intel_with](/wiki/trigger/compare_intel_with) — Used to determine whether the intelligence gap reaches a certain threshold after granting decryption progress, driving subsequent reward or penalty branching logic.
Common Pitfalls
- Filling in both
amount and ratio simultaneously — Only one can be used. If both are written in the script, the game will only read one (behavior is unpredictable), and newcomers often end up with unexpected decryption amounts. Always choose one and comment out the other.
- Target contains a non-existent or already-eliminated nation —
target must be a valid nation TAG that exists in the current game. If the target nation has been eliminated or has not yet spawned in the game, the effect will silently fail without error, making debugging difficult. It is recommended to use [exists](/wiki/trigger/exists) first to verify existence.