From 36fe7a9aeb69be3813b7a3ac44dcac8b0d995406 Mon Sep 17 00:00:00 2001 From: Danny Bierek Date: Fri, 13 Sep 2024 00:57:10 -0700 Subject: [PATCH] Fix error handling and main runner, update readme --- README.md | 9 +++------ src/extract/aloc_extraction.rs | 2 +- src/main.rs | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9f1c83c..66efc02 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,12 @@ ![Maintenance](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg) -`glacier2obj` provides functionality to search for mesh (PRIM) files with a Glacier scene from the Hitman games. Eventually it will also convert them into an OBJ file. +`glacier2obj` provides functionality to search for mesh collision (ALOC) files with a Glacier scene from the Hitman games. ## Features -- Read from Glacier scene files and search for PRIM files using [`rpkg-rs`](https://github.com/dafitius/rpkg-rs) - -## Future Plans - -- Convert all PRIMs to a single OBJ file for use with [`recastnavigation-glacier`](https://github.com/dbierek/recastnavigation-glacier). +- Communicate with the Editor SDK mod for Hitman 3 for a loaded mission to get collision (ALOC) hashes and transforms, and Pathfinder box transforms and save them to files +- Extract the ALOC files using [`rpkg-rs`](https://github.com/dafitius/rpkg-rs) ## Contributions Bug reports, PRs and feature requests are welcome. diff --git a/src/extract/aloc_extraction.rs b/src/extract/aloc_extraction.rs index 8c8100d..0dbf33f 100644 --- a/src/extract/aloc_extraction.rs +++ b/src/extract/aloc_extraction.rs @@ -30,7 +30,7 @@ impl AlocExtraction { for hash in chunk { i += 1; let runtime_folder_path = PathBuf::from(runtime_folder_ref); - let rrid: RuntimeResourceID = RuntimeResourceID::from_hex_string(hash.as_str()).unwrap(); + let rrid: RuntimeResourceID = RuntimeResourceID::from_hex_string(hash.as_str()).expect(format!("Error getting RRID from hash: {}", hash.as_str()).as_str()); let resource_info = PackageScan::get_resource_info(partition_manager, &rrid).unwrap(); let last_partition = resource_info.last_partition; let package_path = runtime_folder_path.join(last_partition.clone()); diff --git a/src/main.rs b/src/main.rs index 4154fc8..bdf8c65 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,8 +4,8 @@ use glacier2obj::{connect::game_connection::GameConnection, extract::aloc_extrac pub fn main() { let args: Vec = env::args().collect(); - if args.len() < 7 { - eprintln!("Usage: cargo run "); + if args.len() < 6 { + eprintln!("Usage: cargo run "); return; }