Wiki

effect · set_naval_oob

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Registers an Order of Battle (OOB) file to be loaded for a country at game start, replacing any previously registered OOB (with key "naval") on that country.
Only intended to be used within history files.

Example:
set_naval_oob = "ENG_1936_Naval"

实战 · 配合 · 坑

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

实战用法

set_naval_oob 主要用于历史模式 mod 中为某个国家指定开局海军编制文件,常见于修改默认海军阵容、新增历史国家或彻底重构某国开局舰队的场景。指定的文件路径相对于 history/units/ 目录,文件名无需带扩展名。

# 在 history/countries/ENG - United Kingdom.txt 中
set_naval_oob = "ENG_1936_Naval_Custom"

配合关系

  • [create_ship](/wiki/effect/create_ship):当 OOB 文件中的舰船需要额外的初始变体定义时,可在同一历史文件中先用此命令预先创建舰船变体,确保 OOB 加载时变体已存在。
  • [create_equipment_variant](/wiki/effect/create_equipment_variant):海军 OOB 文件中引用的装备变体须事先注册,该命令通常与 set_naval_oob 出现在同一历史文件块中,负责声明舰船型号。
  • [has_capitulated](/wiki/trigger/has_capitulated):在事件或决策中动态调整海军编制前,可用此触发器检查目标国是否仍处于活跃状态,避免无效赋值。
  • [destroy_ships](/wiki/effect/destroy_ships):若需先清空某国现有舰队再通过新 OOB 重建,可在同一执行块中配合使用。

常见坑

  1. 在非历史文件中使用:该命令官方说明仅限于 history/ 文件内使用,若放入事件、决策或 focus 的 effect 块中,游戏已完成初始化加载,OOB 不会被正确解析,舰队不会生成。
  2. OOB 文件路径写错或大小写不匹配:文件名对大小写敏感,且必须与 history/units/ 下的实际文件名完全一致;写错会导致该国开局完全没有海军,且游戏日志中的报错容易被忽略。

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

set_naval_oob is primarily used in historical mods to assign a naval OOB file for a specific nation at game start. It is commonly applied when modifying default naval compositions, adding historical nations, or completely restructuring a nation's initial fleet. The specified file path is relative to the history/units/ directory, and the filename does not require a file extension.

# In history/countries/ENG - United Kingdom.txt
set_naval_oob = "ENG_1936_Naval_Custom"

Synergy

  • [create_ship](/wiki/effect/create_ship): When ship variants in the OOB file require additional initial variant definitions, you can pre-create ship variants using this command within the same history file to ensure the variants exist when the OOB is loaded.
  • [create_equipment_variant](/wiki/effect/create_equipment_variant): Equipment variants referenced in naval OOB files must be registered beforehand. This command typically appears in the same history file block as set_naval_oob and is responsible for declaring ship models.
  • [has_capitulated](/wiki/trigger/has_capitulated): Before dynamically adjusting naval composition in events or decisions, you can use this trigger to check whether the target nation remains in an active state, avoiding invalid assignments.
  • [destroy_ships](/wiki/effect/destroy_ships): If you need to clear a nation's existing fleet before rebuilding it with a new OOB, you can use this command in conjunction within the same execution block.

Common Pitfalls

  1. Using outside history files: This command is officially documented for use only within history/ files. If placed in the effect block of events, decisions, or focuses, the game will have already completed initial loading, and the OOB will not be parsed correctly, resulting in no fleet generation.
  2. Incorrect OOB file path or case mismatch: Filenames are case-sensitive and must exactly match the actual filename under history/units/. Typos will result in the nation having no navy at game start, and error messages in the game log are easily overlooked.