Skip to content

Commit

Permalink
Fix error handling and main runner, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dbierek committed Sep 13, 2024
1 parent 8c60618 commit 36fe7a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion src/extract/aloc_extraction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use glacier2obj::{connect::game_connection::GameConnection, extract::aloc_extrac

pub fn main() {
let args: Vec<String> = env::args().collect();
if args.len() < 7 {
eprintln!("Usage: cargo run <path to a Retail directory> <game version (H2016 | HM2 | HM3)> <path to alocs.json file> <path to pfBoxes.json file> <path to a Runtime directory> <path to output prim directory>");
if args.len() < 6 {
eprintln!("Usage: cargo run <path to a Retail directory> <game version (H2016 | HM2 | HM3)> <path to alocs.json file> <path to pfBoxes.json file> <path to a Runtime directory> <path to output aloc directory>");
return;
}

Expand Down

0 comments on commit 36fe7a9

Please sign in to comment.