docs(mods): align handbook chapters with .patch.blk and UI image format notes

This commit is contained in:
N0VAN0M4LY committed 2026-12-04 02:52:47 +08:00
1 parent 0af4183cb1
commit 37cbcd806f
9 files changed
+26 -26

No files matched your search

+2 -2
View File
@@ -118,7 +118,7 @@ Create only the subdirectories your mod actually uses—unused folders can be om
├─ 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)
```
---
@@ -149,7 +149,7 @@ Manifest parsing enforces **strict whitelist validation**: typos or unknown keys
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`)**: contains `server/tuning/`, `client/packs/`, `client/addon/`, `client/files/`, or `client/config-blk.patch.jsonc` (a manifest-only mod with none of `gui`/`script`/`exe` also defaults to `data`);
- **Data / Assets (`data`)**: contains `server/tuning/`, `client/packs/`, `client/addon/`, `client/files/`, or `client/config-blk.patch.blk` (or `.patch.jsonc`) (a manifest-only mod with none of `gui`/`script`/`exe` also defaults to `data`);
- **UI Patches (`gui`)**: contains `client/gui-patches/`;
- **Server Script (`script`)**: contains an executable server JS/TS entry script;
- **Binary Patches (`exe`)**: contains `client/exe-patches/` (high-risk; guarded by the core offline isolation patch lock).
+4 -4
View File
@@ -48,8 +48,8 @@ Place your files under `client/packs/<pack-path>/` matching the target archive's
| `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) | 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 |
| `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.
@@ -145,7 +145,7 @@ commonWeapons {
- 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)
@@ -322,7 +322,7 @@ country_usa (or country_germany / country_ussr / country_britain / country_japan
└─ range { ... } <-- range[5]..range[6]: right-hand Golden Eagle / Pack / Event / Squadron columns
```
Keep three rules in mind when writing `shop.blk.patch.jsonc`:
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`;
+4 -4
View File
@@ -44,9 +44,9 @@ mods/demo-new-mbt/
│ └─ 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)
@@ -68,7 +68,7 @@ mods/demo-new-mbt/
## 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 A: Regular Silver Lions Tech-Tree Vehicle (Recommended If You Want AI Bots to Drive It)
@@ -35,7 +35,7 @@ All mod build and runtime logs flow into the launcher's standard log directory
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`)**:
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.
@@ -77,7 +77,7 @@ my-awesome-mod.zip
## 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`;
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.