Files
WT-Offline/mod-dev-docs/en/03-custom-3d-vehicles.md
T

34 lines
2.5 KiB
Markdown

# 03 · Adding Custom 3D Vehicle Models & Textures
## 1. How 3D Asset Mounting Works
Verified directly against 2.61.0.x `aces.exe` (`dlContent.cpp`) and `config/settings.blk`:
- Any addon path under `/pkg_user/` skips the `res/grp_hdr.vromfs.bin` check and directly scans `<addon>/res/` for all `.grp` (3D geometry/skeleton/collision) and `.dxp.bin` (DDSx texture) archives;
- If a mod ships a compiled CDK `res/grp_hdr.vromfs.bin`, the patcher mounts it under `content/pkg_wto_<modId>` so the native `grp_hdr` loader handles it;
- The patcher automatically registers all enabled mod addon folders in `aces.vromfs.bin` `config/settings.blk` (`addons`, `addons_no_check`, `addonsWithBasePath`).
### Cross-Drive Zero-Copy Mounting
Each mod's `client/addon/` is mounted into `<copy>/content/pkg_user/<safeModId>` via a **Windows NTFS Directory Junction**:
- Works across drives (e.g. `mods/` on C: or D:, client on J:);
- Requires no administrator privileges;
- Uses 0 extra bytes and mounts/unmounts in ~1 ms without touching source files in `mods/`.
---
## 2. 6-Step Checklist for a Custom 3D Vehicle
1. **`client/addon/res/<unit>.grp` + `<unit>.dxp.bin`**: 3D model and textures exported via War Thunder CDK;
2. **`client/packs/aces.vromfs.bin/gamedata/units/.../<unit>.blk`**: vehicle FM/DM/weapons (plain text BLK compiles automatically);
3. **`client/packs/char.vromfs.bin/config/wpcost.blk.patch.jsonc`**: economy, BR, modifications (use `cloneBlock` from a similar stock vehicle);
4. **`client/packs/char.vromfs.bin/config/shop.blk.patch.jsonc`** & **`unittags.blk.patch.jsonc`**: tech tree slot and unit tags;
5. **`client/packs/lang.vromfs.bin/lang/units.csv.patch.csv`**: localized names (`_shop`, `_0`, `_1`, `_2`);
6. **`client/packs/ui/atlases.vromfs.bin/gameuiskin/<lowercase_unit>_ico.svg`** & optional **`ui/images.vromfs.bin/units/<unit>.ddsx`**: silhouette icon (used in tech tree and local web store) and statcard image.
---
## 3. Native Skins, Sights & Companion Files Boundary
- Standalone user skins (`UserSkins/`), sights (`UserSights/`), and missions (`UserMissions/`) continue to use the game's native folders and are never managed or deleted by the launcher.
- Large overhaul/vehicle mods may optionally bundle companion skins, sights, or sound banks under `client/files/`. Exclusive subdirectories under `UserSkins/`, `UserSights/`, and `UserMissions/` mount via cross-drive Junctions; any target colliding with a player-owned native file is skipped with a warning and never overwritten.