diff --git a/mod-docs.html b/mod-docs.html index 565c76a..ff31577 100644 --- a/mod-docs.html +++ b/mod-docs.html @@ -148,7 +148,9 @@

备份目录说明:<游戏副本>/wtoffline/stock/ 是启动器用来重建和还原纯净客户端的原版备份目录,请按只读方式对待,不要手动修改或覆盖其中的文件,以免影响关闭模组后的自动还原。所有模组改动都放在 mods/<你的模组>/ 下即可。

2.2 查阅与解包原版数据的方法

你可以根据自己的习惯,直接从本机原版客户端查阅 .blk、.csv 和 .nut 文件:

-
  1. 使用社区解包工具在本地查阅: 将客户端里的 char.vromfs.bin、aces.vromfs.bin、gui.vromfs.bin 等归档复制到单独的临时工作文件夹(不要在游戏目录原地解包),使用常见的 .vromfs.bin / .blk 社区解包工具提取目录并将二进制 .blk 转为可读文本,即可查找任意载具的内部 ID、科技树路径和字段名。
  2. 用 WTOffline 仓库自带库直接读取(适合拉取了源码仓库的开发者): 如果你在本地克隆了 WTOffline 仓库,可以直接在仓库根目录用 Node 24 调用内置的 @wto/vromfs 与 @wto/blk 读取任意原版包内的二进制 .blk 并打印为标准文本 BLK:
+
  1. 使用社区解包工具在本地查阅: +将客户端里的 char.vromfs.bin、aces.vromfs.bin、gui.vromfs.bin 等归档复制到单独的临时工作文件夹(不要在游戏目录原地解包),使用常见的 .vromfs.bin / .blk 社区解包工具提取目录并将二进制 .blk 转为可读文本,即可查找任意载具的内部 ID、科技树路径和字段名。
  2. 用 WTOffline 仓库自带库直接读取(适合拉取了源码仓库的开发者): +如果你在本地克隆了 WTOffline 仓库,可以直接在仓库根目录用 Node 24 调用内置的 @wto/vromfs 与 @wto/blk 读取任意原版包内的二进制 .blk 并打印为标准文本 BLK:
js
import { readFileSync } from 'node:fs';
 import { getFile, NAME_MAP_PATH, readArchive } from './packages/vromfs/src/index.ts';
 import { decodeBlk, formatBlkText, parseSharedNameMap } from './packages/blk/src/index.ts';
@@ -202,7 +204,7 @@ console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: a
    ├─ gui-patches/                    #   GUI 脚本/模板/样式增量补丁(与本体 patches/gui 同格式)
    ├─ exe-patches/                    #   声明式 exe 补丁(与本体 patches/exe 同格式)
    ├─ files/                          #   可选:大型整合包附带的配套涂装/瞄具/音效/任务
-   └─ config-blk.patch.jsonc          #   可选:游戏根目录 config.blk 的增量补丁
+ └─ config-blk.patch.blk # 可选:游戏根目录 config.blk 的增量补丁(也兼容 .patch.jsonc)

5. mod.jsonc 全字段参考

清单元数据解析采用严格白名单校验,写错字段名或出现未定义字段会被直接拒绝,并在启动器报错区显示具体原因。

@@ -210,7 +212,7 @@ console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: a

6. 启动器自动计算的能力与风险徽标(多徽标叠加)

启动器扫描模组目录后会自动计算并展示能力徽标。徽标是多选累加(非互斥)的——例如同时包含数据包修改与服务端脚本的模组会同时显示 data 和 script 两个徽标,而 official-map-selector 会同时显示 data、gui、script 三个徽标:

- +

7. 排序规则与冲突检测

@@ -220,7 +222,7 @@ console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: a

Target Spec: format: 1 · api_version: "0.1-experimental" (experimental API; subject to breaking changes as core development progresses)

1. Core Concept: Additive Overlay Architecture

WTOffline uses a stackable, load-order additive mod architecture. Mods supply incremental patches and added files to the client and server, and do not replace whole stock .vromfs.bin archives:

-
  1. Before launching the game, the launcher starts from clean stock backups (<copy>/wtoffline/stock/), applies core offline patches first, and then layers every enabled mod's client patches and added files in the exact order shown on the Mods page;
  2. Large 3D model and texture addons mount across drives with zero file copying via Windows NTFS Directory Junctions;
  3. When the local server starts, it automatically extracts static game data from the overlaid client packs, merges each mod's server/tuning/*.jsonc in the same order, and loads server/index.ts scripts;
  4. When you disable a mod or switch presets, the launcher automatically unmounts junctions and restores clean files from wtoffline/stock/ without corrupting the client copy.
+
  1. Before launching the game, the launcher starts from clean stock backups (<copy>/wtoffline/stock/), applies core offline patches first, and then layers every enabled mod's client patches and added files in the exact order shown on the Mods page;
  2. Large 3D model and texture addons mount across drives with zero file copying via Windows NTFS Directory Junctions;
  3. When the local server starts, it automatically extracts static game data from the overlaid client packs, merges each mod's server/tuning/*.jsonc in the same order, and loads server/index.ts scripts;
  4. When you disable a mod or switch presets, the launcher automatically unmounts junctions and restores clean files from wtoffline/stock/ without corrupting the client copy.

2. Prerequisite: How to Unpack & Inspect Stock Game Files

@@ -231,7 +233,9 @@ console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: a

Note on the backup folder: Treat <copy>/wtoffline/stock/ as read-only. The launcher relies on wtoffline/stock/ to rebuild overlays and restore clean files when mods are disabled; modifying files inside stock/ can prevent automatic restoration. Place all mod changes under mods/<your-mod>/.

2.2 Practical Ways to Inspect Stock Files

You can inspect stock .blk, .csv, and .nut files directly from your own local game installation:

-
  1. Local unpacking with community tools: Copy char.vromfs.bin, aces.vromfs.bin, or gui.vromfs.bin from your client into a separate scratch folder (avoid unpacking in-place inside the game directory) and use standard community .vromfs.bin / .blk unpacking tools to extract readable text .blk and .nut files, vehicle IDs, and tech-tree paths.
  2. 5-line Node 24 snippet using @wto/vromfs + @wto/blk (if you cloned the WTOffline repo): If you have the WTOffline repository checked out locally, run Node 24 from the repo root to decode any binary .blk straight out of a .vromfs.bin archive and print formatted text BLK:
+
  1. Local unpacking with community tools: +Copy char.vromfs.bin, aces.vromfs.bin, or gui.vromfs.bin from your client into a separate scratch folder (avoid unpacking in-place inside the game directory) and use standard community .vromfs.bin / .blk unpacking tools to extract readable text .blk and .nut files, vehicle IDs, and tech-tree paths.
  2. 5-line Node 24 snippet using @wto/vromfs + @wto/blk (if you cloned the WTOffline repo): +If you have the WTOffline repository checked out locally, run Node 24 from the repo root to decode any binary .blk straight out of a .vromfs.bin archive and print formatted text BLK:
js
import { readFileSync } from 'node:fs';
 import { getFile, NAME_MAP_PATH, readArchive } from './packages/vromfs/src/index.ts';
 import { decodeBlk, formatBlkText, parseSharedNameMap } from './packages/blk/src/index.ts';
@@ -285,7 +289,7 @@ console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: a
    ├─ gui-patches/                    #   incremental GUI script/tpl/css patches (same format as patches/gui)
    ├─ exe-patches/                    #   declarative exe patches (same format as patches/exe)
    ├─ files/                          #   optional companion skins/sights/sounds/missions
-   └─ config-blk.patch.jsonc          #   optional root config.blk incremental patch
+ └─ config-blk.patch.blk # optional root config.blk incremental patch (also accepts .patch.jsonc)

5. Full mod.jsonc Schema Reference

Manifest parsing enforces strict whitelist validation: typos or unknown keys are rejected immediately with a detailed error message on the Launcher Mods page.

@@ -293,10 +297,10 @@ console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: a

6. Automatically Computed Capability & Risk Badges (Additive Multi-Badge)

After scanning each mod folder, the launcher computes capability badges automatically. Badges are additive, not mutually exclusive—for example, a mod with pack overlays and a server script displays both data and script, while official-map-selector displays data, gui, and script:

- +

7. Load Order Rules & Conflict Detection

- +
@@ -312,7 +316,7 @@ console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: a

1. 先懂概念:什么是 BLK?它为什么和 JSON 不一样?

Dagor 引擎使用自研的 BLK(DataBlock) 格式存储几乎所有游戏配置(在数据包内编译为紧凑二进制,解包后可读为文本 .blk)。初看很像 JSON,但它有三个关键差异:

  1. 每个参数都带显式静态类型后缀:例如 :i(32 位整数)、:r(单精度浮点)、:t(字符串)、:b(布尔 yes/no);把 :r 误写成 :i 会导致引擎读不到小数参数;
  2. 同一个块内允许出现多个同名参数:例如 slaveUnit:t="launcher_a" 下面紧跟第二行 slaveUnit:t="launcher_b"(如果直接转成普通 JSON 对象,前一行就会被后一行覆盖丢失!);
  3. 同一个父块下允许并列多个同名子块:最典型的就是科技树 shop.blk,每个陆军/空军分支下并列着好几个同名的 range { ... } 子块。
-

对比下面这段 8 行原版文本 .blk(节选自 wpcost.blk 的 us_m2a4)与对应的 .blk.patch.jsonc 增量补丁,你立刻就能看懂两者的对应关系:

+

对比下面这段 8 行原版文本 .blk(节选自 wpcost.blk 的 us_m2a4)与对应的 .blk.patch.blk 增量补丁,你立刻就能看懂两者的对应关系:

