Hands-On Usage
capture_by is commonly used in war events or campaign scripts to simulate a commander being captured by the enemy after a lost battle. It can also be used in mods to craft special narrative storylines around a commander's fate. The following example shows a commander being captured by Germany and held in a specific province:
# Executed within a unit leader scope
capture_by = {
country = GER
province = 11
}
If no holding location needs to be specified, the shorthand form can be used instead:
capture_by = GER
Synergy
- hidden_effect: Wraps the capture logic inside a hidden effect block, preventing unnecessary tooltip text from appearing in event options and keeping the event narrative clean.
- custom_effect_tooltip: Used alongside
hidden_effect to display a player-friendly message such as "Commander has been captured," replacing the default system text.
- save_event_target_as: Saves the commander as an event target before entering the unit leader scope, making it easy to reference or further process that commander in other scopes later.
- effect_tooltip: Previews the consequences of the capture effect inside an option block, so the player understands the impact before making a choice.
Common Pitfalls
- The scope must be a Unit Leader, not a country or province:
capture_by can only be executed within a unit leader scope. Calling it directly from a country scope will have no effect — you must first switch to the specific commander's scope via iteration or an event target.
- The target commander must be a General, not an Admiral: This command has no effect on naval commanders. If your mod needs to handle special storylines involving an Admiral, you will need to work around this limitation using alternative logic.