Expand description
§war3parser
A library for parsing and extracting Warcraft III map files
(.w3x / .w3m).
§Crate layout
archive— the map container: optionalHM3Wheader + embedded MPQcarve— metadata salvage for archives whose MPQ tables are unreadableformats— parsers for the member files (w3i,wts,imp,mmp)model— portable data structures shared by CLI / WASM / library usersreader— bounds-checked little-endianreader::ByteReadererror— the crate-wideerror::Errortype
The war3map.w3i parser supports the full format-version ladder
v8 → v33 (Reign of Chaos betas through WC3 2.0); see
formats::w3i::FormatVersion.
§Features
| Feature | Default | Purpose |
|---|---|---|
serde | yes | JSON serialization for dumps and the WASM bridge |
carve | yes | carve salvage for unreadable archives (pulls in flate2) |
§Example
ⓘ
use war3parser::prelude::*;
let buffer = std::fs::read("path/to/map.w3x")?;
let mut metadata = War3MapMetadata::parse(&buffer)?;
metadata.resolve_trigger_strings();
let snapshot = metadata.snapshot()?;
println!("{:?}", snapshot.map_info.map(|i| i.name));Modules§
- archive
- Map container: optional
HM3Wheader followed by an embedded MPQ archive. - carve
- Metadata recovery for archives whose MPQ tables cannot be read.
- error
- Crate-wide error type.
- formats
- Parsers for the individual file formats found inside a map archive.
- model
- Portable, reusable data model shared by the library, CLI, and WASM bindings.
- modscan
- Detection of known third-party modifications injected into map scripts.
- prelude
- The most commonly used types in one import.
- reader
- Zero-copy little-endian cursor over a byte slice.
Structs§
- Import
Entry - Single import path as exposed to CLI/WASM consumers.
- MapSnapshot
- Portable map snapshot shared by the CLI, WASM bindings, and serde dumps.
- ModInfo
- A modification recognised inside a map script.
- String
Table Entry - Single WTS entry as exposed to CLI/WASM consumers.
- War3
Image - Raster image held in memory (not directly serializable).
- War3
Image Data - Portable image representation used by CLI dumps and WASM.
- War3
MapHeader - Fields of the optional
HM3Wprefix that precedes the embedded MPQ. - War3
MapMetadata - Rich in-memory parse result.
- War3
MapW3x - A Warcraft III map file (
.w3x/.w3m): optionalHM3Wheader plus the embedded MPQ archive.
Enums§
- Error
- Errors produced while parsing map files or converting assets.