Hands-On Usage
is_hosting_exile is commonly used in mod scenarios involving exile governments, such as checking whether a country is harboring a specific exile faction, thereby unlocking exclusive decisions, diplomatic options, or scripted events. For example, after France falls, you can check if Britain is hosting an exiled French government and trigger corresponding cooperation event chains.
# In the available block of a focus or decision
available = {
tag = GBR
is_hosting_exile = FRA
}
Synergy
[become_exiled_in](/wiki/effect/become_exiled_in) — Used to relocate a country's exile government into a host nation; this is the prerequisite for is_hosting_exile to return true. This command is typically executed first in the effect block that triggers an exile event.
[end_exile](/wiki/effect/end_exile) — When the exile status is no longer needed (such as when liberation conditions are met), use this in conjunction with condition checks before calling end_exile to terminate the exile relationship.
[exists](/wiki/trigger/exists) — The exiled country may cease to exist due to scripted events. Before calling is_hosting_exile, use exists to confirm the target tag still lives, preventing script errors or logic failures.
[has_country_flag](/wiki/trigger/has_country_flag) — Often paired with country flags to track special stages of exile agreements. Used alongside is_hosting_exile to construct multi-condition logic and precisely control when events or decisions trigger.
Common Pitfalls
- Incorrect Scope: The scope of
is_hosting_exile is the host nation (the country providing shelter), not the exile country itself. Beginners often place the scope on the exiled nation's side, causing the condition to always return false. You must ensure that = TAG refers to the exiled tag being harbored, while the outer scope is the country providing sanctuary.
- Target Tag Does Not Exist Returns False Silently: If the exile target tag you specify has never established an exile relationship via
become_exiled_in in the current save, the trigger will silently return false rather than throw an error. This can easily mislead debugging efforts into thinking the problem lies elsewhere. It is recommended to pair this with exists and log output to assist troubleshooting.