blk
// 原版可读文本 BLK(char.vromfs.bin -> config/wpcost.blk 节选)
 us_m2a4 {
   value:i = 0
@@ -322,38 +326,51 @@ us_m2a4 {
   country:t = "country_usa"
   unitClass:t = "exp_tank"
 }
-
jsonc
// 对应的增量补丁:client/packs/char.vromfs.bin/config/wpcost.blk.patch.jsonc
+
blk
// 对应的增量补丁(推荐格式):client/packs/char.vromfs.bin/config/wpcost.blk.patch.blk
 // 只修改 us_m2a4 的历史模式收益倍率,不会影响其他模组对别的字段或载具的改动
-{
-  "ops": [
-    {
-      "op": "setParam",
-      "path": ["us_m2a4"],
-      "name": "rewardMulHistorical",
-      "value": { "type": "real", "value": 1.2 }
-    }
-  ]
+"@override:us_m2a4" {
+  "@override:rewardMulHistorical":r = 1.2
 }

2. 支持叠加的 8 个客户端数据包

把文件按目标包路径放进 client/packs/<包路径>/ 下即可:

-
目标目录名常见内容备份方式
client/packs/char.vromfs.bin/config/shop.blk(科技树)、config/wpcost.blk(经济/权重/改装件)、config/unittags.blk、config/items.blk、config/modifications.blk常驻备份
client/packs/aces.vromfs.bin/gamedata/units/.../*.blk(载具模型/DM/炮塔)、gamedata/flightmodels/...(气动)、gamedata/weapons/...(武器/炮弹/导弹)、config/settings.blk常驻备份
client/packs/gui.vromfs.bin/新增独立 .nut 脚本、.tpl 模板、.css 样式(修改已有脚本/样式请看第 04 章 gui-patches)常驻备份
client/packs/lang.vromfs.bin/lang/units.csv、lang/menu.csv、lang/units_weaponry.csv 等本地化表按需自动备份,关闭还原
client/packs/mis.vromfs.bin/gamedata/missions/.../*.blk 联机/自定义任务按需自动备份,关闭还原
client/packs/game.vromfs.bin/danetlibs/...、game/... 脚本与配置按需自动备份,关闭还原
client/packs/ui/atlases.vromfs.bin/gameuiskin/<全小写载具id>_ico.svg(科技树与本地商城剪影图标)按需自动备份,关闭还原
client/packs/ui/images.vromfs.bin/units/<载具id>.ddsx 或 .png(资料卡/乘员栏载具图)按需自动备份,关闭还原
+
目标目录名常见内容备份方式
client/packs/char.vromfs.bin/config/shop.blk(科技树)、config/wpcost.blk(经济/权重/改装件)、config/unittags.blk、config/items.blk、config/modifications.blk常驻备份
client/packs/aces.vromfs.bin/gamedata/units/.../*.blk(载具模型/DM/炮塔)、gamedata/flightmodels/...(气动)、gamedata/weapons/...(武器/炮弹/导弹)、config/settings.blk常驻备份
client/packs/gui.vromfs.bin/新增独立 .nut 脚本、.tpl 模板、.css 样式(修改已有脚本/样式请看第 04 章 gui-patches)常驻备份
client/packs/lang.vromfs.bin/lang/units.csv、lang/menu.csv、lang/units_weaponry.csv 等本地化表按需自动备份,关闭还原
client/packs/mis.vromfs.bin/gamedata/missions/.../*.blk 联机/自定义任务按需自动备份,关闭还原
client/packs/game.vromfs.bin/danetlibs/...、game/... 脚本与配置按需自动备份,关闭还原
client/packs/ui/atlases.vromfs.bin/gameuiskin/<全小写载具id>_ico.svg(科技树与本地商城剪影图标)、units/<全小写载具id>.ddsx(默认乘员栏 DXT5 缩略图)按需自动备份,关闭还原
client/packs/ui/images.vromfs.bin/images/*.png / .avif / .ddsx(自定义界面图,或配合 wpcost.blk 的 customImage:t="!ui/images/..." / customTooltipImage:t="!ui/images/..." 直接使用 .png;注意 UI 不支持普通 .dds)按需自动备份,关闭还原

自动联动服务端:本地服务器在启动时直接读取叠加后的 .vromfs.bin。因此你通过补丁往 shop.blk / wpcost.blk 新增或修改载具后,服务端会自动识别新车价格、前置科技树、研发点、改装件、分房权重、AI 机器人池与礼包 GUID,无需手工同步两遍。


3. 包内文件的 3 种处理模式(按后缀自动识别)

构建器根据你在 client/packs/<包>/ 下放置的文件名自动决定处理方式:

-
  1. <原路径>.patch.jsonc → BLK 结构化增量补丁:解析目标 .blk 为保留完整类型的内存树,按 ops 逐条修改后重新编码为自包含二进制 BLK 写回;
  2. <原路径>.patch.csv → CSV 本地化增量合并:按第 1 列词条键合并进目标 .csv(已有键只更新你填写的语言列,新键追加到表尾);
  3. 其余文件(如 us_m2a4_mod_demo.blk、us_m2a4_mod_demo_ico.svg)→ 新增或替换文件: -
    • 如果路径以 .blk 结尾且你的源文件是可读文本 BLK(如从原版客户端解包修改得到的),构建器会自动将其编译为游戏引擎所需的二进制 BLK 写进包内;
    • 如果已经是二进制 BLK,或是 .svg / .ddsx / .nut / .tpl / .css,则原样写入包内。
+
  1. <原路径>.patch.blk(推荐)或 <原路径>.patch.jsonc → BLK 增量补丁:解析目标 .blk 为保留完整类型的内存树,按顺序应用补丁并重新编码为自包含二进制 BLK 写回。不同模组可对同一目标混用 .patch.blk 与 .patch.jsonc 并按加载顺序叠加;单个模组内对同一目标请二选一;
  2. <原路径>.patch.csv → CSV 本地化增量合并:按第 1 列词条键合并进目标 .csv(已有键只更新你填写的语言列,新键追加到表尾);
  3. 其余文件(如 us_m2a4_mod_demo.blk、us_m2a4_mod_demo_ico.svg)→ 新增或替换文件:
    • 如果路径以 .blk 结尾且你的源文件是可读文本 BLK,构建器会自动展开其中的 include / includeOnce 与 @override: / @delete: 等 Dagor 指令,并编译为游戏引擎所需的二进制 BLK 写进包内;
    • 如果已经是二进制 BLK,或是 .svg / .ddsx / .nut / .tpl / .css,则原样写入包内。

-

4. BLK 增量补丁(*.blk.patch.jsonc)完整手册

-

4.1 基本格式与路径寻址

+

4. BLK 增量补丁完整手册

+

构建器同时支持两套 BLK 增量补丁格式:

+
  • *.blk.patch.blk(首选推荐):Dagor 原生 BLK 语法,直接支持粘贴原版 BLK 子块、include 继承与 @override: / @delete: / @clone: 指令,写法最紧凑;
  • *.blk.patch.jsonc(向后兼容 / 脚本生成):结构化 JSONC 操作列表,适合自动化脚本生成与已有旧模组兼容。
+

4.1 Dagor 风格 BLK 增量补丁(*.blk.patch.blk)与 include 编译

+

所有语句严格按源码从上到下顺序执行,且在 *.blk.patch.blk 与新增文本 .blk 中语义完全统一(无前缀永远表示新增/追加,修改已有项显式使用 @ 指令)。

+
① 文件引入指令(include / includeOnce)
+
语法作用
include "germ_pzkpfw_maus.blk"在当前块位置读取并展开目标 .blk(相对当前文件在 pack 内的目录;也支持 ../、包根路径 /gamedata/...、#/gamedata/... 及战雷 CDK 路径 #/develop/gameBase/...)。
includeOnce "../common/smoke.blk"同 include,但在同一次编译链路中同一文件只展开一次。
+
  • include 会直接查找当前 pack 内存档案(包含原版文件与前置模组修改后的结果)以及同模组内其他待写入 .blk 文件,且自动检测循环引用;
  • 所有 @ 指令同时支持带引号("@override:model":t = "...")和不带引号(@override:model:t = "..."、@override:ikPilot { ... })两种战雷原生写法;
  • 非常适合基于原版载具派生新车,无需复制几千行原版 .blk:
+
blk
// client/packs/aces.vromfs.bin/gamedata/units/tankmodels/germ_pzkpfw_walross.blk
+include "germ_pzkpfw_maus.blk"
+"@override:model":t = "pzkpfw_VIII_walross"
+"@delete:commonWeapons" {}
+commonWeapons {
+  // 直接粘贴新的武器块即可
+}
+
② 参数(Param)指令
+
语法作用说明
slaveUnit:t = "extra"追加参数保留已有同名参数,适合可重复键
"@override:economicRankArcade":i = 18覆盖/设值存在则覆盖首个并去重,不存在则新增(注意数值 :i / :r 不要加引号)
"@override-last:slaveUnit":t = "new"覆盖末项只替换最后一个同名参数,不动前面同名项(不存在则追加)
"@delete:showOnlyWhenBought":b = no删除首个同名参数占位类型/值会被忽略,不存在则静默跳过
"@delete-last:slaveUnit":t = ""删除末项同名参数只删最后一个同名参数
"@delete-all:slaveUnit":t = ""删除全部同名参数清空当前块内全部同名参数
+
③ 子块(Block)指令
+
语法作用说明
Weapon { ... }新增子块追加同名子块(不会覆盖已有同名块)
"@override:us_m2a4" { ... }进入已有块修改支持 name[index](如 "@override:range[0]");不带索引且块不存在时自动新建
"@override-last:Weapon" { ... }进入末个同名块修改修改最后一个同名子块(不存在则新建)
"@replace:commonWeapons" { ... }原地整块替换原地替换为全新子块(保持原本排序位置);支持 name[index]
"@delete:commonWeapons" {}删除首个匹配子块支持 name[index];花括号必须为空
"@delete-last:Weapon" {}删除末个同名子块只删最后一个同名子块;花括号必须为空
"@delete-all:Weapon" {}删除全部同名子块清空全部同名子块;花括号必须为空
"@clone:Weapon" { ... } / "@clone-last:Weapon" { ... }同名克隆深拷贝首个/末个同名子块并追加,在花括号内微调
"@clone:us_m2a4->us_m2a4_mod" { ... }改名克隆深拷贝源块(支持 a/b/src 相对路径与 /root/src 根路径)为新名(若目标已存在则原地替换),并在花括号内微调
"@inherit:base_weapon" {}块内继承将同级或根级模板块的内容拷入当前块(花括号内可继续写覆写语句)
"@after:<锚点>:<新块名>" { ... } / "@before:<锚点>:<新块名>" { ... }科技树锚点插队插在指定兄弟块之后/之前(锚点支持 name[index];也可写 "@after:us_m2a4:@clone:us_m2a4->new_tank")
+

拼写保护与转义:任何未注册的 "@xxx:..." 前缀都会直接报带行号的错误(防止拼错指令被静默写入二进制);若极少数情况需要字面量以 @ 开头,可用 @@ 转义为单个 @。

+
+

4.2 JSONC 结构化增量补丁(*.blk.patch.jsonc,兼容与脚本生成格式)

+
基本格式与路径寻址
jsonc
{
   "ops": [
     // 按顺序执行的操作列表
   ]
 }
  • path 是从 BLK 根节点出发的子块名数组,例如 ["country_usa", "army", "range[0]"];
  • 同名并列子块(如 shop.blk 里连续多个 range 块)可以用 名称[索引](0 起始)精确定位;不写索引默认命中第 0 个同名子块;
  • [] 表示当前文档根节点本身。
-

4.2 全部 7 种操作(op)

+
全部 7 种操作(op)
① setParam:设置参数(存在则覆盖并去重同名项,不存在则新增)

修改已有块上的单个字段时,永远优先用 setParam:

jsonc
{
@@ -433,7 +450,7 @@ us_m2a4 {
 
mrank面板 BRmrank面板 BRmrank面板 BRmrank面板 BR
01.0104.3207.73011.0
11.3114.7218.03111.3
21.7125.0228.33211.7
32.0135.3238.73312.0
42.3145.7249.03412.3
52.7156.0259.33512.7
63.0166.3269.73613.0
73.3176.72710.03713.3
83.7187.02810.33813.7
94.0197.32910.73914.0

5.2 wpcost.blk 模式后缀与科技树等级 rank 的区别

战雷沿用了远古内测时期的模式英文名,千万不要把科技树大等级 rank 和分房权重 economicRank* 搞混:

-
字段名取值范围真实含义
rank1 .. 8科技树时代等级(Rank I – VIII):决定它在科技树第几大行、受哪一级的开线数量门槛限制,以及默认套用哪一档商店礼包价格
economicRankArcade0 .. 39+街机娱乐(AB, Arcade Battles) 的分房 mrank
economicRankHistorical0 .. 39+历史性能(RB, Realistic Battles) 的默认分房 mrank(战雷早期将历史模式称为 *Historical Battles*)
economicRankSimulation0 .. 39+全真模拟(SB, Simulator Battles) 的默认分房 mrank
economicRankTankHistorical0 .. 39+(可选)飞机/直升机进入陆战历史(Ground RB)时的独立对地分房权重;不填时沿用 economicRankHistorical
economicRankTankSimulation0 .. 39+(可选)飞机/直升机进入陆战全真(Ground SB)时的独立分房权重
+
字段名取值范围真实含义
rank1 .. 8科技树时代等级(Rank I – VIII):决定它在科技树第几大行、受哪一级的开线数量门槛限制,以及默认套用哪一档商店礼包价格
economicRankArcade0 .. 39+街机娱乐(AB, Arcade Battles) 的分房 mrank
economicRankHistorical0 .. 39+历史性能(RB, Realistic Battles) 的默认分房 mrank(战雷早期将历史模式称为 Historical Battles)
economicRankSimulation0 .. 39+全真模拟(SB, Simulator Battles) 的默认分房 mrank
economicRankTankHistorical0 .. 39+(可选)飞机/直升机进入**陆战历史(Ground RB)**时的独立对地分房权重;不填时沿用 economicRankHistorical
economicRankTankSimulation0 .. 39+(可选)飞机/直升机进入**陆战全真(Ground SB)**时的独立分房权重

6. shop.blk 科技树结构与 units.csv 四大词条后缀详解

6.1 config/shop.blk 的四层树状结构

@@ -444,9 +461,9 @@ us_m2a4 { ├─ range { ... } <-- range[1]:科技树第 2 纵列(如美系中坦线,内部含折叠组 us_sherman_group) ├─ range { ... } <-- range[2]..range[4]:其余常规银狮研发纵列 └─ range { ... } <-- range[5]..range[6]:右侧金币车 / 礼包车 / 活动车 / 联队车独立纵列
-

编写 shop.blk.patch.jsonc 时只需记住三条核心规则:

-
  1. 每个 range 就是科技树上的一条纵向列:因为它们都叫 range,在补丁 path 里用 "range[0]"、"range[1]"、"range[5]" 按从左到右(0 起始)定位;
  2. 折叠文件夹(*_group):当同一格折叠了多辆同系载具时,range 下会放一个以 _group 结尾的子块(例如 us_sherman_group),里面再嵌套各辆具体载具子块,折叠封面标题来自 units.csv 的 shop/group/<组名>;
  3. 为什么坦克和军舰的前置研发箭头也叫 reqAir? 因为《战争雷霆》最早立项时是纯空战游戏(*World of Planes*),所有载具在底层代码里都沿用了 air / aircraft 命名,因此无论是坦克、直升机还是战列舰,指定“上一辆前置研发载具”的字段一律叫 reqAir! -
    • 在 wpcost.blk 中设置 reqAir:t="us_m2a4":声明玩家必须先拥有 us_m2a4 才能研发本车;
    • 在 shop.blk 的同一 range 列中:连续排列且未写 reqAir 的两辆车默认自动画纵向实线箭头;写 reqAir:t="us_m2a4" 会显式从 us_m2a4 连出箭头;而写 reqAir:t=""(空字符串)则会显式断开与上方载具的箭头连接(科技树断线处以及右侧金币/礼包列里的车都用 reqAir:t="")。
+

编写 shop.blk.patch.blk(或 .patch.jsonc)时只需记住三条核心规则:

+
  1. 每个 range 就是科技树上的一条纵向列:因为它们都叫 range,在补丁 path 里用 "range[0]"、"range[1]"、"range[5]" 按从左到右(0 起始)定位;
  2. 折叠文件夹(*_group):当同一格折叠了多辆同系载具时,range 下会放一个以 _group 结尾的子块(例如 us_sherman_group),里面再嵌套各辆具体载具子块,折叠封面标题来自 units.csv 的 shop/group/<组名>;
  3. 为什么坦克和军舰的前置研发箭头也叫 reqAir? +因为《战争雷霆》最早立项时是纯空战游戏(World of Planes),所有载具在底层代码里都沿用了 air / aircraft 命名,因此无论是坦克、直升机还是战列舰,指定“上一辆前置研发载具”的字段一律叫 reqAir!
    • 在 wpcost.blk 中设置 reqAir:t="us_m2a4":声明玩家必须先拥有 us_m2a4 才能研发本车;
    • 在 shop.blk 的同一 range 列中:连续排列且未写 reqAir 的两辆车默认自动画纵向实线箭头;写 reqAir:t="us_m2a4" 会显式从 us_m2a4 连出箭头;而写 reqAir:t=""(空字符串)则会显式断开与上方载具的箭头连接(科技树断线处以及右侧金币/礼包列里的车都用 reqAir:t="")。

6.2 lang/units.csv 的 4 个载具译名后缀与 CSV 增量合并

在 client/packs/lang.vromfs.bin/lang/units.csv.patch.csv 中为新载具添加译名时,每辆载具 <id> 共有 4 个标准词条键,分别对应不同界面与视距:

词条键格式游戏内显示位置示例(以 us_m2a4_mod_demo 为例)
<id>_shop科技树格子、底部乘员槽位、本地网页商店卡片上的简短名称"M2A4 (Mod Demo)" / "M2A4(教学改型)"
<id>_0资料卡顶部标题、研发完成弹窗、战后结算详单里的完整正式全称"Light Tank M2A4 (Mod Demo)" / "M2A4 轻型坦克(教学改型)"
<id>_1战斗中中距离 3D 视野目标标记上显示的中等长度名称"M2A4 Demo" / "M2A4 教学型"
<id>_2战斗中远距离目标标记 / 极简击杀播报显示的超短型号或车种名"M2A4" / "M2A4"
@@ -458,18 +475,11 @@ us_m2a4 { "us_m2a4_mod_demo_2";"M2A4";"M2A4";"M2A4"

-

7. 修改游戏根目录 config.blk(client/config-blk.patch.jsonc)

-

如果模组需要调整游戏根目录的 config.blk(例如开启音效模组开关 sound{ enable_mod:b=yes } 或指定自定义机库 hangarBlk:t="..."),放一份标准 BLK 补丁到 client/config-blk.patch.jsonc 即可:

-
jsonc
{
-  "ops": [
-    {
-      "op": "setParam",
-      "path": ["sound"],
-      "name": "enable_mod",
-      "value": { "type": "bool", "value": true },
-      "createBlocks": true
-    }
-  ]
+

7. 修改游戏根目录 config.blk(client/config-blk.patch.blk / .jsonc)

+

如果模组需要调整游戏根目录的 config.blk(例如开启音效模组开关 sound{ enable_mod:b=yes } 或指定自定义机库 hangarBlk:t="..."),放一份 BLK 补丁到 client/config-blk.patch.blk(推荐,同样兼容 client/config-blk.patch.jsonc)即可:

+
blk
// client/config-blk.patch.blk
+"@override:sound" {
+  "@override:enable_mod":b = yes
 }

启动器会在首次修改前自动将原版 config.blk 备份到 wtoffline/stock/config.blk,关闭相关模组后自动还原。


@@ -483,12 +493,12 @@ us_m2a4 { └─ packs/ ├─ aces.vromfs.bin/ │ └─ gamedata/units/tankmodels/ - │ └─ us_m2a4_mod_demo.blk # ① 载具物理/装甲/武器定义(基于原版 us_m2a4.blk 修改) + │ └─ us_m2a4_mod_demo.blk # ① 通过 include 继承原版 us_m2a4.blk 并调高极速 ├─ char.vromfs.bin/ │ └─ config/ - │ ├─ wpcost.blk.patch.jsonc # ② 克隆经济、分房权重、改装件与弹药架 - │ ├─ shop.blk.patch.jsonc # ③ 挂入美系陆军第 1 列 I 级科技树 - │ └─ unittags.blk.patch.jsonc # ④ 克隆载具分类标签与试车场配置 + │ ├─ wpcost.blk.patch.blk # ② 克隆经济、分房权重、改装件与弹药架 + │ ├─ shop.blk.patch.blk # ③ 挂入美系陆军第 1 列 I 级科技树 + │ └─ unittags.blk.patch.blk # ④ 克隆载具分类标签与试车场配置 └─ lang.vromfs.bin/ └─ lang/ └─ units.csv.patch.csv # ⑤ 注册 _shop / _0 / _1 / _2 中英文名称
@@ -511,65 +521,37 @@ us_m2a4 { "game_versions": ["2.61.0.*"] }
① 载具实体参数 client/packs/aces.vromfs.bin/gamedata/units/tankmodels/us_m2a4_mod_demo.blk
-

按第 01 章第 2 节任一方式取出原版 aces.vromfs.bin 中的 gamedata/units/tankmodels/us_m2a4.blk(文本或二进制均可),另存为 us_m2a4_mod_demo.blk。保持顶部的 model:t="m2a4" 不变(这样它会直接复用原版 M2A4 的 3D 模型和贴图),把里面的最大前进速度和加速改快即可(文本 .blk 在构建时会自动编译为二进制 .blk):

-
blk
model:t="m2a4"
-// ...(保留原版 us_m2a4.blk 其余内容不变,仅调高以下机动参数体验效果)...
-maxFwdSpeed:r=90.0
-maxRevSpeed:r=25.0
-maxAccel:r=12.0
-
② 经济与权重补丁 client/packs/char.vromfs.bin/config/wpcost.blk.patch.jsonc
-

用 cloneBlock 一键复制 us_m2a4(自动继承全部武器、弹种、改装件与备用车配置),并把研发前提设为 us_m2a4、研发点设为 1000、银狮价格设为 500、三模式分房权重设为 1(即面板 1.3):

-
jsonc
{
-  "ops": [
-    {
-      "op": "cloneBlock",
-      "from": ["us_m2a4"],
-      "toParent": [],
-      "newName": "us_m2a4_mod_demo",
-      "replaceExisting": true,
-      "ops": [
-        { "op": "setParam", "path": [], "name": "reqAir", "value": "us_m2a4" },
-        { "op": "setParam", "path": [], "name": "reqExp", "value": { "type": "int", "value": 1000 } },
-        { "op": "setParam", "path": [], "name": "value", "value": { "type": "int", "value": 500 } },
-        { "op": "setParam", "path": [], "name": "economicRank", "value": { "type": "int", "value": 1 } },
-        { "op": "setParam", "path": [], "name": "economicRankArcade", "value": { "type": "int", "value": 1 } },
-        { "op": "setParam", "path": [], "name": "economicRankHistorical", "value": { "type": "int", "value": 1 } },
-        { "op": "setParam", "path": [], "name": "economicRankSimulation", "value": { "type": "int", "value": 1 } }
-      ]
-    }
-  ]
+

直接用 include "us_m2a4.blk" 继承原版 aces.vromfs.bin 中的同目录 us_m2a4.blk(无需手工解包复制几千行原版文件),只用 @override: 调高最大前进速度和加速(构建时会自动展开并编译为二进制 .blk):

+
blk
include "us_m2a4.blk"
+"@override:maxFwdSpeed":r = 90.0
+"@override:maxRevSpeed":r = 25.0
+"@override:maxAccel":r = 12.0
+
② 经济与权重补丁 client/packs/char.vromfs.bin/config/wpcost.blk.patch.blk
+

用 @clone: 一键复制 us_m2a4(自动继承全部武器、弹种、改装件与备用车配置),并把研发前提设为 us_m2a4、研发点设为 1000、银狮价格设为 500、三模式分房权重设为 1(即面板 1.3):

+
blk
"@clone:us_m2a4->us_m2a4_mod_demo" {
+  "@override:reqAir":t = "us_m2a4"
+  "@override:reqExp":i = 1000
+  "@override:value":i = 500
+  "@override:economicRank":i = 1
+  "@override:economicRankArcade":i = 1
+  "@override:economicRankHistorical":i = 1
+  "@override:economicRankSimulation":i = 1
 }
-
③ 科技树位置补丁 client/packs/char.vromfs.bin/config/shop.blk.patch.jsonc
-

在 country_usa -> army -> range[0] 的 I 级段末尾(us_m3a1_stuart 之后、us_m5a1_stuart 断线之前)插入新车块,并显式声明 reqAir: "us_m2a4",游戏就会在不打断原有斯图亚特研发线的前提下,从 M2A4 连出一条侧支研发箭头指向你的新车:

-
jsonc
{
-  "ops": [
-    {
-      "op": "addBlock",
-      "path": ["country_usa", "army", "range[0]"],
-      "name": "us_m2a4_mod_demo",
-      "after": "us_m3a1_stuart",
-      "block": {
-        "params": [
-          { "name": "rank", "value": { "type": "int", "value": 1 } },
-          { "name": "reqAir", "value": "us_m2a4" }
-        ]
+
③ 科技树位置补丁 client/packs/char.vromfs.bin/config/shop.blk.patch.blk
+

在 country_usa -> army -> range[0] 的 I 级段末尾(us_m3a1_stuart 之后、us_m5a1_stuart 断线之前)插入新车块,并显式声明 reqAir:t = "us_m2a4",游戏就会在不打断原有斯图亚特研发线的前提下,从 M2A4 连出一条侧支研发箭头指向你的新车:

+
blk
"@override:country_usa" {
+  "@override:army" {
+    "@override:range[0]" {
+      "@after:us_m3a1_stuart:us_m2a4_mod_demo" {
+        rank:i = 1
+        reqAir:t = "us_m2a4"
       }
     }
-  ]
-}
-
④ 载具标签与试驾场补丁 client/packs/char.vromfs.bin/config/unittags.blk.patch.jsonc
-

同样用 cloneBlock 从 us_m2a4 克隆出 type:t="tank"、机库车位 hangar_place:t="tank"、陆战试车场 testFlight 与轻坦标签:

-
jsonc
{
-  "ops": [
-    {
-      "op": "cloneBlock",
-      "from": ["us_m2a4"],
-      "toParent": [],
-      "newName": "us_m2a4_mod_demo",
-      "replaceExisting": true
-    }
-  ]
+  }
 }
+
④ 载具标签与试驾场补丁 client/packs/char.vromfs.bin/config/unittags.blk.patch.blk
+

同样用 @clone: 从 us_m2a4 克隆出 type:t="tank"、机库车位 hangar_place:t="tank"、陆战试车场 testFlight 与轻坦标签:

+
blk
"@clone:us_m2a4->us_m2a4_mod_demo" {}
⑤ 多语言名称补丁 client/packs/lang.vromfs.bin/lang/units.csv.patch.csv

直接复用上面第 6.2 节的 4 行 CSV 内容即可。保存后在启动器勾选启用模组并启动游戏,切到美国陆军科技树 I 级,就能看到 M2A4(教学改型) 并立刻右键「试驾」体验 90 km/h 飙车!

@@ -578,9 +560,9 @@ maxAccel:r=12.0

Most War Thunder data mods—tweaking vehicle performance, shell penetration, missile maneuverability, tech-tree layouts, Silver Lion / Research Point prices, Battle Ratings, localized names, and vehicle icons—live inside .vromfs.bin data packs. This chapter explains how to modify those packs in a 100% stackable, conflict-free way, ending with a copy-pasteable walkthrough that clones a playable standalone tank into the US Rank I tech tree.


1. Plain-Language Intro: What Is BLK & Why Does It Differ from JSON?

-

War Thunder's Dagor Engine stores nearly all game configurations in BLK (DataBlock) files—compiled to compact binary inside .vromfs.bin packs, and readable as plain text .blk when unpacked. While text BLK looks superficially similar to JSON, it differs in three fundamental ways:

+

War Thunder's Dagor Engine stores nearly all game configurations in BLK (DataBlock) files—compiled to compact binary inside .vromfs.bin packs, and readable as plain text .blk when unpacked. While text BLK looks superficially similar to JSON, it differs in three fundamental ways:

  1. Every parameter carries an explicit static type suffix: such as :i (32-bit integer), :r (32-bit float), :t (string), or :b (boolean yes/no). Writing :i where the engine expects :r causes the engine to ignore decimal values;
  2. Duplicate parameter names are allowed inside the same block: for instance, slaveUnit:t="launcher_a" followed immediately by slaveUnit:t="launcher_b" (converting naively to a plain JSON object would overwrite the first key!);
  3. Duplicate sibling block names are allowed under the same parent: most notably in shop.blk, where every army/aviation branch contains multiple sibling range { ... } blocks side by side.
-

Compare this 8-line stock text .blk excerpt (us_m2a4 in wpcost.blk) side by side with its .blk.patch.jsonc patch operation:

+

Compare this 8-line stock text .blk excerpt (us_m2a4 in wpcost.blk) side by side with its .blk.patch.blk incremental patch:

blk
// Stock readable text BLK (excerpt from char.vromfs.bin -> config/wpcost.blk)
 us_m2a4 {
   value:i = 0
@@ -590,38 +572,51 @@ us_m2a4 {
   country:t = "country_usa"
   unitClass:t = "exp_tank"
 }
-
jsonc
// Matching incremental patch: client/packs/char.vromfs.bin/config/wpcost.blk.patch.jsonc
+
blk
// Matching incremental patch (recommended): client/packs/char.vromfs.bin/config/wpcost.blk.patch.blk
 // Touches ONLY us_m2a4's Realistic reward multiplier without clobbering other fields or other mods!
-{
-  "ops": [
-    {
-      "op": "setParam",
-      "path": ["us_m2a4"],
-      "name": "rewardMulHistorical",
-      "value": { "type": "real", "value": 1.2 }
-    }
-  ]
+"@override:us_m2a4" {
+  "@override:rewardMulHistorical":r = 1.2
 }

2. The 8 Overlayable Client Data Packs

-

Place your files under client/packs/<pack-path>/ matching the target archive's internal path:

-
Target DirectoryCommon ContentsBackup Strategy
client/packs/char.vromfs.bin/config/shop.blk (tech tree), config/wpcost.blk (economy/BR/modifications), config/unittags.blk, config/items.blk, config/modifications.blkAlways rebuilt from stock
client/packs/aces.vromfs.bin/gamedata/units/.../*.blk (vehicle models/DM/turrets), gamedata/flightmodels/... (FMs), gamedata/weapons/... (guns/shells/missiles), config/settings.blkAlways rebuilt from stock
client/packs/gui.vromfs.bin/New standalone .nut scripts, .tpl templates, .css stylesheets (to edit stock UI files, see Chapter 04 gui-patches)Always rebuilt from stock
client/packs/lang.vromfs.bin/lang/units.csv, lang/menu.csv, lang/units_weaponry.csv, and other localization CSVsBacked up on demand, restored on disable
client/packs/mis.vromfs.bin/gamedata/missions/.../*.blk multiplayer and custom missionsBacked up on demand, restored on disable
client/packs/game.vromfs.bin/danetlibs/..., game/... scripts and configsBacked up on demand, restored on disable
client/packs/ui/atlases.vromfs.bin/gameuiskin/<lowercase_unit_id>_ico.svg (tech-tree & local web store silhouette icons)Backed up on demand, restored on disable
client/packs/ui/images.vromfs.bin/units/<unit_id>.ddsx or .png (stat-card / crew-slot vehicle images)Backed up on demand, restored on disable
+

Place your files under client/packs/<pack-path>/ matching the target archive's internal path:

+
Target DirectoryCommon ContentsBackup Strategy
client/packs/char.vromfs.bin/config/shop.blk (tech tree), config/wpcost.blk (economy/BR/modifications), config/unittags.blk, config/items.blk, config/modifications.blkAlways rebuilt from stock
client/packs/aces.vromfs.bin/gamedata/units/.../*.blk (vehicle models/DM/turrets), gamedata/flightmodels/... (FMs), gamedata/weapons/... (guns/shells/missiles), config/settings.blkAlways rebuilt from stock
client/packs/gui.vromfs.bin/New standalone .nut scripts, .tpl templates, .css stylesheets (to edit stock UI files, see Chapter 04 gui-patches)Always rebuilt from stock
client/packs/lang.vromfs.bin/lang/units.csv, lang/menu.csv, lang/units_weaponry.csv, and other localization CSVsBacked up on demand, restored on disable
client/packs/mis.vromfs.bin/gamedata/missions/.../*.blk multiplayer and custom missionsBacked up on demand, restored on disable
client/packs/game.vromfs.bin/danetlibs/..., game/... scripts and configsBacked up on demand, restored on disable
client/packs/ui/atlases.vromfs.bin/gameuiskin/<lowercase_unit_id>_ico.svg (tech-tree & local web store silhouette icons), units/<lowercase_unit_id>.ddsx (default DXT5 crew-slot portrait)Backed up on demand, restored on disable
client/packs/ui/images.vromfs.bin/images/*.png / .avif / .ddsx (custom UI images, or vehicle portraits via wpcost.blk customImage:t="!ui/images/..." / customTooltipImage:t="!ui/images/..."; note: plain .dds is not supported by UI PictureManager)Backed up on demand, restored on disable

Automatic Server Sync: The local server reads static datasets directly from the overlaid .vromfs.bin packs on startup. Any vehicle added or tweaked in shop.blk / wpcost.blk is automatically picked up for prices, tech-tree prerequisites, Research Points, modifications, Battle Ratings, AI bot pools, and store pack GUIDs—no duplicate server registration needed.


3. Three File Handling Modes Inside Packs (Auto-Detected by Suffix)

The patcher determines how to process each file under client/packs/<pack>/ by its filename suffix:

-
  1. <target-path>.patch.jsonc → Structured Incremental BLK Patch: decodes the target .blk into a type-preserving tree, applies ops in order, and re-encodes a self-contained binary BLK;
  2. <target-path>.patch.csv → Incremental Localization CSV Merge: merges rows by column 0 (updating only the non-empty language columns you provide on existing keys, and appending new keys at the end);
  3. Any other file (e.g. us_m2a4_mod_demo.blk, us_m2a4_mod_demo_ico.svg) → Add or Replace File: -
    • If the path ends with .blk and your source file is plain text BLK (for example, extracted and edited from your stock client), the builder automatically compiles it into binary BLK for the engine;
    • Binary .blk files and other assets (.svg, .ddsx, .nut, .tpl, .css) are written into the archive as-is.
+
  1. <target-path>.patch.blk (Recommended) or <target-path>.patch.jsonc → Incremental BLK Patch: decodes the target .blk into a type-preserving tree, applies the patch in order, and re-encodes a self-contained binary BLK. Different mods may mix .patch.blk and .patch.jsonc on the same target and stack cleanly; within a single mod, pick one format per target file;
  2. <target-path>.patch.csv → Incremental Localization CSV Merge: merges rows by column 0 (updating only the non-empty language columns you provide on existing keys, and appending new keys at the end);
  3. Any other file (e.g. us_m2a4_mod_demo.blk, us_m2a4_mod_demo_ico.svg) → Add or Replace File:
    • If the path ends with .blk and your source file is plain text BLK, the builder automatically expands include / includeOnce and Dagor @override: / @delete: directives and compiles it into binary BLK for the engine;
    • Binary .blk files and other assets (.svg, .ddsx, .nut, .tpl, .css) are written into the archive as-is.

-

4. Complete BLK Incremental Patch (*.blk.patch.jsonc) Reference

-

4.1 Document Format & Path Addressing

+

4. Complete BLK Incremental Patch Reference

+

Two incremental BLK patch formats are supported:

+
  • *.blk.patch.blk (Recommended): native Dagor BLK syntax with include, @override:, @delete:, and @clone:—compact and lets you paste stock BLK blocks directly;
  • *.blk.patch.jsonc (Compatible / Programmatic): structured JSONC op list, kept for backwards compatibility and automated generators.
+

4.1 Dagor-Style BLK Patches (*.blk.patch.blk) & include Compilation

+

Statements execute strictly top-to-bottom in source order, with identical rules in both *.blk.patch.blk and standalone text .blk files (unprefixed items always append/add; modifying existing items explicitly uses @ directives).

+
① File Inheritance (include / includeOnce)
+
SyntaxBehavior
include "germ_pzkpfw_maus.blk"Loads and expands the target .blk into the current block (resolved relative to the current pack directory; supports ../, /gamedata/..., #/gamedata/..., and War Thunder CDK #/develop/gameBase/...).
includeOnce "../common/smoke.blk"Same as include, but expands a given normalized path at most once per compilation.
+
  • include resolves against the live in-memory pack archive (stock files + earlier mods) as well as sibling .blk files in the same mod, with automatic circular-include detection;
  • All @ directives accept both quoted ("@override:model":t = "...") and unquoted (@override:model:t = "...", @override:ikPilot { ... }) Dagor syntax;
  • Ideal for derived vehicles without copying thousands of stock lines:
+
blk
// client/packs/aces.vromfs.bin/gamedata/units/tankmodels/germ_pzkpfw_walross.blk
+include "germ_pzkpfw_maus.blk"
+"@override:model":t = "pzkpfw_VIII_walross"
+"@delete:commonWeapons" {}
+commonWeapons {
+  // Paste new weapon blocks directly here
+}
+
② Parameter Directives
+
SyntaxBehaviorNotes
slaveUnit:t = "extra"Append paramPreserves existing same-named params (for repeated keys)
"@override:economicRankArcade":i = 18Set / overwriteReplaces first match and deduplicates, or appends if absent (do not quote :i / :r numbers)
"@override-last:slaveUnit":t = "new"Overwrite last matchReplaces only the last same-named param without touching earlier entries (appends if absent)
"@delete:showOnlyWhenBought":b = noDelete first matching paramDummy type/value is ignored; no-op if absent
"@delete-last:slaveUnit":t = ""Delete last matching paramRemoves only the last same-named param
"@delete-all:slaveUnit":t = ""Delete all matching paramsRemoves every param with that name in the current block
+
③ Block Directives
+
SyntaxBehaviorNotes
Weapon { ... }Add child blockAppends a new sibling block without clobbering existing same-named blocks
"@override:us_m2a4" { ... }Edit existing blockSupports name[index] (e.g. "@override:range[0]"); creates the block when absent without an index
"@override-last:Weapon" { ... }Edit last matching blockEdits the last sibling with that name (creates if absent)
"@replace:commonWeapons" { ... }Replace block in placeReplaces the matched block in place (preserving sibling order); supports name[index]
"@delete:commonWeapons" {}Delete first matching blockSupports name[index]; body must be empty
"@delete-last:Weapon" {}Delete last matching blockRemoves only the last sibling with that name; body must be empty
"@delete-all:Weapon" {}Delete all same-named blocksRemoves all sibling blocks with that name; body must be empty
"@clone:Weapon" { ... } / "@clone-last:Weapon" { ... }Same-name cloneDeep-clones the first/last sibling with that name, appends it, and applies body edits
"@clone:us_m2a4->us_m2a4_mod" { ... }Clone under new nameDeep-clones source (supports relative a/b/src or root /src) into newName (replacing existing newName in place) and applies body edits
"@inherit:base_weapon" {}Inherit into blockCopies params/blocks from a sibling or root template block into the current block (optional body applies overrides)
"@after:<anchor>:<newName>" { ... } / "@before:<anchor>:<newName>" { ... }Anchored insertionInserts right after/before a sibling anchor (supports anchor[index] and @clone:src->dst as target)
+

Typo Guard & Escaping: Any unknown "@xxx:..." prefix fails immediately with a line number so misspelled directives are never silently baked into binary BLKs. Use @@ to escape a literal leading @.

+
+

4.2 Structured JSONC Patches (*.blk.patch.jsonc, Backwards-Compatible Format)

+
Document Format & Path Addressing
jsonc
{
   "ops": [
     // Ordered list of patch operations
   ]
 }
  • path is an array of child block names starting from the BLK root, e.g. ["country_usa", "army", "range[0]"];
  • Duplicate sibling blocks (such as consecutive range blocks in shop.blk) can be addressed precisely with name[index] (zero-based); omitting [index] selects occurrence 0;
  • [] refers to the root block of the current document.
-

4.2 All 7 Patch Operations (op)

+
All 7 Patch Operations (op)
① setParam: Set a parameter (overwrites & deduplicates same-named params if present; appends if absent)

Always prefer setParam when updating a single parameter on an existing block:

jsonc
{
@@ -701,20 +696,20 @@ us_m2a4 {
 
mrankDisplayed BRmrankDisplayed BRmrankDisplayed BRmrankDisplayed BR
01.0104.3207.73011.0
11.3114.7218.03111.3
21.7125.0228.33211.7
32.0135.3238.73312.0
42.3145.7249.03412.3
52.7156.0259.33512.7
63.0166.3269.73613.0
73.3176.72710.03713.3
83.7187.02810.33813.7
94.0197.32910.73914.0

5.2 Legacy Mode Suffixes in wpcost.blk vs Tech-Tree Tier rank

War Thunder retains internal field names from its alpha era—be careful not to confuse tech-tree tier rank with matchmaking BR economicRank*:

-
Field NameValue RangeMeaning
rank1 .. 8Tech-Tree Era Tier (Rank I – VIII): controls which horizontal tier row the vehicle occupies, tier unlock gates, and default store rank-tier pricing
economicRankArcade0 .. 39+Arcade Battles (AB) matchmaking mrank
economicRankHistorical0 .. 39+Realistic Battles (RB) default matchmaking mrank (RB was originally called *Historical Battles*)
economicRankSimulation0 .. 39+Simulator Battles (SB) default matchmaking mrank
economicRankTankHistorical0 .. 39+*(Optional)* Split Ground RB mrank for aircraft/helicopters with separate air vs ground BRs; falls back to economicRankHistorical when omitted
economicRankTankSimulation0 .. 39+*(Optional)* Split Ground SB mrank for aircraft/helicopters
+
Field NameValue RangeMeaning
rank1 .. 8Tech-Tree Era Tier (Rank I – VIII): controls which horizontal tier row the vehicle occupies, tier unlock gates, and default store rank-tier pricing
economicRankArcade0 .. 39+Arcade Battles (AB) matchmaking mrank
economicRankHistorical0 .. 39+Realistic Battles (RB) default matchmaking mrank (RB was originally called Historical Battles)
economicRankSimulation0 .. 39+Simulator Battles (SB) default matchmaking mrank
economicRankTankHistorical0 .. 39+(Optional) Split Ground RB mrank for aircraft/helicopters with separate air vs ground BRs; falls back to economicRankHistorical when omitted
economicRankTankSimulation0 .. 39+(Optional) Split Ground SB mrank for aircraft/helicopters

6. shop.blk Anatomy & units.csv Localization Suffixes

6.1 The 4-Level Hierarchy of config/shop.blk

-

Inside char.vromfs.bin, config/shop.blk organizes every nation's research tree into a uniform 4-level hierarchy:

+

Inside char.vromfs.bin, config/shop.blk organizes every nation's research tree into a uniform 4-level hierarchy:

text
country_usa (or country_germany / country_ussr / country_britain / country_japan / country_china / ...)
  └─ army | helicopters | aviation | ships | boats
      ├─ range { ... }       <-- range[0]: 1st vertical column (e.g. US Light Tank line)
      ├─ range { ... }       <-- range[1]: 2nd vertical column (e.g. US Medium Tank line, containing folder us_sherman_group)
      ├─ range { ... }       <-- range[2]..range[4]: remaining regular Silver Lions research columns
      └─ range { ... }       <-- range[5]..range[6]: right-hand Golden Eagle / Pack / Event / Squadron columns
-

Keep three rules in mind when writing shop.blk.patch.jsonc:

-
  1. Each sibling range block is one vertical column in the tech tree: since every column block is named range, address them left-to-right (zero-based) as "range[0]", "range[1]", "range[5]", etc.;
  2. Collapsible folder groups (*_group): when multiple variants share one tech-tree folder, range contains a child block ending in _group (e.g. us_sherman_group) whose children are the grouped vehicles; the folder's display label comes from shop/group/<group_name> in units.csv;
  3. Why is the prerequisite arrow field named reqAir even on tanks and ships? War Thunder began life as an aviation-only game (*World of Planes*), so air / aircraft remained the universal internal noun for any unit. Consequently, reqAir defines the research prerequisite vehicle across tanks, helicopters, aircraft, and ships alike! -
    • Setting reqAir:t="us_m2a4" in wpcost.blk requires owning us_m2a4 before researching the unit;
    • Inside a range column in shop.blk: consecutive vehicles with no reqAir property automatically connect with vertical arrows; reqAir:t="us_m2a4" draws an explicit arrow from us_m2a4; and reqAir:t="" (empty string) explicitly breaks the arrow from the vehicle above it (used at mid-column gaps and throughout the right-hand premium/pack columns).
+

Keep three rules in mind when writing shop.blk.patch.blk (or .patch.jsonc):

+
  1. Each sibling range block is one vertical column in the tech tree: since every column block is named range, address them left-to-right (zero-based) as "range[0]", "range[1]", "range[5]", etc.;
  2. Collapsible folder groups (*_group): when multiple variants share one tech-tree folder, range contains a child block ending in _group (e.g. us_sherman_group) whose children are the grouped vehicles; the folder's display label comes from shop/group/<group_name> in units.csv;
  3. Why is the prerequisite arrow field named reqAir even on tanks and ships? +War Thunder began life as an aviation-only game (World of Planes), so air / aircraft remained the universal internal noun for any unit. Consequently, reqAir defines the research prerequisite vehicle across tanks, helicopters, aircraft, and ships alike!
    • Setting reqAir:t="us_m2a4" in wpcost.blk requires owning us_m2a4 before researching the unit;
    • Inside a range column in shop.blk: consecutive vehicles with no reqAir property automatically connect with vertical arrows; reqAir:t="us_m2a4" draws an explicit arrow from us_m2a4; and reqAir:t="" (empty string) explicitly breaks the arrow from the vehicle above it (used at mid-column gaps and throughout the right-hand premium/pack columns).

6.2 All 4 lang/units.csv Keys & Incremental CSV Merging

When localizing a vehicle <id> in client/packs/lang.vromfs.bin/lang/units.csv.patch.csv, War Thunder uses 4 standard localization keys for different UI contexts and HUD distances:

Key PatternWhere It Appears in GameExample (for us_m2a4_mod_demo)
<id>_shopTech-tree card, crew slot bar, and local web store card short name"M2A4 (Mod Demo)" / "M2A4(教学改型)"
<id>_0Stat-card header, research completion modal, and battle debriefing full formal title"Light Tank M2A4 (Mod Demo)" / "M2A4 轻型坦克(教学改型)"
<id>_1In-battle medium-distance 3D HUD marker name"M2A4 Demo" / "M2A4 教学型"
<id>_2In-battle far-distance HUD marker / compact killfeed short name"M2A4" / "M2A4"
@@ -726,23 +721,16 @@ us_m2a4 { "us_m2a4_mod_demo_2";"M2A4";"M2A4";"M2A4"
  • Fields must be separated by semicolons ; and wrapped in double quotes, with column headers on line 1 (list only the language columns you want to populate; omitted columns keep their stock values or default to empty);
  • Existing row keys update only your non-empty columns in place; new keys are appended to the end of the file.

-

7. Patching Root config.blk (client/config-blk.patch.jsonc)

-

If your mod needs to adjust the client root config.blk (for example enabling sound mods via sound{ enable_mod:b=yes } or setting a custom hangar hangarBlk:t="..."), place a standard BLK patch at client/config-blk.patch.jsonc:

-
jsonc
{
-  "ops": [
-    {
-      "op": "setParam",
-      "path": ["sound"],
-      "name": "enable_mod",
-      "value": { "type": "bool", "value": true },
-      "createBlocks": true
-    }
-  ]
+

7. Patching Root config.blk (client/config-blk.patch.blk / .jsonc)

+

If your mod needs to adjust the client root config.blk (for example enabling sound mods via sound{ enable_mod:b=yes } or setting a custom hangar hangarBlk:t="..."), place a BLK patch at client/config-blk.patch.blk (recommended; client/config-blk.patch.jsonc is also supported):

+
blk
// client/config-blk.patch.blk
+"@override:sound" {
+  "@override:enable_mod":b = yes
 }

The launcher backs up the stock config.blk to wtoffline/stock/config.blk before applying patches and restores it automatically when no enabled mod touches config.blk.


8. End-to-End Walkthrough: Clone a Playable Standalone Tank (us_m2a4_mod_demo) in 5 Minutes

-

Let's connect every piece from this chapter into a complete, copy-pasteable mod that derives a standalone us_m2a4_mod_demo light tank from stock us_m2a4—boosted to 90 km/h, rated at BR 1.3 (mrank = 1), and wired into US Ground Rank I with a research arrow from M2A4. Because every player profile owns the reserve us_m2a4 from the start, you can see the new tank in the US tree and Test Drive it immediately!

+

Let's connect every piece from this chapter into a complete, copy-pasteable mod that derives a standalone us_m2a4_mod_demo light tank from stock us_m2a4—boosted to 90 km/h, rated at BR 1.3 (mrank = 1), and wired into US Ground Rank I with a research arrow from M2A4. Because every player profile owns the reserve us_m2a4 from the start, you can see the new tank in the US tree and Test Drive it immediately!

8.1 Mod Folder Tree

Create demo-standalone-m2a4/ inside your global mods/ directory:

text
mods/demo-standalone-m2a4/
@@ -751,12 +739,12 @@ us_m2a4 {
    └─ packs/
       ├─ aces.vromfs.bin/
       │  └─ gamedata/units/tankmodels/
-      │     └─ us_m2a4_mod_demo.blk          # ① Tank physics/armor/weapons (copied from stock us_m2a4.blk)
+      │     └─ us_m2a4_mod_demo.blk          # ① Inherits stock us_m2a4.blk via include & boosts speed
       ├─ char.vromfs.bin/
       │  └─ config/
-      │     ├─ wpcost.blk.patch.jsonc        # ② Clone economy, BR, modifications & ammo racks
-      │     ├─ shop.blk.patch.jsonc          # ③ Insert into US Army column 0 (Rank I)
-      │     └─ unittags.blk.patch.jsonc      # ④ Clone unit class tags & test-drive mission
+      │     ├─ wpcost.blk.patch.blk          # ② Clone economy, BR, modifications & ammo racks
+      │     ├─ shop.blk.patch.blk            # ③ Insert into US Army column 0 (Rank I)
+      │     └─ unittags.blk.patch.blk        # ④ Clone unit class tags & test-drive mission
       └─ lang.vromfs.bin/
          └─ lang/
             └─ units.csv.patch.csv           # ⑤ Localized _shop / _0 / _1 / _2 names
@@ -779,65 +767,37 @@ us_m2a4 { "game_versions": ["2.61.0.*"] }
① Tank Model Definition client/packs/aces.vromfs.bin/gamedata/units/tankmodels/us_m2a4_mod_demo.blk
-

Extract stock gamedata/units/tankmodels/us_m2a4.blk from aces.vromfs.bin using any method from Chapter 01 Section 2, and save it as us_m2a4_mod_demo.blk. Keep model:t="m2a4" at the top (so the engine reuses the stock M2A4 3D mesh and textures) and raise its speed and acceleration (plain text .blk compiles to binary automatically on build):

-
blk
model:t="m2a4"
-// ... (keep the rest of stock us_m2a4.blk unchanged; tweak mobility below to feel the difference) ...
-maxFwdSpeed:r=90.0
-maxRevSpeed:r=25.0
-maxAccel:r=12.0
-
② Economy & BR Patch client/packs/char.vromfs.bin/config/wpcost.blk.patch.jsonc
-

Use cloneBlock to copy us_m2a4 (inheriting all weapons, shells, modifications, and backup settings), and set reqAir to "us_m2a4", RP cost to 1000, SL price to 500, and all mode mrank values to 1 (displayed BR 1.3):

-
jsonc
{
-  "ops": [
-    {
-      "op": "cloneBlock",
-      "from": ["us_m2a4"],
-      "toParent": [],
-      "newName": "us_m2a4_mod_demo",
-      "replaceExisting": true,
-      "ops": [
-        { "op": "setParam", "path": [], "name": "reqAir", "value": "us_m2a4" },
-        { "op": "setParam", "path": [], "name": "reqExp", "value": { "type": "int", "value": 1000 } },
-        { "op": "setParam", "path": [], "name": "value", "value": { "type": "int", "value": 500 } },
-        { "op": "setParam", "path": [], "name": "economicRank", "value": { "type": "int", "value": 1 } },
-        { "op": "setParam", "path": [], "name": "economicRankArcade", "value": { "type": "int", "value": 1 } },
-        { "op": "setParam", "path": [], "name": "economicRankHistorical", "value": { "type": "int", "value": 1 } },
-        { "op": "setParam", "path": [], "name": "economicRankSimulation", "value": { "type": "int", "value": 1 } }
-      ]
-    }
-  ]
+

Inherit stock us_m2a4.blk directly via include (no need to unpack or copy thousands of stock lines) and override just its speed and acceleration (compiled to binary automatically on build):

+
blk
include "us_m2a4.blk"
+"@override:maxFwdSpeed":r = 90.0
+"@override:maxRevSpeed":r = 25.0
+"@override:maxAccel":r = 12.0
+
② Economy & BR Patch client/packs/char.vromfs.bin/config/wpcost.blk.patch.blk
+

Use @clone: to copy us_m2a4 (inheriting all weapons, shells, modifications, and backup settings), and set reqAir to "us_m2a4", RP cost to 1000, SL price to 500, and all mode mrank values to 1 (displayed BR 1.3):

+
blk
"@clone:us_m2a4->us_m2a4_mod_demo" {
+  "@override:reqAir":t = "us_m2a4"
+  "@override:reqExp":i = 1000
+  "@override:value":i = 500
+  "@override:economicRank":i = 1
+  "@override:economicRankArcade":i = 1
+  "@override:economicRankHistorical":i = 1
+  "@override:economicRankSimulation":i = 1
 }
-
③ Tech-Tree Slot Patch client/packs/char.vromfs.bin/config/shop.blk.patch.jsonc
-

Insert us_m2a4_mod_demo into country_usa -> army -> range[0] right after us_m3a1_stuart (just before the us_m5a1_stuart Rank II break) with an explicit reqAir: "us_m2a4", creating a clean Rank I side-branch arrow from M2A4 without disturbing the stock Stuart chain:

-
jsonc
{
-  "ops": [
-    {
-      "op": "addBlock",
-      "path": ["country_usa", "army", "range[0]"],
-      "name": "us_m2a4_mod_demo",
-      "after": "us_m3a1_stuart",
-      "block": {
-        "params": [
-          { "name": "rank", "value": { "type": "int", "value": 1 } },
-          { "name": "reqAir", "value": "us_m2a4" }
-        ]
+
③ Tech-Tree Slot Patch client/packs/char.vromfs.bin/config/shop.blk.patch.blk
+

Insert us_m2a4_mod_demo into country_usa -> army -> range[0] right after us_m3a1_stuart (just before the us_m5a1_stuart Rank II break) with an explicit reqAir:t = "us_m2a4", creating a clean Rank I side-branch arrow from M2A4 without disturbing the stock Stuart chain:

+
blk
"@override:country_usa" {
+  "@override:army" {
+    "@override:range[0]" {
+      "@after:us_m3a1_stuart:us_m2a4_mod_demo" {
+        rank:i = 1
+        reqAir:t = "us_m2a4"
       }
     }
-  ]
+  }
 }
-
④ Unit Tags & Test-Drive Patch client/packs/char.vromfs.bin/config/unittags.blk.patch.jsonc
+
④ Unit Tags & Test-Drive Patch client/packs/char.vromfs.bin/config/unittags.blk.patch.blk

Clone us_m2a4 in unittags.blk so the new ID inherits type:t="tank", hangar_place:t="tank", the ground testFlight mission, and light-tank tags:

-
jsonc
{
-  "ops": [
-    {
-      "op": "cloneBlock",
-      "from": ["us_m2a4"],
-      "toParent": [],
-      "newName": "us_m2a4_mod_demo",
-      "replaceExisting": true
-    }
-  ]
-}
+
blk
"@clone:us_m2a4->us_m2a4_mod_demo" {}
⑤ Localization Patch client/packs/lang.vromfs.bin/lang/units.csv.patch.csv

Copy the 4-row CSV snippet from Section 6.2 above. Enable the mod in the launcher, start the game, open the US Ground Rank I tree, and right-click M2A4 (Mod Demo) › Test Drive to take your 90 km/h light tank for a spin!

@@ -874,9 +834,9 @@ maxAccel:r=12.0
│ └─ us_mbt_demo.blk # ② 载具物理、装甲、炮塔、武器配置(文本 BLK 自动编译) ├─ char.vromfs.bin/ │ └─ config/ - │ ├─ wpcost.blk.patch.jsonc # ③ 价格、研发点、权重、改装件(用 cloneBlock 最快) - │ ├─ shop.blk.patch.jsonc # ④ 挂进对应国家科技树纵列位置 - │ └─ unittags.blk.patch.jsonc # ④ 注册载具类型、机库车位、试车场与标签 + │ ├─ wpcost.blk.patch.blk # ③ 价格、研发点、权重、改装件(用 @clone: 最快;也兼容 .patch.jsonc) + │ ├─ shop.blk.patch.blk # ④ 挂进对应国家科技树纵列位置 + │ └─ unittags.blk.patch.blk # ④ 注册载具类型、机库车位、试车场与标签 ├─ lang.vromfs.bin/ │ └─ lang/ │ └─ units.csv.patch.csv # ⑤ 中英文名称(_shop、_0、_1、_2) @@ -890,17 +850,15 @@ maxAccel:r=12.0
  1. 保持三处载具内部 ID 完全一致:tankmodels/us_mbt_demo.blk 文件名(或空军 flightmodels/us_jet_demo.blk)、wpcost.blk 块名、shop.blk 块名与 unittags.blk 块名必须一字不差。
  2. ui/atlases.vromfs.bin 图标路径必须全小写:原版图标包内部键名统一为全小写,请命名为 gameuiskin/<全小写载具id>_ico.svg(本地网页商店的商品卡片也会自动读取这张 SVG 图标!)。
  3. 验证 .blk 里的模型资产名与 .grp 一致:gamedata/units/tankmodels/us_mbt_demo.blk 顶部的 model:t="..." 名称必须与你在 CDK 中导出 .grp 时的资产名完全一致。

3. 银狮研发车 vs gift 商城礼包车(以及 AI 机器人池准入规则)

-

在 wpcost.blk.patch.jsonc 和 shop.blk.patch.jsonc 中,你可以自由决定这辆新车是走常规银狮研发线还是走本地网页商城礼包:

+

在 wpcost.blk.patch.blk 和 shop.blk.patch.blk(或 .patch.jsonc)中,你可以自由决定这辆新车是走常规银狮研发线还是走本地网页商城礼包:

方式 A:常规银狮科技树研发车(推荐希望 AI 也能开这辆车出战时使用)

方式 B:本地网页商城礼包车(gift:t="msi_notebook")

很多模组作者在翻看原版 wpcost.blk / shop.blk 时会好奇:为什么满地都是 gift:t="msi_notebook"?

- +

4. 配套涂装、瞄具、音效与原生目录的边界

- +

03 · Adding Custom 3D Vehicle Models & Textures

@@ -911,10 +869,10 @@ maxAccel:r=12.0
Term / ExtensionPlain-Language Meaning
.grpDagor Engine 3D geometry & skeleton archive (exported from the official War Thunder CDK AssetViewer / exporter), containing multi-LOD meshes, animation skeleton nodes (animChar), collision volumes, and internal damage-model (DM) parts.
.dxp.binDagor Engine compressed texture pack, bundling multiple diffuse, normal, and metallic/roughness DDSx textures referenced by name inside .grp materials.
.ddsxA single Dagor compressed texture file (DDSx), commonly used for UI stat-card vehicle portraits (ui/images.vromfs.bin/units/<unit_id>.ddsx) or standalone skin textures.
NTFS Directory JunctionThink of it as an OS-level zero-copy folder shortcut built into Windows NTFS: when the game engine opens <copy>/content/pkg_user/<modId>, Windows transparently serves the files straight from your mods/ folder on any drive—no administrator rights needed, works across drives, consumes 0 extra disk bytes, and mounts/unmounts in ~1 ms!

How the Engine Discovers client/addon/ Automatically

Verified directly against 2.61.0.x aces.exe (dlContent.cpp) and aces.vromfs.bin/config/settings.blk:

- +

2. 6-Step Checklist for a Custom 3D Vehicle

-

Suppose your mod ID is demo.new-mbt and your new vehicle's internal ID is us_mbt_demo:

+

Suppose your mod ID is demo.new-mbt and your new vehicle's internal ID is us_mbt_demo:

text
mods/demo-new-mbt/
 ├─ mod.jsonc
 └─ client/
@@ -928,9 +886,9 @@ maxAccel:r=12.0
│ └─ us_mbt_demo.blk # ② Physics, armor, turret & weapons (text BLK compiles automatically) ├─ char.vromfs.bin/ │ └─ config/ - │ ├─ wpcost.blk.patch.jsonc # ③ Price, RP, BR & modifications (fastest via cloneBlock) - │ ├─ shop.blk.patch.jsonc # ④ Tech-tree column & position - │ └─ unittags.blk.patch.jsonc # ④ Unit class, hangar slot, test-drive mission & tags + │ ├─ wpcost.blk.patch.blk # ③ Price, RP, BR & modifications (fastest via @clone:; .patch.jsonc also supported) + │ ├─ shop.blk.patch.blk # ④ Tech-tree column & position + │ └─ unittags.blk.patch.blk # ④ Unit class, hangar slot, test-drive mission & tags ├─ lang.vromfs.bin/ │ └─ lang/ │ └─ units.csv.patch.csv # ⑤ Localized names (_shop, _0, _1, _2) @@ -941,20 +899,18 @@ maxAccel:r=12.0
└─ units/ └─ us_mbt_demo.ddsx # ⑥ Stat-card / crew-slot portrait (optional; falls back to placeholder)

Key Verification Checks

-
  1. Keep the vehicle's internal ID identical everywhere: the tankmodels/us_mbt_demo.blk filename (or flightmodels/us_jet_demo.blk for aircraft) and the block names in wpcost.blk, shop.blk, and unittags.blk must match character for character.
  2. ui/atlases.vromfs.bin icon paths must be all lowercase: stock icon packs store paths in lowercase, so name your icon gameuiskin/<lowercase_unit_id>_ico.svg (the local web store also displays this exact SVG on pack cards!).
  3. Match .blk asset names to .grp exports: model:t="..." inside gamedata/units/tankmodels/us_mbt_demo.blk must match the exact asset name exported into your .grp archive from the CDK.
+
  1. Keep the vehicle's internal ID identical everywhere: the tankmodels/us_mbt_demo.blk filename (or flightmodels/us_jet_demo.blk for aircraft) and the block names in wpcost.blk, shop.blk, and unittags.blk must match character for character.
  2. ui/atlases.vromfs.bin icon paths must be all lowercase: stock icon packs store paths in lowercase, so name your icon gameuiskin/<lowercase_unit_id>_ico.svg (the local web store also displays this exact SVG on pack cards!).
  3. Match .blk asset names to .grp exports: model:t="..." inside gamedata/units/tankmodels/us_mbt_demo.blk must match the exact asset name exported into your .grp archive from the CDK.

3. Regular Tech-Tree Vehicles vs gift Store Packs (& AI Bot Pool Rules)

-

In wpcost.blk.patch.jsonc and shop.blk.patch.jsonc, you can wire your custom vehicle either as a regular Silver Lions researchable vehicle or as a local web store pack vehicle:

+

In wpcost.blk.patch.blk and shop.blk.patch.blk (or .patch.jsonc), you can wire your custom vehicle either as a regular Silver Lions researchable vehicle or as a local web store pack vehicle:

- +

Option B: Local Web Store Pack Vehicle (gift:t="msi_notebook")

Modders inspecting stock wpcost.blk / shop.blk often wonder: why do dozens of pack vehicles say gift:t="msi_notebook"?

- +

4. Companion Skins, Sights, Sounds & the Native Folder Boundary

- +
← 上一章← Previous02 · 数据包与 BLK/CSV 补丁02 · Client Packs & BLK Patching @@ -1808,69 +1764,65 @@ openUrl("http://{{LOCAL_ENDPOINT}}/mods/demo.my-mod/panel", false, fal

07 · 排错、日志、热重载与打包发布规范

1. 模组出错了去哪里看日志?

启动器的所有模组构建与运行日志都会汇入标准日志目录,可在 「设置 › 诊断 › 打开日志目录」 或 「关于 › 导出诊断日志」 直接打开:

-
  1. 启动器主日志(launcher.log): -
    • 搜索 [build]:查看本轮启用了哪些模组、各 .vromfs.bin 数据包叠加统计、以及哪条 gui-patches 或 exe-patches 被跳过与具体原因;
    • 搜索 [mods]:查看跨盘 Junction 挂载结果、被跳过的玩家原生文件重名告警、以及自动还原的按需备份数据包;
    • 搜索 [server] 或 [mod:<你的modId>]:查看服务端 tuning 校验错误、脚本加载报错堆栈、以及你在脚本里调用 ctx.logger.info/warn/error 打印的全部输出。
  2. 游戏客户端运行日志(<游戏副本目录>/.game_logs/*.clog): -
    • 若客户端 GUI 脚本运行报错或卡死在「正在加载」,查看最新的 .clog(并配合第 04 章的 sq.exe 完整字节码检查快速定位);
    • 若新增 3D 模型未渲染,搜索 .clog 中的 [PACK]、pkg_user 或模型资产名确认是否被引擎挂载。
+
  1. 启动器主日志(launcher.log):
    • 搜索 [build]:查看本轮启用了哪些模组、各 .vromfs.bin 数据包叠加统计、以及哪条 gui-patches 或 exe-patches 被跳过与具体原因;
    • 搜索 [mods]:查看跨盘 Junction 挂载结果、被跳过的玩家原生文件重名告警、以及自动还原的按需备份数据包;
    • 搜索 [server] 或 [mod:<你的modId>]:查看服务端 tuning 校验错误、脚本加载报错堆栈、以及你在脚本里调用 ctx.logger.info/warn/error 打印的全部输出。
  2. 游戏客户端运行日志(<游戏副本目录>/.game_logs/*.clog):
    • 若客户端 GUI 脚本运行报错或卡死在「正在加载」,查看最新的 .clog(并配合第 04 章的 sq.exe 完整字节码检查快速定位);
    • 若新增 3D 模型未渲染,搜索 .clog 中的 [PACK]、pkg_user 或模型资产名确认是否被引擎挂载。

2. 常见报错与疑难杂症速查表

-
现象 / 日志报错常见原因解决方法
启动器提示某模组目录读取失败mod.jsonc 存在 JSON 语法错误、拼错了未知字段名、id 含大写或非法字符、或声明的 server.entry 文件不存在对照第 01 章第 5 节字段表核对 mod.jsonc
点启动提示「存在阻塞性模组错误」启用的模组缺少 requires 前置、前置未勾选启用,或同时勾选了声明 conflicts 互斥的两个模组按「模组」页顶部的红色错误列表补齐前置或关闭其中一个互斥项
模组里的 server/tuning/*.jsonc 修改似乎没生效测试客户端曾在启动器「数值」页手动改过同一字段(<数据目录>/tuning/*.jsonc 优先级高于模组),或 store.jsonc 把 vehiclePacks 内部字段写到了根级在启动器「数值」页将该项重置为默认,并核对第 05 章的字段层级与 "gjn" 字段名
服务端加载 .ts 报语法错或找不到模块在 .ts 中写了 enum/namespace,或写了运行时值导入 import { ... } from '@wto/mods'改用 as const 对象 + 联合类型;类型提示一律写成 import type { ... } from './server-api.ts'
gui-patches 报错 the data pack has no script ...patch.jsonc 里的 variant.file 含有大写字母(如 scripts/gameModes/...)将 variant.file 改为全小写(如 scripts/gamemodes/gamemodeselect.nut)
新增的独立 .css 样式完全没生效只把 .css 放进了 client/packs/gui.vromfs.bin/,未在根样式表 gui/css.css 中注册在 client/gui-patches/ 给 gui/css.css 增加一条 @import "目录文件名.css" 补丁(见第 04 章 2.2 节)
客户端 matchingApiFunc 回调不触发或服务端收到空 params把 matchingApiFunc 的第 2、第 3 个参数顺序写反了记住签名是 matchingApiFunc(methodName, callback, params)——callback 在第 2 位,params 在第 3 位!
进机库一直卡在「正在加载」新增或修补后的完整 .nut 存在词法作用域重名、未声明标识符、保留字 base 误用或反引号字符串 ` ... | 用 sq.exe 对**完整 .nut 文件**跑 compilestring 字节码校验,插值字符串统一用 $"..."`
日志提示 overlaps protected core patch模组的 client/exe-patches/ 试图修改离线版核心隔离补丁锁定的字节区间核心隔离区段受保护不可覆盖,请改用非重叠地址或服务端方案
日志提示 target already exists as a native/player fileclient/files/ 中的某文件与玩家自己在 UserSkins/ 或 UserSights/ 手动放的文件重名给模组附带的配套子目录加上专属前缀(如 mod_<你的id>_...)避免撞名
+
现象 / 日志报错常见原因解决方法
启动器提示某模组目录读取失败mod.jsonc 存在 JSON 语法错误、拼错了未知字段名、id 含大写或非法字符、或声明的 server.entry 文件不存在对照第 01 章第 5 节字段表核对 mod.jsonc
点启动提示「存在阻塞性模组错误」启用的模组缺少 requires 前置、前置未勾选启用,或同时勾选了声明 conflicts 互斥的两个模组按「模组」页顶部的红色错误列表补齐前置或关闭其中一个互斥项
模组里的 server/tuning/*.jsonc 修改似乎没生效测试客户端曾在启动器「数值」页手动改过同一字段(<数据目录>/tuning/*.jsonc 优先级高于模组),或 store.jsonc 把 vehiclePacks 内部字段写到了根级在启动器「数值」页将该项重置为默认,并核对第 05 章的字段层级与 "gjn" 字段名
服务端加载 .ts 报语法错或找不到模块在 .ts 中写了 enum/namespace,或写了运行时值导入 import { ... } from '@wto/mods'改用 as const 对象 + 联合类型;类型提示一律写成 import type { ... } from './server-api.ts'
gui-patches 报错 the data pack has no script ...patch.jsonc 里的 variant.file 含有大写字母(如 scripts/gameModes/...)将 variant.file 改为全小写(如 scripts/gamemodes/gamemodeselect.nut)
新增的独立 .css 样式完全没生效只把 .css 放进了 client/packs/gui.vromfs.bin/,未在根样式表 gui/css.css 中注册在 client/gui-patches/ 给 gui/css.css 增加一条 @import "目录\文件名.css" 补丁(见第 04 章 2.2 节)
客户端 matchingApiFunc 回调不触发或服务端收到空 params把 matchingApiFunc 的第 2、第 3 个参数顺序写反了记住签名是 matchingApiFunc(methodName, callback, params)——callback 在第 2 位,params 在第 3 位!
进机库一直卡在「正在加载」新增或修补后的完整 .nut 存在词法作用域重名、未声明标识符、保留字 base 误用或反引号字符串 `...`用 sq.exe 对完整 .nut 文件跑 compilestring 字节码校验,插值字符串统一用 $"..."
日志提示 overlaps protected core patch模组的 client/exe-patches/ 试图修改离线版核心隔离补丁锁定的字节区间核心隔离区段受保护不可覆盖,请改用非重叠地址或服务端方案
日志提示 target already exists as a native/player fileclient/files/ 中的某文件与玩家自己在 UserSkins/ 或 UserSights/ 手动放的文件重名给模组附带的配套子目录加上专属前缀(如 mod_<你的id>_...)避免撞名

3. 开发调试热重载循环(改完文件怎么最快看到效果?)

在本地编写与调试模组时,了解客户端与服务端各自的加载时机能省下大量时间:

-
  1. 修改客户端内容(client/packs/、client/gui-patches/、client/exe-patches/、client/addon/、client/files/、config-blk.patch.jsonc): -
    • 先正常退出游戏客户端;
    • 保存你修改的模组源文件后,直接在启动器点击 「启动游戏」:启动器会自动比对所有启用模组源文件的大小与修改时间指纹(Fingerprint),一旦发现任一补丁或包内文件有改动,就会自动从 wtoffline/stock/ 重新叠加生成最新数据包并启动游戏!
    • 提示:如果只是微调已通过 NTFS Junction 挂载的 client/addon/res/ 或 client/files/UserSkins/<子目录>/ 内部贴图,文件本身已经是零拷贝直连的,重启游戏(或游戏内点刷新涂装)即可直接读取最新文件。
  2. 修改服务端内容(server/index.ts 与 server/tuning/*.jsonc): -
    • 每次退出游戏并在启动器重新点击 「启动游戏」拉起新一轮本地服务器会话时,服务器都会重新合并全部 server/tuning/*.jsonc,并通过带时间戳的 ESM 动态导入(?wto_mod=<timestamp>)全新加载 server/index.ts,无需重启启动器本身。
+
  1. 修改客户端内容(client/packs/、client/gui-patches/、client/exe-patches/、client/addon/、client/files/、config-blk.patch.blk / .jsonc):
    • 先正常退出游戏客户端;
    • 保存你修改的模组源文件后,直接在启动器点击 「启动游戏」:启动器会自动比对所有启用模组源文件的大小与修改时间指纹(Fingerprint),一旦发现任一补丁或包内文件有改动,就会自动从 wtoffline/stock/ 重新叠加生成最新数据包并启动游戏!
    • 提示:如果只是微调已通过 NTFS Junction 挂载的 client/addon/res/ 或 client/files/UserSkins/<子目录>/ 内部贴图,文件本身已经是零拷贝直连的,重启游戏(或游戏内点刷新涂装)即可直接读取最新文件。
  2. 修改服务端内容(server/index.ts 与 server/tuning/*.jsonc):
    • 每次退出游戏并在启动器重新点击 **「启动游戏」**拉起新一轮本地服务器会话时,服务器都会重新合并全部 server/tuning/*.jsonc,并通过带时间戳的 ESM 动态导入(?wto_mod=<timestamp>)全新加载 server/index.ts,无需重启启动器本身。

4. 模组打包与发布分享规范(.zip 结构)

当你完成测试准备把模组分享给其他玩家时,请遵循统一的压缩包目录约定,让玩家解压即用、不踩套娃目录坑:

-
  1. 压缩包内保留且仅保留一层顶层模组文件夹: 假设你的模组目录叫 my-awesome-mod,打包后的 my-awesome-mod.zip 内部结构应当是:
+
  1. 压缩包内保留且仅保留一层顶层模组文件夹: +假设你的模组目录叫 my-awesome-mod,打包后的 my-awesome-mod.zip 内部结构应当是:
text
my-awesome-mod.zip
 └─ my-awesome-mod/          <-- 唯一顶层文件夹(玩家直接解压到 mods/ 即可得到 mods/my-awesome-mod/mod.jsonc)
    ├─ mod.jsonc
    ├─ client/
    └─ server/
-
  1. 打包前清理无关开发垃圾文件: 请剔除 .git/、node_modules/(若用第三方库请预打包进单文件 server/index.mjs)、.DS_Store、Thumbs.db、编辑器备份文件(*.bak、*.swp)以及临时解包参考用的原版大文件。
+
  1. 打包前清理无关开发垃圾文件: +请剔除 .git/、node_modules/(若用第三方库请预打包进单文件 server/index.mjs)、.DS_Store、Thumbs.db、编辑器备份文件(*.bak、*.swp)以及临时解包参考用的原版大文件。

5. 跨盘与非 NTFS 磁盘行为说明


6. 开发与发布建议

-
  1. 命名空间隔离:模组 ID 用 <作者>.<模组名>;新增载具 ID、武器、涂装子目录、自定义匹配 RPC(wto_mod.<模组名>.*)、自定义 Char 动作均加上专属前缀,避免与其他模组撞名;
  2. 公共表优先使用增量补丁而非整文件覆盖:修改 shop.blk、wpcost.blk、unittags.blk、units.csv、menu.csv 时使用 .patch.jsonc / .patch.csv,多车礼包与抽卡箱数组使用 $listOps;
  3. 只读原版,不污染玩家主存档:模组自定数据一律写进 ctx.storage.forPlayer(userId),卸载模组后玩家主存档干干净净;
  4. 界面大逻辑拆独立文件:新弹窗放 client/packs/gui.vromfs.bin/,client/gui-patches/ 里只留几行挂入口按钮与 @import 样式的最小补丁,游戏大版本更新时几乎不用重写;
  5. 发布前做一次完整的「启用 → 进游验证 → 关闭 → 再进游还原」测试循环:确认启用时功能正常、关闭后彻底无痕还原,且能与其他常用模组同时勾选共存。
+
  1. 命名空间隔离:模组 ID 用 <作者>.<模组名>;新增载具 ID、武器、涂装子目录、自定义匹配 RPC(wto_mod.<模组名>.*)、自定义 Char 动作均加上专属前缀,避免与其他模组撞名;
  2. 公共表优先使用增量补丁而非整文件覆盖:修改 shop.blk、wpcost.blk、unittags.blk、units.csv、menu.csv 时使用 .patch.blk(或 .patch.jsonc)/ .patch.csv,多车礼包与抽卡箱数组使用 $listOps;
  3. 只读原版,不污染玩家主存档:模组自定数据一律写进 ctx.storage.forPlayer(userId),卸载模组后玩家主存档干干净净;
  4. 界面大逻辑拆独立文件:新弹窗放 client/packs/gui.vromfs.bin/,client/gui-patches/ 里只留几行挂入口按钮与 @import 样式的最小补丁,游戏大版本更新时几乎不用重写;
  5. 发布前做一次完整的「启用 → 进游验证 → 关闭 → 再进游还原」测试循环:确认启用时功能正常、关闭后彻底无痕还原,且能与其他常用模组同时勾选共存。

07 · Troubleshooting, Logs, Reload Loop & Packaging

1. Where to Check Logs When Something Goes Wrong

-

All mod build and runtime logs flow into the launcher's standard log directory—open Settings › Diagnostics › Open logs folder or About › Export diagnostics:

-
  1. Launcher Main Log (launcher.log): -
    • Filter [build]: see which mods ran in the current build, .vromfs.bin overlay counts, and exact reasons why any gui-patches or exe-patches item was skipped;
    • Filter [mods]: see cross-drive Junction mounts, skipped native player-file collision warnings, and restored on-demand stock packs;
    • Filter [server] or [mod:<yourModId>]: see server tuning validation errors, script load stack traces, and everything printed via ctx.logger.info/warn/error.
  2. Game Client Runtime Logs (<copyFolder>/.game_logs/*.clog): -
    • If a client UI script throws at runtime or hangs on "Loading", check the newest .clog (and run sq.exe full bytecode verification from Chapter 04);
    • If a custom 3D model fails to appear, search .clog for [PACK], pkg_user, or your asset name to confirm engine mounting.
+

All mod build and runtime logs flow into the launcher's standard log directory—open Settings › Diagnostics › Open logs folder or About › Export diagnostics:

+
  1. Launcher Main Log (launcher.log):
    • Filter [build]: see which mods ran in the current build, .vromfs.bin overlay counts, and exact reasons why any gui-patches or exe-patches item was skipped;
    • Filter [mods]: see cross-drive Junction mounts, skipped native player-file collision warnings, and restored on-demand stock packs;
    • Filter [server] or [mod:<yourModId>]: see server tuning validation errors, script load stack traces, and everything printed via ctx.logger.info/warn/error.
  2. Game Client Runtime Logs (<copyFolder>/.game_logs/*.clog):
    • If a client UI script throws at runtime or hangs on "Loading", check the newest .clog (and run sq.exe full bytecode verification from Chapter 04);
    • If a custom 3D model fails to appear, search .clog for [PACK], pkg_user, or your asset name to confirm engine mounting.

2. Common Issues & Solutions Lookup Table

-
Symptom / Log MessageCommon CauseSolution
Discovery error on Launcher Mods pagemod.jsonc syntax error, unknown field name, uppercase/invalid id, or missing server.entry fileValidate mod.jsonc against the schema table in Chapter 01 Section 5
"Blocking mod errors" when clicking LaunchMissing or disabled requires dependency, or two enabled mods declaring conflictsEnable the missing dependency or disable one of the conflicting mods highlighted in red
server/tuning/*.jsonc changes appear ignoredTest client has a manual override saved in the Launcher Tuning tab (<dataFolder>/tuning/*.jsonc has highest priority), or store.jsonc placed vehiclePacks subkeys at rootReset overridden fields in the Launcher Tuning tab and check vehiclePacks nesting + "gjn" key names in Chapter 05
Server .ts fails with syntax or module-not-found errorRaw .ts used enum/namespace, or value-imported import { ... } from '@wto/mods'Replace enum with as const + union type; use import type { ... } from './server-api.ts' for types
gui-patches fails with the data pack has no script ...variant.file in patch.jsonc used camelCase / uppercase letters (e.g. scripts/gameModes/...)Change variant.file to all lowercase (e.g. scripts/gamemodes/gamemodeselect.nut)
Standalone .css stylesheet has no effectAdded .css to client/packs/gui.vromfs.bin/ without registering it in gui/css.cssAdd a client/gui-patches/ patch on gui/css.css appending @import "folderstyle.css" (Chapter 04 Section 2.2)
Client matchingApiFunc callback does not fire or params arrive emptySwapped the 2nd and 3rd arguments of matchingApiFuncUse matchingApiFunc(methodName, callback, params) (callback is 2nd, params is 3rd)
Game hangs indefinitely on "Loading" before hangarResulting complete .nut file has a lexical scope collision, undeclared identifier, base keyword misuse, or backtick string ` ... | Run sq.exe compilestring on the **complete .nut file** and use $"..."` for string interpolation
Log reports overlaps protected core patchMod client/exe-patches/ overlaps locked core offline/isolation patch bytesCore isolation bytes are protected; pick a non-overlapping site or use a server-side hook
Log reports target already exists as a native/player fileA path under client/files/ collides with a player-owned file in UserSkins/ or UserSights/Prefix bundled companion subfolders with your mod namespace (e.g. mod_<yourId>_...)
+
Symptom / Log MessageCommon CauseSolution
Discovery error on Launcher Mods pagemod.jsonc syntax error, unknown field name, uppercase/invalid id, or missing server.entry fileValidate mod.jsonc against the schema table in Chapter 01 Section 5
"Blocking mod errors" when clicking LaunchMissing or disabled requires dependency, or two enabled mods declaring conflictsEnable the missing dependency or disable one of the conflicting mods highlighted in red
server/tuning/*.jsonc changes appear ignoredTest client has a manual override saved in the Launcher Tuning tab (<dataFolder>/tuning/*.jsonc has highest priority), or store.jsonc placed vehiclePacks subkeys at rootReset overridden fields in the Launcher Tuning tab and check vehiclePacks nesting + "gjn" key names in Chapter 05
Server .ts fails with syntax or module-not-found errorRaw .ts used enum/namespace, or value-imported import { ... } from '@wto/mods'Replace enum with as const + union type; use import type { ... } from './server-api.ts' for types
gui-patches fails with the data pack has no script ...variant.file in patch.jsonc used camelCase / uppercase letters (e.g. scripts/gameModes/...)Change variant.file to all lowercase (e.g. scripts/gamemodes/gamemodeselect.nut)
Standalone .css stylesheet has no effectAdded .css to client/packs/gui.vromfs.bin/ without registering it in gui/css.cssAdd a client/gui-patches/ patch on gui/css.css appending @import "folder\style.css" (Chapter 04 Section 2.2)
Client matchingApiFunc callback does not fire or params arrive emptySwapped the 2nd and 3rd arguments of matchingApiFuncUse matchingApiFunc(methodName, callback, params) (callback is 2nd, params is 3rd)
Game hangs indefinitely on "Loading" before hangarResulting complete .nut file has a lexical scope collision, undeclared identifier, base keyword misuse, or backtick string `...`Run sq.exe compilestring on the complete .nut file and use $"..." for string interpolation
Log reports overlaps protected core patchMod client/exe-patches/ overlaps locked core offline/isolation patch bytesCore isolation bytes are protected; pick a non-overlapping site or use a server-side hook
Log reports target already exists as a native/player fileA path under client/files/ collides with a player-owned file in UserSkins/ or UserSights/Prefix bundled companion subfolders with your mod namespace (e.g. mod_<yourId>_...)

3. Development Reload Loop (Fastest Edit-Test Cycle)

Knowing when client builds versus server scripts reload keeps iteration fast while developing:

-
  1. Client-side edits (client/packs/, client/gui-patches/, client/exe-patches/, client/addon/, client/files/, config-blk.patch.jsonc): -
    • Close the running game client first;
    • Save your edited mod files and click Launch in the launcher: the launcher hashes source file sizes and mtime timestamps into a deterministic build fingerprint, automatically rebuilding any affected .vromfs.bin packs from wtoffline/stock/ before starting the game!
    • Tip: textures inside already-mounted NTFS Junction directories (client/addon/res/ or client/files/UserSkins/<subfolder>/) point directly to your mods/ folder with zero copying, so restarting the client (or refreshing skins in-game) reads updated assets immediately.
  2. Server-side edits (server/index.ts & server/tuning/*.jsonc): -
    • Every time you exit the game and click Launch to start a new session, the local server restarts cleanly, re-merges all server/tuning/*.jsonc overlays, and reloads server/index.ts with a cache-busting ESM query (?wto_mod=<timestamp>)—no need to restart the launcher itself.
+
  1. Client-side edits (client/packs/, client/gui-patches/, client/exe-patches/, client/addon/, client/files/, config-blk.patch.blk / .jsonc):
    • Close the running game client first;
    • Save your edited mod files and click Launch in the launcher: the launcher hashes source file sizes and mtime timestamps into a deterministic build fingerprint, automatically rebuilding any affected .vromfs.bin packs from wtoffline/stock/ before starting the game!
    • Tip: textures inside already-mounted NTFS Junction directories (client/addon/res/ or client/files/UserSkins/<subfolder>/) point directly to your mods/ folder with zero copying, so restarting the client (or refreshing skins in-game) reads updated assets immediately.
  2. Server-side edits (server/index.ts & server/tuning/*.jsonc):
    • Every time you exit the game and click Launch to start a new session, the local server restarts cleanly, re-merges all server/tuning/*.jsonc overlays, and reloads server/index.ts with a cache-busting ESM query (?wto_mod=<timestamp>)—no need to restart the launcher itself.

4. Packaging & Sharing Your Mod (.zip Layout Rules)

When packaging your mod for players to download, follow a consistent archive structure so unzipping into mods/ works every time:

-
  1. Wrap your mod in a single top-level <mod-folder>/ directory inside the .zip: For a mod folder named my-awesome-mod, structure my-awesome-mod.zip as:
+
  1. Wrap your mod in a single top-level <mod-folder>/ directory inside the .zip: +For a mod folder named my-awesome-mod, structure my-awesome-mod.zip as:
text
my-awesome-mod.zip
 └─ my-awesome-mod/          <-- Single top-level folder (extracting straight into mods/ yields mods/my-awesome-mod/mod.jsonc)
    ├─ mod.jsonc
    ├─ client/
    └─ server/
-
  1. Exclude development & temporary clutter: Omit .git/, node_modules/ (bundle third-party JS dependencies into a single server/index.mjs if needed), .DS_Store, Thumbs.db, editor backup files (*.bak, *.swp), and any unpacked stock game reference files.
+
  1. Exclude development & temporary clutter: +Omit .git/, node_modules/ (bundle third-party JS dependencies into a single server/index.mjs if needed), .DS_Store, Thumbs.db, editor backup files (*.bak, *.swp), and any unpacked stock game reference files.

5. Cross-Drive & Non-NTFS Disk Behavior


6. Practical Recommendations for Mod Authors

-
  1. Namespace Everything: format your mod ID as <author>.<mod-name> and prefix custom vehicle IDs, weapons, skin subfolders, custom matching RPCs (wto_mod.<mod_name>.*), and custom Char actions to avoid collisions between mods;
  2. Prefer Incremental Patches Over Replacing Shared Tables: use .patch.jsonc / .patch.csv for shop.blk, wpcost.blk, unittags.blk, units.csv, and menu.csv, and use $listOps on shared tuning arrays like multiVehiclePacks and supplyTrophies;
  3. Read Stock Profiles, Persist in Isolated Storage: write all custom mod state to ctx.storage.forPlayer(userId) so player saves remain 100% clean if your mod is disabled or uninstalled;
  4. Keep UI Logic in Standalone Files: put custom modals under client/packs/gui.vromfs.bin/ and keep client/gui-patches/ down to a few lines wiring the entry button and gui/css.css @import so game updates rarely break your mod;
  5. Run One Full "Enable → Play → Disable → Relaunch" Cycle Before Release: verify your mod works when enabled, restores stock behavior cleanly when disabled, and coexists peacefully alongside other enabled mods.
+
  1. Namespace Everything: format your mod ID as <author>.<mod-name> and prefix custom vehicle IDs, weapons, skin subfolders, custom matching RPCs (wto_mod.<mod_name>.*), and custom Char actions to avoid collisions between mods;
  2. Prefer Incremental Patches Over Replacing Shared Tables: use .patch.blk (or .patch.jsonc) / .patch.csv for shop.blk, wpcost.blk, unittags.blk, units.csv, and menu.csv, and use $listOps on shared tuning arrays like multiVehiclePacks and supplyTrophies;
  3. Read Stock Profiles, Persist in Isolated Storage: write all custom mod state to ctx.storage.forPlayer(userId) so player saves remain 100% clean if your mod is disabled or uninstalled;
  4. Keep UI Logic in Standalone Files: put custom modals under client/packs/gui.vromfs.bin/ and keep client/gui-patches/ down to a few lines wiring the entry button and gui/css.css @import so game updates rarely break your mod;
  5. Run One Full "Enable → Play → Disable → Relaunch" Cycle Before Release: verify your mod works when enabled, restores stock behavior cleanly when disabled, and coexists peacefully alongside other enabled mods.