Rust tools and libraries for Neverwinter Nights: Enhanced Edition.
Install:
cargo install --git https://github.com/urothis/nwnrs --bin nwnrsUsage:
nwnrs new --kind utc my_creature
nwnrs inspect path/to/file.utc
nwnrs compile -g -o out/script.ncs path/to/script.nss
nwnrs compile -R -d out scripts/
nwnrs compile -R -d out --graphviz graphs scripts/
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 exportdocker: reproducible Linux AMD64/ARM64 dedicated server container images built from internally staged assets
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