8.1 KiB
8.1 KiB
07 · Troubleshooting, Logs, Reload Loop & Packaging
1. Where to Check Logs When Something Goes Wrong
All mod build and runtime logs flow into the launcher's standard log directory—open Settings › Diagnostics › Open logs folder or About › Export diagnostics:
- Launcher Main Log (
launcher.log):- Filter
[build]: see which mods ran in the current build,.vromfs.binoverlay counts, and exact reasons why anygui-patchesorexe-patchesitem was skipped; - Filter
[mods]: see cross-drive Junction mounts, skipped native player-file collision warnings, and restored on-demand stock packs; - Filter
[server]or[mod:<yourModId>]: see servertuningvalidation errors, script load stack traces, and everything printed viactx.logger.info/warn/error.
- Filter
- Game Client Runtime Logs (
<copyFolder>/.game_logs/*.clog):- If a client UI script throws at runtime or hangs on "Loading", check the newest
.clog(and runsq.exefull bytecode verification from Chapter 04); - If a custom 3D model fails to appear, search
.clogfor[PACK],pkg_user, or your asset name to confirm engine mounting.
- If a client UI script throws at runtime or hangs on "Loading", check the newest
2. Common Issues & Solutions Lookup Table
| Symptom / Log Message | Common Cause | Solution |
|---|---|---|
| Discovery error on Launcher Mods page | mod.jsonc syntax error, unknown field name, uppercase/invalid id, or missing server.entry file |
Validate mod.jsonc against the schema table in Chapter 01 Section 5 |
| "Blocking mod errors" when clicking Launch | Missing or disabled requires dependency, or two enabled mods declaring conflicts |
Enable the missing dependency or disable one of the conflicting mods highlighted in red |
server/tuning/*.jsonc changes appear ignored |
Test client has a manual override saved in the Launcher Tuning tab (<dataFolder>/tuning/*.jsonc has highest priority), or store.jsonc placed vehiclePacks subkeys at root |
Reset overridden fields in the Launcher Tuning tab and check vehiclePacks nesting + "gjn" key names in Chapter 05 |
Server .ts fails with syntax or module-not-found error |
Raw .ts used enum/namespace, or value-imported import { ... } from '@wto/mods' |
Replace enum with as const + union type; use import type { ... } from './server-api.ts' for types |
gui-patches fails with the data pack has no script ... |
variant.file in patch.jsonc used camelCase / uppercase letters (e.g. scripts/gameModes/...) |
Change variant.file to all lowercase (e.g. scripts/gamemodes/gamemodeselect.nut) |
Standalone .css stylesheet has no effect |
Added .css to client/packs/gui.vromfs.bin/ without registering it in gui/css.css |
Add a client/gui-patches/ patch on gui/css.css appending @import "folder\style.css" (Chapter 04 Section 2.2) |
Client matchingApiFunc callback does not fire or params arrive empty |
Swapped the 2nd and 3rd arguments of matchingApiFunc |
Use matchingApiFunc(methodName, callback, params) (callback is 2nd, params is 3rd) |
| Game hangs indefinitely on "Loading" before hangar | Resulting complete .nut file has a lexical scope collision, undeclared identifier, base keyword misuse, or backtick string `...` |
Run sq.exe compilestring on the complete .nut file and use $"..." for string interpolation |
Log reports overlaps protected core patch |
Mod client/exe-patches/ overlaps locked core offline/isolation patch bytes |
Core isolation bytes are protected; pick a non-overlapping site or use a server-side hook |
Log reports target already exists as a native/player file |
A path under client/files/ collides with a player-owned file in UserSkins/ or UserSights/ |
Prefix bundled companion subfolders with your mod namespace (e.g. mod_<yourId>_...) |
3. Development Reload Loop (Fastest Edit-Test Cycle)
Knowing when client builds versus server scripts reload keeps iteration fast while developing:
- 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
mtimetimestamps into a deterministic build fingerprint, automatically rebuilding any affected.vromfs.binpacks fromwtoffline/stock/before starting the game! - Tip: textures inside already-mounted NTFS Junction directories (
client/addon/res/orclient/files/UserSkins/<subfolder>/) point directly to yourmods/folder with zero copying, so restarting the client (or refreshing skins in-game) reads updated assets immediately.
- Server-side edits (
server/index.ts&server/tuning/*.jsonc):- Every time you exit the game and click Launch to start a new session, the local server restarts cleanly, re-merges all
server/tuning/*.jsoncoverlays, and reloadsserver/index.tswith a cache-busting ESM query (?wto_mod=<timestamp>)—no need to restart the launcher itself.
- Every time you exit the game and click Launch to start a new session, the local server restarts cleanly, re-merges all
4. Packaging & Sharing Your Mod (.zip Layout Rules)
When packaging your mod for players to download, follow a consistent archive structure so unzipping into mods/ works every time:
- Wrap your mod in a single top-level
<mod-folder>/directory inside the.zip: For a mod folder namedmy-awesome-mod, structuremy-awesome-mod.zipas:
my-awesome-mod.zip
└─ my-awesome-mod/ <-- Single top-level folder (extracting straight into mods/ yields mods/my-awesome-mod/mod.jsonc)
├─ mod.jsonc
├─ client/
└─ server/
- Do NOT place
mod.jsoncloose at the root of the.zip(extracting intomods/scatters loose files acrossmods/where discovery ignores them); - Do NOT double-nest folders (
my-awesome-mod/my-awesome-mod/mod.jsonc), as the launcher scans direct child directories ofmods/only!
- Exclude development & temporary clutter:
Omit
.git/,node_modules/(bundle third-party JS dependencies into a singleserver/index.mjsif needed),.DS_Store,Thumbs.db, editor backup files (*.bak,*.swp), and any unpacked stock game reference files.
5. Cross-Drive & Non-NTFS Disk Behavior
- NTFS Volumes (standard on Windows):
client/addon/(3D models & textures) and mod-exclusive subfolders (e.g.UserSkins/<subfolder>) mount via NTFS Directory Junctions—works across drives, requires no admin rights, uses 0 extra disk space, and completes in ~1 ms; - Shared Flat-Folder Files (e.g.
sound/mod/*.bank): tries file symlink (zero-copy across drives when Windows Developer Mode is on) → same-drive NTFS hardlink → incremental size/mtime cached copy (unchanged files are skipped on subsequent launches); - exFAT External Drives: since exFAT does not support Junctions or hardlinks, the deployer automatically falls back to incremental size/mtime cached copies with full functional parity.
6. Practical Recommendations for Mod Authors
- 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; - Prefer Incremental Patches Over Replacing Shared Tables: use
.patch.blk(or.patch.jsonc) /.patch.csvforshop.blk,wpcost.blk,unittags.blk,units.csv, andmenu.csv, and use$listOpson shared tuning arrays likemultiVehiclePacksandsupplyTrophies; - 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; - Keep UI Logic in Standalone Files: put custom modals under
client/packs/gui.vromfs.bin/and keepclient/gui-patches/down to a few lines wiring the entry button andgui/css.css@importso game updates rarely break your mod; - 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.