Wiki

effect · load_oob

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Immediately loads an Order of Battle (OOB) file.

Example:
load_oob = "ENG_1936"

实战 · 配合 · 坑

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

实战用法

load_oob 常用于历史情景 mod 中,在特定触发条件下(如玩家完成某个国策或到达某一历史节点)为国家重新加载一套预设部队编制,也可用于内战事件中给叛军阵营即时刷入军队。注意 OOB 文件需位于 history/units/ 目录下且文件名与参数严格一致。

# 某国策完成后立即加载 1939 年的战时编制
complete_national_focus = SOV_war_preparations
hidden_effect = {
    load_oob = "SOV_1939_mobilization"
}

配合关系

  • [delete_units](/wiki/effect/delete_units):在加载新 OOB 之前先清除旧部队,避免重复部队与新编制叠加产生冗余单位。
  • [add_manpower](/wiki/effect/add_manpower):OOB 文件生成部队会消耗人力,提前补充人力可确保部队完整生成而不出现残编。
  • [country_event](/wiki/effect/country_event):常作为事件选项的效果之一,在玩家做出选择后立即加载对应的部队编制,搭配叙事性事件使用体验更流畅。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):作为触发 load_oob 的前置条件判断,确保只在完成特定国策后才执行部队加载,防止提前或重复触发。

常见坑

  1. 文件名大小写不匹配:HOI4 在 Linux/Mac 环境下对文件名大小写敏感,若脚本中写的是 "ENG_1936" 而实际文件名为 "eng_1936.txt",游戏将静默失败且不报错,导致部队根本不出现。
  2. 未清理旧部队直接加载:直接在已有大量部队的国家上调用 load_oob 不会替换现有部队,而是叠加生成,造成师级单位数量爆炸,严重影响 AI 行为和游戏性能。

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

load_oob is commonly used in historical scenario mods to reload a preset army composition for a nation under specific trigger conditions (such as when the player completes a focus tree or reaches a historical milestone), and can also be used in civil war events to instantly spawn military units for rebel factions. Note that OOB files must be located in the history/units/ directory and the filename must match the parameter exactly.

# Load the 1939 wartime composition immediately after completing a focus
complete_national_focus = SOV_war_preparations
hidden_effect = {
    load_oob = "SOV_1939_mobilization"
}

Synergy

  • [delete_units](/wiki/effect/delete_units): Delete old units before loading a new OOB to avoid duplicate units and redundancy when the new composition overlaps with existing forces.
  • [add_manpower](/wiki/effect/add_manpower): Spawning units from OOB files consumes manpower; replenishing manpower beforehand ensures units are generated completely without becoming understrength.
  • [country_event](/wiki/effect/country_event): Commonly used as an effect in event options to load the corresponding unit composition immediately after the player makes a choice, creating a smoother narrative experience when paired with story events.
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Serves as a precondition trigger for load_oob to ensure unit loading only executes after completing a specific focus, preventing premature or duplicate triggers.

Common Pitfalls

  1. Filename case mismatch: HOI4 is case-sensitive on Linux/Mac environments. If the script uses "ENG_1936" but the actual filename is "eng_1936.txt", the game will fail silently without reporting an error, causing units to never appear.
  2. Loading without clearing old units: Calling load_oob directly on a nation that already has many units will not replace existing units but stack new ones on top, resulting in an explosion of division-level units that severely impacts AI behavior and game performance.