Rust tools and libraries for Neverwinter Nights
nwnrs is a workspace for reading, writing, inspecting, and converting NWN
data.
It includes:
- Rust crates for formats like
GFF,2DA,TLK,SSF,ERF,KEY/BIF,MDL,TGA,DDS,PLT, andNWSync - a CLI for operational workflows such as inspection, NWScript packing/compilation, conversion, packing, and unpacking
The canonical guided documentation now lives in the nwnrs-types crate docs:
Operational and interface-specific docs live here:
Install:
cargo install --git https://github.com/urothis/nwnrs --bin nwnrsUse:
nwnrs new --kind utc my_creature
nwnrs inspect path/to/file.utc
nwnrs pack --debug path/to/script.nss out/script.ncs
nwnrs convert input.png output.tga
nwnrs convert path/to/model.mdl out/model_ascii.mdl
nwnrs convert out/model_ascii.mdl rebuilt/model.mdl
nwnrs convert path/to/model.mdl out/model.obj
nwnrs unpack path/to/module.mod -d out/
nwnrs pack out/ rebuilt.mod[dependencies]
nwnrs-types = { git = "https://github.com/urothis/nwnrs" }use nwnrs_types::{
gff::{GffRoot, GffValue},
twoda::TwoDa,
};
let mut root = GffRoot::new("UTC ");
root.put_value("Tag", GffValue::CExoString("nw_chicken".to_string()))?;
let mut table = TwoDa::new();
table.set_columns(vec!["Label".to_string()])?;
# let _ = (root, table);
# Ok::<(), Box<dyn std::error::Error>>(())nwnrs-types: umbrella crate and guided entry pointnwnrs-types::resman: shared resource lookupnwnrs-types::install: install discovery and conventional layered resource assemblynwnrs: command-line inspection, conversion, packing, and unpacking workflowsnwnrs-nwscript: NWScript frontend and compilernwnrs-types::mdl: MDL parsing, lowering, composition, and export
Install Rust with rustup.
This workspace pins its compiler toolchain through
rust-toolchain.toml, so a normal cargo invocation
will automatically use the expected nightly once it is installed.
From the repository root, the main validation commands are:
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --all -- --check