Fix store.jsonc vehiclePacks nesting and gjn field name, matchingApiFunc callback argument order, and DaGui CSS @import/lowercase rules; add stock archive inspection steps, BR-to-mrank table, cloned vehicle walkthrough, tuning field reference, and official-map-selector full-stack trace while bringing en/01..07.md to full 1:1 parity with zh-CN/.
11 KiB
01 · Quick Start & Manifest Reference
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:
- 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; - Large 3D model and texture addons mount across drives with zero file copying via Windows NTFS Directory Junctions;
- When the local server starts, it automatically extracts static game data from the overlaid client packs, merges each mod's
server/tuning/*.jsoncin the same order, and loadsserver/index.tsscripts; - 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.
- Global mod repository: defaults to
%APPDATA%\WTOffline Launcher\mods(configurable to any drive under Mods › Presets & repository). - 3 official templates seeded on first launch: the first time the launcher initializes the global
mods/folder, it automatically seedsexample-vehicle-tweak(code-free vehicle & localization tweak),example-server-script(minimal server TypeScript mod), andofficial-map-selector(full-stack native DaGui modal + server map filter), all disabled by default. Click Mods › Open mods folder right away to inspect their code or duplicate one as a starting point! - Per-client configuration: mod toggles, load order, and named presets are saved independently per client in
<dataFolder>/mods-config.json.
2. Prerequisite: How to Unpack & Inspect Stock Game Files
Before tweaking vehicle stats, wiring tech-tree entries, or patching UI scripts, you need to look up stock internal vehicle IDs (for example, the US reserve light tank M2A4 is us_m2a4, and the M1A2 SEP V2 is us_m1a2_sep2_abrams) and stock file paths.
2.1 Where Stock Archives Live in the Game Client
Inside your War Thunder client folder (and offline copy folder), stock game data lives inside .vromfs.bin virtual filesystem archives:
| Stock Archive Path (relative to client root) | Key Contents Inside |
|---|---|
char.vromfs.bin |
Tech-tree layout (config/shop.blk), vehicle prices/RP/BR/modifications (config/wpcost.blk), unit classification tags (config/unittags.blk), items, and unlocks |
aces.vromfs.bin |
Tank models & armor (gamedata/units/tankmodels/*.blk), aircraft flight models (gamedata/flightmodels/*.blk), ships, shells, and missiles (gamedata/weapons/...) |
gui.vromfs.bin |
All client UI Quirrel scripts (scripts/**/*.nut), Handyman templates (gui/**/*.tpl), and DaGui stylesheets (gui/**/*.css) |
lang.vromfs.bin |
Localization tables (lang/units.csv vehicle names, lang/menu.csv UI strings, lang/units_weaponry.csv weapons & ammo names) |
ui/atlases.vromfs.bin |
Tech-tree and local web store vehicle silhouette icons (gameuiskin/<unit_id>_ico.svg) |
ui/images.vromfs.bin |
Stat-card and crew-slot vehicle portraits (units/<unit_id>.ddsx) |
Note on the backup folder: Treat
<copy>/wtoffline/stock/as read-only. The launcher relies onwtoffline/stock/to rebuild overlays and restore clean files when mods are disabled; modifying files insidestock/can prevent automatic restoration. Place all mod changes undermods/<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:
- Local unpacking with community tools:
Copy
char.vromfs.bin,aces.vromfs.bin, orgui.vromfs.binfrom your client into a separate scratch folder (avoid unpacking in-place inside the game directory) and use standard community.vromfs.bin/.blkunpacking tools to extract readable text.blkand.nutfiles, vehicle IDs, and tech-tree paths. - 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.blkstraight out of a.vromfs.binarchive and print formatted text BLK:
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';
const ar = readArchive(readFileSync('C:/WarThunder/char.vromfs.bin'));
const dict = [...ar.files.entries()].find(([k]) => k.endsWith('.dict'))?.[1];
console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: ar.files.has(NAME_MAP_PATH) ? parseSharedNameMap(getFile(ar, NAME_MAP_PATH), dict).names : [], dictionary: dict })));
3. Build Your First Mod in 5 Minutes
- Open Mods › Open mods folder in the launcher (you will already see the 3 official template folders inside for reference);
- Create a new folder named
my-first-mod; - Create the manifest file
my-first-mod/mod.jsonc:
{
"format": 1,
"id": "demo.my-first-mod",
"name": {
"zh-CN": "我的第一个模组",
"en": "My First Mod"
},
"version": "0.1.0",
"author": "YourName",
"description": {
"zh-CN": "把对局银狮和研发点倍率调整为 2 倍。",
"en": "Doubles Silver Lions and Research Points battle rewards."
},
"api_version": "0.1-experimental",
"game_versions": ["2.61.0.*"]
}
- Create
my-first-mod/server/tuning/battle.jsonc:
{
"rewardMultiplierSilverLions": 2.0,
"rewardMultiplierResearchPoints": 2.0
}
- Switch back to the launcher window (the Mods page refreshes automatically on focus, or click Refresh), enable your mod, and click Launch.
4. Complete Standard Folder Layout
Create only the subdirectories your mod actually uses—unused folders can be omitted completely:
<mod-folder>/
├─ mod.jsonc # Required: mod manifest
├─ server/ # Optional: server-side extensions
│ ├─ tuning/ # incremental tuning overlays (*.jsonc)
│ └─ index.ts (or index.mjs / .js) # server script entry (auto-detected by default)
└─ client/ # Optional: client-side extensions
├─ packs/ # .vromfs.bin archive overlays
│ ├─ char.vromfs.bin/
│ ├─ aces.vromfs.bin/
│ ├─ gui.vromfs.bin/
│ ├─ lang.vromfs.bin/
│ ├─ mis.vromfs.bin/
│ ├─ game.vromfs.bin/
│ ├─ ui/atlases.vromfs.bin/
│ └─ ui/images.vromfs.bin/
├─ addon/ # 3D model & texture addon (res/*.grp, res/*.dxp.bin)
├─ 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
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.
| Field | Required | Type | Description |
|---|---|---|---|
format |
Yes | 1 |
Manifest schema version, currently fixed to integer 1 |
id |
Yes | string |
Globally unique mod ID matching /^[a-z0-9][a-z0-9._-]{0,63}$/ (lowercase letters, digits, ., _, -; must start with letter/digit; max 64 chars; <author>.<mod-name> recommended) |
name |
Yes | string | { [lang]: string } |
Display name as a plain string or locale map (e.g. zh-CN, en) |
version |
Yes | string |
Mod version string (SemVer such as 0.1.0 recommended) |
author |
Yes | string |
Author or team name |
description |
No | string | { [lang]: string } |
Short summary as a plain string or locale map |
api_version |
Yes | string |
Target API version tag, currently fixed to "0.1-experimental" |
game_versions |
No | string[] |
Supported game build wildcards (e.g. ["2.61.0.*"]); mismatches emit a warning without blocking launch |
requires |
No | string[] |
Required dependency mod IDs: missing or disabled dependencies raise a blocking error; also enforces load order (emits a dependency-order warning if placed above its dependency and participates in Auto-Sort) |
conflicts |
No | string[] |
Mutually incompatible mod IDs; enabling both raises a blocking error |
load_after |
No | string[] |
Optional mods this mod should load after (lower in the list = higher priority); does not require them to be enabled, and participates in order hints & Auto-Sort |
load_before |
No | string[] |
Optional mods this mod should load before; also participates in order hints & Auto-Sort |
server |
No | { entry?: string, tuning?: string } |
Explicit relative paths (no ..) overriding default auto-detection of server/index.{ts,mjs,js} and server/tuning |
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:
- Data / Assets (
data): containsserver/tuning/,client/packs/,client/addon/,client/files/, orclient/config-blk.patch.jsonc(a manifest-only mod with none ofgui/script/exealso defaults todata); - UI Patches (
gui): containsclient/gui-patches/; - Server Script (
script): contains an executable server JS/TS entry script; - Binary Patches (
exe): containsclient/exe-patches/(high-risk; guarded by the core offline isolation patch lock).
7. Load Order Rules & Conflict Detection
- Load order & priority: mods load top-to-bottom; items lower in the list (larger index) load later and take higher priority;
- One-click Auto-Sort: the launcher's Auto-sort by dependencies button topologically sorts mods using
requires,load_after, andload_beforetogether; - Additive merge (
info): when multiple mods patch the same BLK, CSV, ortuningfile, their edits stack cleanly in load order; - Order & override warnings (
warning): emitted when a mod sits above arequires/load_aftertarget, mismatchesgame_versions, or replaces an entire pack/companion file already modified by an earlier mod; - Blocking errors (
error): missingrequiresdependencies, disabled dependencies, or simultaneously enabledconflictsprevent launch and highlight the exact items to fix.