命令百科

effect · transfer_ship

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Transfers ship from scope country to target country.
Example:
ENG={
  transfer_ship={
    prefer_name = "HMS Achilles"
    type = light_cruiser
    target = NZL
    exclude_refitting = yes #optional, default is no; Exclude ships currently being refitted from the search.
  }
}

实战 · 配合 · 坑

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

实战用法

transfer_ship 常用于历史事件 mod 中模拟真实的舰艇移交,例如英国将军舰转让给盟国海军,或在内战/分裂事件中将舰队分配给新生国家。下面示例模拟英国将"HMS Achilles"号巡洋舰转让给新西兰:

# 在某个 country_event 的 option 中
ENG = {
    transfer_ship = {
        prefer_name = "HMS Achilles"
        type = light_cruiser
        target = NZL
        exclude_refitting = yes
    }
}

配合关系

  • [create_ship](/wiki/effect/create_ship) — 在转让前先为来源国创建一艘具名舰艇,确保 prefer_name 指定的目标船只真实存在,避免转让空舰队。
  • [destroy_ships](/wiki/effect/destroy_ships) — 当剧情需要"击沉后残舰移交"或清理多余舰艇时,可在转让之后销毁特定舰型,保持舰队规模真实可信。
  • [has_country_flag](/wiki/trigger/has_country_flag) — 在触发转让事件前用标记判断条件是否已满足(如外交协议已签署),防止重复执行转让逻辑。
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier) — 转让完成后为双方添加关系修正,体现军事援助带来的外交红利。

常见坑

  1. prefer_name 匹配失败时不会报错而是随机转让:若来源国实际不存在该名称的舰艇(例如船只已沉没或从未建造),游戏会静默地改为按 type 随机挑一艘,导致结果与预期不符;务必配合 create_ship 或事先确认舰艇存在。
  2. scope 混淆导致转让方向反转transfer_ship 必须写在出让国的 scope 内,target 才是接收国;新手常误将整段代码写在接收国 scope 下,造成舰艇转让方向完全相反。