Hands-On Usage
remove_targeted_decision is commonly used in mods to dynamically revoke decisions or tasks targeted at specific nations. Typical scenarios include canceling ongoing negotiation decisions when diplomatic relations break down or after events trigger, or cleaning up mission entries that are no longer relevant upon task completion. A typical use case is when a player abandons a diplomatic action through an event option, requiring the corresponding decision attached to the target nation to be removed simultaneously.
# When a nation abandons alliance negotiations, remove the diplomatic decision targeting the recipient
country_event = {
id = my_mod.15
option = {
name = my_mod.15.a
# Remove the negotiation decision this country mounted on ENG
remove_targeted_decision = {
target = ENG
decision = my_alliance_negotiation_decision
}
}
}
Synergy
[activate_targeted_decision](/wiki/effect/activate_targeted_decision): These two are inverse operations of each other. When the conditions for activating a decision no longer hold, use remove_targeted_decision to revoke it, forming complete toggle logic.
[has_active_mission](/wiki/trigger/has_active_mission): Check in limit or trigger blocks whether the target actually holds the corresponding mission/decision before executing removal, avoiding invalid call log warnings.
[add_days_remove](/wiki/effect/add_days_remove): If you only want a decision to disappear automatically after a limited time, use add_days_remove instead of manual removal. However, when immediate and unconditional removal is needed, remove_targeted_decision is the correct choice. Using both together handles different lifecycle requirements.
[activate_decision](/wiki/effect/activate_decision): Use in conjunction with non-targeted decision activation to remove the old targeted decision and then activate a new standard decision within the same option, enabling smooth decision state transitions.
Common Pitfalls
- Incorrect
target specification causing silent failure: The target must be a valid nation TAG or STATE reference existing in the current game. If the target nation no longer exists or the TAG is misspelled, the game will not report an error but the decision will not be removed. Beginners often mistakenly believe the script worked when the decision actually remains mounted.
- Execution in the wrong scope: This effect must be called within the COUNTRY or STATE scope that owns the decision. If executed within the target's scope (for example, mistakenly using
every_allied_country to iterate to the other party), it will fail silently due to not finding the decision. Always ensure the executing scope is the side that mounted the decision, not the target side.