命令百科

effect · create_ship

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

create a ship from another country and assign it to the reserve fleet.
'creator' is optional. If not set, it will be the scoped country.
'name' is optional.
FRA = {
  create_ship = {
    type = ship_hull_submarine_1
    equipment_variant = "S Class"
    creator = ENG
    name = "My ship name"
    amount = 5 #amount to add
  }
}

实战 · 配合 · 坑

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

实战用法

create_ship 常用于剧情事件或国策奖励中,为某国凭空生成一艘舰船并直接加入预备舰队,例如模拟战争赔偿、缴获敌舰或盟友援助舰艇的场景。creator 字段可用来标记舰船的"原造国",影响其装备模板来源——若想生成某国特有的命名变体,必须使用该国已定义的 equipment_variant 名称。

# 英国通过国策获得法国赠予的潜艇
ENG = {
    create_ship = {
        type = ship_hull_submarine_1
        equipment_variant = "S Class"
        creator = ENG
        name = "HMS Gift"
        amount = 3
    }
}

配合关系

  • [create_equipment_variant](/wiki/effect/create_equipment_variant):在调用 create_ship 之前先为目标国创建装备变体,确保 equipment_variant 字段所引用的变体名称确实存在,否则舰船无法生成。
  • [destroy_ships](/wiki/effect/destroy_ships):与 create_ship 形成"换代"逻辑,先销毁旧舰船,再生成新型号,常用于舰队现代化改造事件。
  • [has_design_based_on](/wiki/trigger/has_design_based_on):用于判断某国是否拥有特定舰船设计模板,可在 create_ship 执行前做条件检查,避免因变体不存在导致静默失败。
  • [add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile):在不需要命名或指定变体的情况下,可作为更简便的替代手段往库存添加装备,两者按需选用。

常见坑

  1. equipment_variant 名称必须与目标国已有的设计完全匹配(包括大小写和空格),若该变体在 creator 国中不存在,效果会静默失败,不会报错但也不会生成任何舰船,排查时极易忽略。
  2. scope 必须是接收舰船的国家,而非 creator,新手常误将 creator 国作为外层 scope,导致舰船被分配给错误的国家,creator 仅用于指定装备模板的来源国,不影响归属。