feat(mods): compose shared tech tree insertions

Accept manifest declarations for inserting vehicles into an existing research link. Compose shared links in mod load order after ordinary overlays and write matching shop and economy prerequisites. Validate anchors, rank order, and cycles, and document the manifest field.

Verified type checks, a 2.61.0.64 build with shared, folded, and cross-column insertions, load-order and disable readback, and the local server health endpoint. In-game acceptance remains pending.
This commit is contained in:
N0VAN0M4LY committed 2026-12-05 18:36:50 +08:00
1 parent 0843fde6ff
commit f86ab99c17
11 files changed
+313 -10

No files matched your search

+1
View File
@@ -141,6 +141,7 @@ Manifest parsing enforces **strict whitelist validation**: typos or unknown keys
| `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** |
| `tech_tree_insertions` | No | `{ vehicle: string, after: string, before: string }[]` | Inserts vehicles into an existing research link in mod load order. [Example](02-client-packs-and-blk.md#63-inserting-vehicles-into-the-same-research-link) |
| `server` | No | `{ entry?: string, tuning?: string }` | Explicit relative paths (no `..`) overriding default auto-detection of `server/index.{ts,mjs,js}` and `server/tuning` |
---
+15 -1
View File
@@ -328,7 +328,7 @@ Keep three rules in mind when writing `shop.blk.patch.blk` (or `.patch.jsonc`):
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;
- With `reqAir:t="us_m2a4"` in `wpcost.blk`, completing research on `us_m2a4` unlocks research on this vehicle. Buying this vehicle requires owning `us_m2a4`.
- 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
@@ -357,6 +357,20 @@ Example `client/packs/lang.vromfs.bin/lang/units.csv.patch.csv`:
---
### 6.3 Inserting Vehicles into the Same Research Link
Supply the vehicle definition and its `wpcost.blk` entry, then declare the research link in `mod.jsonc`. In 2.61.0.64, the F-15C MSIP II follows the F-15A.
```jsonc
"tech_tree_insertions": [
{ "vehicle": "my_fighter", "after": "f_15a", "before": "f_15c_msip2" }
]
```
- `vehicle` is the mod vehicle ID. `after` and `before` are the existing predecessor and successor IDs. The builder checks that `before` requires `after` in `wpcost.blk` after the ordinary overlays. When migrating a manual insertion, remove the successor's manual `reqAir` edits so the builder can handle the link.
- Use regular vehicles from the same nation and branch, with ranks in nondecreasing order. The builder creates a shop entry or reuses one already declared on the same page. An insertion between members of a folder goes inside that folder. An insertion across columns goes in the successor's column.
- Multiple mods targeting the same link compose `A → X → Y → B` in the launcher's top-to-bottom order. Reordering or toggling mods rebuilds the chain from stock and the current selection. A missing anchor, a changed link, or a cycle produces a build error naming the mod and vehicles.
## 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):