479 lines
27 KiB
Markdown
479 lines
27 KiB
Markdown
# 02 · Client Packs & BLK Incremental Patching
|
||
|
||
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:
|
||
|
||
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.blk` incremental patch:
|
||
|
||
```blk
|
||
// Stock readable text BLK (excerpt from char.vromfs.bin -> config/wpcost.blk)
|
||
us_m2a4 {
|
||
value:i = 0
|
||
rank:i = 1
|
||
economicRankHistorical:i = 0
|
||
rewardMulHistorical:r = 0.1
|
||
country:t = "country_usa"
|
||
unitClass:t = "exp_tank"
|
||
}
|
||
```
|
||
|
||
```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!
|
||
"@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 Directory | Common Contents | Backup 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.blk` | Always 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.blk` | Always 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 CSVs | Backed up on demand, restored on disable |
|
||
| `client/packs/mis.vromfs.bin/` | `gamedata/missions/.../*.blk` multiplayer and custom missions | Backed up on demand, restored on disable |
|
||
| `client/packs/game.vromfs.bin/` | `danetlibs/...`, `game/...` scripts and configs | Backed 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.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 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`)
|
||
|
||
| Syntax | Behavior |
|
||
| --- | --- |
|
||
| `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
|
||
|
||
| Syntax | Behavior | Notes |
|
||
| --- | --- | --- |
|
||
| `slaveUnit:t = "extra"` | **Append param** | Preserves existing same-named params (for repeated keys) |
|
||
| `"@override:economicRankArcade":i = 18` | **Set / overwrite** | Replaces first match and deduplicates, or appends if absent (do not quote `:i` / `:r` numbers) |
|
||
| `"@override-last:slaveUnit":t = "new"` | **Overwrite last match** | Replaces only the last same-named param without touching earlier entries (appends if absent) |
|
||
| `"@delete:showOnlyWhenBought":b = no` | **Delete first** matching param | Dummy type/value is ignored; no-op if absent |
|
||
| `"@delete-last:slaveUnit":t = ""` | **Delete last** matching param | Removes only the last same-named param |
|
||
| `"@delete-all:slaveUnit":t = ""` | **Delete all** matching params | Removes every param with that name in the current block |
|
||
|
||
#### ③ Block Directives
|
||
|
||
| Syntax | Behavior | Notes |
|
||
| --- | --- | --- |
|
||
| `Weapon { ... }` | **Add child block** | Appends a new sibling block without clobbering existing same-named blocks |
|
||
| `"@override:us_m2a4" { ... }` | **Edit existing block** | Supports `name[index]` (e.g. `"@override:range[0]"`); creates the block when absent without an index |
|
||
| `"@override-last:Weapon" { ... }` | **Edit last matching block** | Edits the last sibling with that name (creates if absent) |
|
||
| `"@replace:commonWeapons" { ... }` | **Replace block in place** | Replaces the matched block in place (preserving sibling order); supports `name[index]` |
|
||
| `"@delete:commonWeapons" {}` | **Delete first** matching block | Supports `name[index]`; body must be empty |
|
||
| `"@delete-last:Weapon" {}` | **Delete last** matching block | Removes only the last sibling with that name; body must be empty |
|
||
| `"@delete-all:Weapon" {}` | **Delete all** same-named blocks | Removes all sibling blocks with that name; body must be empty |
|
||
| `"@clone:Weapon" { ... }` / `"@clone-last:Weapon" { ... }` | **Same-name clone** | Deep-clones the first/last sibling with that name, appends it, and applies body edits |
|
||
| `"@clone:us_m2a4->us_m2a4_mod" { ... }` | **Clone under new name** | Deep-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 block** | Copies params/blocks from a sibling or root template block into the current block (optional body applies overrides) |
|
||
| `"@after:<anchor>:<newName>" { ... }` / `"@before:<anchor>:<newName>" { ... }` | **Anchored insertion** | Inserts 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.
|
||
|
||
#### 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
|
||
{
|
||
"op": "setParam",
|
||
"path": ["us_m2a4"],
|
||
"name": "rewardMulHistorical",
|
||
"value": { "type": "real", "value": 1.2 },
|
||
"createBlocks": false // Optional (default false); set true to auto-create missing blocks along path
|
||
}
|
||
```
|
||
|
||
#### ② `addParam`: Append a duplicate-named parameter (preserves existing entries; ideal for `slaveUnit`, `folder`, `aircraftGift`)
|
||
|
||
```jsonc
|
||
{
|
||
"op": "addParam",
|
||
"path": ["country_usa", "army", "range[0]", "us_m2a4"],
|
||
"name": "slaveUnit",
|
||
"value": "my_extra_launcher"
|
||
}
|
||
```
|
||
|
||
#### ③ `removeParam`: Delete parameters (deletes all matching `name` when `value` is omitted, or only entries matching `value`)
|
||
|
||
```jsonc
|
||
{
|
||
"op": "removeParam",
|
||
"path": ["us_m2a4"],
|
||
"name": "showOnlyWhenBought"
|
||
}
|
||
```
|
||
|
||
#### ④ `upsertBlock`: Find or create a child block and append `params` & `blocks`
|
||
|
||
```jsonc
|
||
{
|
||
"op": "upsertBlock",
|
||
"path": ["country_usa", "army", "range[0]", "my_custom_tank"],
|
||
"block": {
|
||
"params": [
|
||
{ "name": "rank", "value": { "type": "int", "value": 8 } },
|
||
{ "name": "reqAir", "value": "us_m1a2_sep2_abrams" }
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
> **Important Behavior Note (Avoid Duplicate Keys)**: If the target block along `path` **does not exist**, `upsertBlock` creates it and populates `block.params` and `block.blocks`. However, if the target block **already exists**, `upsertBlock` **appends** every entry in `block.params` (via `appendParam`) and `block.blocks` to the end of the block **without overwriting existing same-named parameters**! Use `upsertBlock` to create new blocks or append multi-value params; **to overwrite an existing parameter on an existing block, always use `setParam`**.
|
||
|
||
#### ⑤ `addBlock`: Insert a new child block under a parent (supports `before` / `after` sibling anchors)
|
||
|
||
```jsonc
|
||
{
|
||
"op": "addBlock",
|
||
"path": ["country_usa", "army", "range[0]"],
|
||
"name": "my_custom_tank",
|
||
"after": "us_m3a1_stuart",
|
||
"block": {
|
||
"params": [
|
||
{ "name": "rank", "value": { "type": "int", "value": 1 } },
|
||
{ "name": "reqAir", "value": "us_m2a4" }
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
#### ⑥ `removeBlock`: Delete a child block at `path`
|
||
|
||
```jsonc
|
||
{
|
||
"op": "removeBlock",
|
||
"path": ["country_usa", "army", "range[0]", "some_vehicle"]
|
||
}
|
||
```
|
||
|
||
#### ⑦ `cloneBlock`: Deep-clone an existing block in the same file under `newName` with nested `ops` (essential for derived vehicles!)
|
||
|
||
In `wpcost.blk` and `unittags.blk`, each vehicle block contains dozens of repair, crew, modification, and weapon-preset sub-blocks. `cloneBlock` copies a stock donor vehicle completely in one step and lets you tweak only the differences via nested `ops`:
|
||
|
||
```jsonc
|
||
{
|
||
"op": "cloneBlock",
|
||
"from": ["us_m1a2_sep2_abrams"],
|
||
"toParent": [],
|
||
"newName": "us_m1a2_mod_example",
|
||
"replaceExisting": true,
|
||
"ops": [
|
||
{ "op": "setParam", "path": [], "name": "value", "value": { "type": "int", "value": 10000 } },
|
||
{ "op": "setParam", "path": [], "name": "reqExp", "value": { "type": "int", "value": 50000 } },
|
||
{ "op": "setParam", "path": [], "name": "economicRankHistorical", "value": { "type": "int", "value": 34 } }
|
||
]
|
||
}
|
||
```
|
||
|
||
> Note: Nested `ops` inside `cloneBlock` run with **the newly cloned block itself as the root**, so use `"path": []` when editing top-level fields on the cloned block.
|
||
|
||
### 4.3 All 13 BLK Data Types
|
||
|
||
When you write a plain JSON primitive, the patcher infers the BLK type from any existing parameter of the same name on that block (falling back to `string`, `bool`, `int` for integers, or `real` for non-integers). To guarantee exact binary types—especially when setting a float parameter to a whole number like `2.0`, which JSON parses as integer `2`—write `{ "type": "<type>", "value": <val> }`:
|
||
|
||
| `type` | Text BLK Suffix | `value` Example & Notes |
|
||
| --- | --- | --- |
|
||
| `string` | `:t` | `"us_m2a4"` |
|
||
| `int` | `:i` | `120` (signed 32-bit integer) |
|
||
| `real` | `:r` | `1.5` (encoded strictly as 32-bit float `:r` even if written as `2`) |
|
||
| `bool` | `:b` | `true` / `false` (`yes` / `no` in text BLK) |
|
||
| `int64` | `:i64` | `"133700000000000000"` or integer (signed 64-bit integer) |
|
||
| `point2` | `:p2` | `[1.0, 2.5]` (2 floats) |
|
||
| `point3` | `:p3` | `[0.0, 1.5, -2.0]` (3 floats) |
|
||
| `point4` | `:p4` | `[0.0, 1.0, 0.0, 1.0]` (4 floats) |
|
||
| `ipoint2` | `:ip2` | `[10, 20]` (2 integers) |
|
||
| `ipoint3` | `:ip3` | `[1, 2, 3]` (3 integers) |
|
||
| `ipoint4` | `:ip4` | `[0, 1, 2, 3]` (4 integers) |
|
||
| `color` | `:c` | `[255, 128, 0, 255]` (`[r, g, b, a]`) or unsigned packed integer `0xAARRGGBB` |
|
||
| `matrix` | `:m` | Array of 12 floats (4×3 transform matrix) |
|
||
|
||
---
|
||
|
||
## 5. Battle Rating (BR) ↔ Internal `mrank` (`economicRank*`) Conversion & Lookup Table
|
||
|
||
A classic question when opening `wpcost.blk` for the first time is: **why are there no `11.7` or `12.7` Battle Rating numbers anywhere in the file?**
|
||
|
||
Internally, War Thunder stores displayed **Battle Ratings (BR)** as zero-based non-negative integers called **`mrank`** (stored in `economicRank*` fields), where **every 3 integer steps equal `1.0` BR** and fractional steps cycle `.0` → `.3` → `.7`:
|
||
|
||
- **Forward formula (`mrank` → displayed BR)**: `BR = 1.0 + Math.floor(mrank / 3) + [0, 0.3, 0.7][mrank % 3]`
|
||
- **Reverse formula (displayed BR → `mrank`)**: `(wholePart - 1) × 3` plus the decimal step (`+0` for `.0`, `+1` for `.3`, `+2` for `.7`). For example, `11.7` → `(11 - 1) × 3 + 2 = 32`!
|
||
|
||
### 5.1 Complete `mrank` ↔ Displayed BR Lookup Table
|
||
|
||
| `mrank` | Displayed BR | `mrank` | Displayed BR | `mrank` | Displayed BR | `mrank` | Displayed BR |
|
||
| --- | --- | --- | --- | --- | --- | --- | --- |
|
||
| `0` | **1.0** | `10` | **4.3** | `20` | **7.7** | `30` | **11.0** |
|
||
| `1` | **1.3** | `11` | **4.7** | `21` | **8.0** | `31` | **11.3** |
|
||
| `2` | **1.7** | `12` | **5.0** | `22` | **8.3** | `32` | **11.7** |
|
||
| `3` | **2.0** | `13` | **5.3** | `23` | **8.7** | `33` | **12.0** |
|
||
| `4` | **2.3** | `14` | **5.7** | `24` | **9.0** | `34` | **12.3** |
|
||
| `5` | **2.7** | `15` | **6.0** | `25` | **9.3** | `35` | **12.7** |
|
||
| `6` | **3.0** | `16` | **6.3** | `26` | **9.7** | `36` | **13.0** |
|
||
| `7` | **3.3** | `17` | **6.7** | `27` | **10.0** | `37` | **13.3** |
|
||
| `8` | **3.7** | `18` | **7.0** | `28` | **10.3** | `38` | **13.7** |
|
||
| `9` | **4.0** | `19` | **7.3** | `29` | **10.7** | `39` | **14.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 Name | Value Range | Meaning |
|
||
| --- | --- | --- |
|
||
| `rank` | `1` .. `8` | **Tech-Tree Era Tier (Rank I – VIII)**: controls which horizontal tier row the vehicle occupies, tier unlock gates, and default store rank-tier pricing |
|
||
| `economicRankArcade` | `0` .. `39+` | **Arcade Battles (AB)** matchmaking `mrank` |
|
||
| `economicRankHistorical` | `0` .. `39+` | **Realistic Battles (RB)** default matchmaking `mrank` (RB was originally called *Historical Battles*) |
|
||
| `economicRankSimulation` | `0` .. `39+` | **Simulator Battles (SB)** default matchmaking `mrank` |
|
||
| `economicRankTankHistorical` | `0` .. `39+` | *(Optional)* Split **Ground RB** `mrank` for aircraft/helicopters with separate air vs ground BRs; falls back to `economicRankHistorical` when omitted |
|
||
| `economicRankTankSimulation` | `0` .. `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:
|
||
|
||
```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.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 Pattern | Where It Appears in Game | Example (for `us_m2a4_mod_demo`) |
|
||
| --- | --- | --- |
|
||
| `<id>_shop` | **Tech-tree card, crew slot bar, and local web store card** short name | `"M2A4 (Mod Demo)"` / `"M2A4(教学改型)"` |
|
||
| `<id>_0` | **Stat-card header, research completion modal, and battle debriefing** full formal title | `"Light Tank M2A4 (Mod Demo)"` / `"M2A4 轻型坦克(教学改型)"` |
|
||
| `<id>_1` | In-battle **medium-distance 3D HUD marker** name | `"M2A4 Demo"` / `"M2A4 教学型"` |
|
||
| `<id>_2` | In-battle **far-distance HUD marker / compact killfeed** short name | `"M2A4"` / `"M2A4"` |
|
||
|
||
Example `client/packs/lang.vromfs.bin/lang/units.csv.patch.csv`:
|
||
|
||
```csv
|
||
"<ID|readonly|noverify>";"<English>";"<Chinese>";"<HChinese>"
|
||
"us_m2a4_mod_demo_shop";"M2A4 (Mod Demo)";"M2A4(教学改型)";"M2A4(教學改型)"
|
||
"us_m2a4_mod_demo_0";"Light Tank M2A4 (Mod Demo)";"M2A4 轻型坦克(教学改型)";"M2A4 輕型坦克(教學改型)"
|
||
"us_m2a4_mod_demo_1";"M2A4 Demo";"M2A4 教学型";"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.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!
|
||
|
||
### 8.1 Mod Folder Tree
|
||
|
||
Create `demo-standalone-m2a4/` inside your global `mods/` directory:
|
||
|
||
```text
|
||
mods/demo-standalone-m2a4/
|
||
├─ mod.jsonc
|
||
└─ client/
|
||
└─ packs/
|
||
├─ aces.vromfs.bin/
|
||
│ └─ gamedata/units/tankmodels/
|
||
│ └─ us_m2a4_mod_demo.blk # ① Inherits stock us_m2a4.blk via include & boosts speed
|
||
├─ char.vromfs.bin/
|
||
│ └─ config/
|
||
│ ├─ 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
|
||
```
|
||
|
||
### 8.2 Complete File Contents
|
||
|
||
#### Manifest `mod.jsonc`
|
||
|
||
```jsonc
|
||
{
|
||
"format": 1,
|
||
"id": "demo.standalone-m2a4",
|
||
"name": {
|
||
"zh-CN": "独立衍生载具示例:M2A4 教学改型",
|
||
"en": "Standalone Vehicle Demo: M2A4 Mod Demo"
|
||
},
|
||
"version": "0.1.0",
|
||
"author": "YourName",
|
||
"description": {
|
||
"zh-CN": "克隆原版 us_m2a4 新增一辆独立可研发、可试驾的 90km/h 高速轻坦。",
|
||
"en": "Clones stock us_m2a4 into a playable 90 km/h standalone tank in the US Rank I tree."
|
||
},
|
||
"api_version": "0.1-experimental",
|
||
"game_versions": ["2.61.0.*"]
|
||
}
|
||
```
|
||
|
||
#### ① Tank Model Definition `client/packs/aces.vromfs.bin/gamedata/units/tankmodels/us_m2a4_mod_demo.blk`
|
||
|
||
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.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.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:
|
||
|
||
```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!
|