Wiki

effect · set_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 no key) on that country.
Only intended to be used within history files.

Example:
set_oob = "ENG_1936"

实战 · 配合 · 坑

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

实战用法

set_oob 主要用于在历史文件(history/countries/)中为国家指定开局部队编制文件,也常见于 mod 中为新增国家或替换国家指定自定义 OOB。当 mod 需要彻底重塑某国的开局军队构成时,只需在该国的历史文件顶层执行块中调用一次即可覆盖原有注册。

# history/countries/ENG - Britain.txt
capital = 123
set_oob = "ENG_1936_mymod"   # 使用 mod 自定义的部队编制文件

配合关系

  • [division_template](/wiki/effect/division_template):OOB 文件内引用的师团模板需要事先在历史文件中用 division_template 定义,两者共同决定开局部队的外观与能力。
  • [add_ideas](/wiki/effect/add_ideas):通常在同一历史文件中与 set_oob 并列,用于赋予国家开局国策思潮,使军队编制与国家状态同步初始化。
  • [add_manpower](/wiki/effect/add_manpower):搭配使用以确保国家拥有足够人力来支撑 OOB 中定义的部队,避免出现人力为负的情况。

常见坑

  1. 在事件或决议中误用set_oob 设计上仅用于历史文件的初始化阶段,若将其写入 country_eventoption 块或 hidden_effect 等游戏中触发的效果块,行为不可预期,游戏内动态修改部队编制应改用其他手段(如 create_corps_commanderdelete_units 等组合)。
  2. OOB 文件路径或命名错误set_oob = "ENG_1936_mymod" 对应的实际文件必须放在 history/units/ENG_1936_mymod.txt,文件名大小写需与字符串完全一致,否则游戏开局时该国部队将静默缺失,且不会有明显报错提示。

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_oob is primarily used in history files (history/countries/) to assign an order of battle file to a nation at game start, and is commonly seen in mods to specify custom OOBs for new or replaced nations. When a mod needs to completely reshape a nation's starting army composition, it only requires a single call to set_oob in the top-level effect block of that nation's history file to override the original registration.

# history/countries/ENG - Britain.txt
capital = 123
set_oob = "ENG_1936_mymod"   # Use the mod's custom OOB file

Synergy

  • [division_template](/wiki/effect/division_template): The division templates referenced in the OOB file must be defined beforehand in the history file using division_template. Both work together to determine the appearance and capabilities of your starting units.
  • [add_ideas](/wiki/effect/add_ideas): Typically paired with set_oob in the same history file to grant the nation starting national focuses, ensuring the army composition and national state are initialized together.
  • [add_manpower](/wiki/effect/add_manpower): Use alongside set_oob to ensure the nation has sufficient manpower to support the units defined in the OOB, preventing negative manpower situations.

Common Pitfalls

  1. Misuse in events or decisions: set_oob is designed solely for initialization in history files. If placed in the option block of a country_event or other in-game triggered effect blocks like hidden_effect, behavior becomes unpredictable. For dynamic unit composition changes during gameplay, use alternative methods instead (such as combinations of create_corps_commander, delete_units, etc.).
  2. OOB file path or naming errors: The set_oob = "ENG_1936_mymod" reference requires the actual file to be located at history/units/ENG_1936_mymod.txt. Filename casing must match the string exactly; otherwise, the nation's units will silently fail to load at game start with no clear error message.