Wiki

trigger · is_hosting_exile

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

Checks if scope country is hosting target tag as an exile. is_hosting_exile = FRA

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

is_hosting_exile 常用于流亡政府相关 mod 场景,例如判断某国是否收留了特定流亡势力,从而解锁专属决议、外交选项或剧本事件。比如在法国沦陷后,检查英国是否收容了流亡法国政府,再触发对应的合作事件链。

# 在某个 focus 或 decision 的 available 块中
available = {
    tag = GBR
    is_hosting_exile = FRA
}

配合关系

  • [become_exiled_in](/wiki/effect/become_exiled_in) — 用于将某国流亡政府迁入宿主国,是 is_hosting_exile 成立的前提条件,通常在触发流亡事件的 effect 块中先执行此命令。
  • [end_exile](/wiki/effect/end_exile) — 当检测到流亡状态已不再需要(如解放条件满足)时,配合该 trigger 做条件判断后调用 end_exile 结束流亡关系。
  • [exists](/wiki/trigger/exists) — 流亡国本身可能因剧情消亡,在调用 is_hosting_exile 前先用 exists 确认目标标签仍然存活,避免脚本报错或逻辑异常。
  • [has_country_flag](/wiki/trigger/has_country_flag) — 常配合国家旗帜记录流亡协议的特殊阶段,与 is_hosting_exile 共同构成多条件判断,精确控制事件或决议的触发窗口。

常见坑

  1. Scope 填错is_hosting_exile 的 scope 是宿主国(收容方),而不是流亡国本身。新手常把 scope 写在流亡国一侧,导致条件永远为假,需要确认 = TAG 填写的是被收容的流亡标签,而外层 scope 是提供庇护的国家。
  2. 目标标签不存在时不报错但永假:若填写的流亡目标标签在当前存档中从未通过 become_exiled_in 建立过流亡关系,trigger 会静默返回 false 而非报错,调试时容易误以为其他逻辑出了问题,建议配合 exists 和日志输出辅助排查。

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

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

  1. 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.
  2. 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.