Wiki

effect · set_air_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 "air") on that country.
Only intended to be used within history files.

Example:
set_air_oob = "ENG_1936_Air"

实战 · 配合 · 坑

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

实战用法

set_air_oob 主要用于在 mod 中为某个国家指定一套独立的空军战斗序列文件,常见于新增历史开局、替换默认空军编制或为自定义国家分配初始空军单位的场景。例如,当你为某个 mod 新增一个 1936 年开局的法国强化版空军时,可以在该国家的历史文件里这样写:

# history/countries/FRA - France.txt
set_air_oob = "FRA_1936_Air_Enhanced"

对应的 OOB 文件应放置于 history/units/ 目录下,文件名与字符串完全对应。

配合关系

  • [set_air_oob](/wiki/effect/set_air_oob)[division_template](/wiki/effect/division_template):空军编制文件往往需要配套的装备与模板定义,两者在同一国家历史文件中协同确保开局编制完整。
  • [has_deployed_air_force_size](/wiki/trigger/has_deployed_air_force_size):在事件或决议中可用此触发器检查空军规模是否达标,作为 set_air_oob 替换编制后的后续校验逻辑。
  • [create_equipment_variant](/wiki/effect/create_equipment_variant):为新 OOB 中出现的飞机型号预先创建对应的装备变体,避免 OOB 加载时找不到指定变体而报错。
  • [add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile):在 OOB 文件加载的同时向国家库存补充对应飞机装备,确保新编制的空军单位有足够装备可用。

常见坑

  1. 文件路径或文件名不匹配set_air_oob 的字符串值必须与 history/units/ 目录下的 .txt 文件名(不含扩展名)完全一致,包括大小写;哪怕多一个空格或字母大小写不同,游戏都会静默跳过该 OOB 文件,导致国家开局时没有任何空军单位且不报错,极难排查。
  2. 在非历史文件的动态 effect 中使用:该命令仅设计用于游戏开始前的历史文件加载阶段,若将其写入事件、国策或决议的 effect 块中,游戏运行时并不会动态生成新的空军部队,效果会被完全忽略。

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_air_oob is primarily used to assign a dedicated air force order of battle file to a specific country within a mod. It is commonly employed when adding new historical starts, replacing default air force compositions, or allocating initial air units to custom nations. For example, when creating an enhanced French air force for a mod with a 1936 start date, you would add the following to that nation's history file:

# history/countries/FRA - France.txt
set_air_oob = "FRA_1936_Air_Enhanced"

The corresponding OOB file should be placed in the history/units/ directory, with the filename matching the string exactly.

Synergy

  • [set_air_oob](/wiki/effect/set_air_oob) and [division_template](/wiki/effect/division_template): Air force OOB files typically require accompanying equipment and template definitions. Both work in concert within the same nation's history file to ensure a complete starting composition.
  • [has_deployed_air_force_size](/wiki/trigger/has_deployed_air_force_size): This trigger can be used in events or decisions to verify whether air force size meets requirements, serving as a validation step after set_air_oob replaces the composition.
  • [create_equipment_variant](/wiki/effect/create_equipment_variant): Preemptively create corresponding equipment variants for aircraft types appearing in the new OOB to prevent errors when the OOB loads and cannot find the specified variant.
  • [add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile): Simultaneously add aircraft equipment to the nation's stockpile as the OOB file loads, ensuring the new air units have sufficient equipment available.

Common Pitfalls

  1. File path or filename mismatch: The string value for set_air_oob must exactly match the .txt filename (without extension) in the history/units/ directory, including case sensitivity. Even a single extra space or incorrect case will cause the game to silently skip the OOB file, resulting in a country with no air units at game start and no error message, making this extremely difficult to diagnose.
  2. Using within dynamic effects outside history files: This command is designed exclusively for the history file loading phase before game start. If placed in the effect block of an event, national focus, or decision, the game will not dynamically generate new air units at runtime, and the effect will be completely ignored.