Hands-On Usage
release_from_captivity is most commonly used in end-of-war events, armistice negotiations, or special mission chains to free captured commanders and restore them to an available state. For example, when a ceasefire event fires, you can mass-release all captured leaders belonging to a country, or use it in a narrative event to represent a specific commander being exchanged through diplomatic means.
# Release captured leaders in an armistice event
country_event = {
id = armistice.1
title = armistice.1.t
desc = armistice.1.d
option = {
name = armistice.1.a
every_country_with_original_tag = {
limit = { tag = GER }
every_character = {
limit = {
is_army_leader = yes
is_general_captured = yes
}
release_from_captivity = yes
}
}
}
}
Synergy
- is_general_captured: The standard prerequisite check before executing a release — confirms the character is actually captured, preventing unnecessary calls.
- add_unit_leader_trait: Immediately assign a trait to the leader after release (e.g. "POW Survivor") to enrich narrative flavor.
- unit_leader_event: Fire a dedicated event on the character after release to advance follow-up storylines or grant additional rewards.
- set_character_flag: Set a flag at the moment of release to prevent the same leader from being released again or re-triggering related event chains within the same playthrough.
Common Pitfalls
- Forgetting to scope into
CHARACTER: This effect must be executed inside a CHARACTER scope. Writing it directly in a country-scope effect block without first entering a character scope via every_character, var:target_leader = { }, or a similar method will cause the script to error out or silently do nothing — it will not automatically iterate over all captured leaders in that country.
- Skipping the
is_general_captured check: The documentation notes that the effect does nothing if the character is not captured, but omitting a limit = { is_general_captured = yes } filter inside a large loop means the effect is called indiscriminately on every character. This creates unnecessary performance overhead that becomes especially noticeable in mods with large character rosters.