Fix traffic archive extraction workflow

This commit is contained in:
2026-06-19 20:48:08 -05:00
parent 20daac34e5
commit 355b135d69
3 changed files with 126 additions and 28 deletions
+16 -5
View File
@@ -21,13 +21,24 @@ pack_root="${work_dir}/${mod_name}"
packed_dir="${work_dir}/05_packed"
resource_dir=$(dirname "${resource_path}")
resource_file=$(basename "${resource_path}")
resource_hash=3419764573789342681
mkdir -p "${raw_dir}" "${json_dir}" "${patched_json_dir}" "${patched_raw_dir}" "${pack_root}/${resource_dir}" "${packed_dir}"
mkdir -p "${raw_dir}/${resource_dir}" "${json_dir}" "${patched_json_dir}" "${patched_raw_dir}" "${pack_root}/${resource_dir}" "${packed_dir}"
tools/cp77_toolbox.sh extract "${archive_path}" \
--gamepath "${game_dir}" \
--outpath "${raw_dir}" \
--regex "${resource_regex}"
if [[ -f "${archive_path}" ]]; then
kark_path="${raw_dir}/${resource_file}.kark"
decompressed_base="${raw_dir}/${resource_file}.raw"
python3 tools/extract_archive_segment.py "${archive_path}" "${resource_hash}" "${kark_path}"
tools/cp77_toolbox.sh oodle decompress "${kark_path}" "${decompressed_base}" || true
if [[ ! -f "${decompressed_base}.bin" ]]; then
echo "failed to decompress ${kark_path}" >&2
exit 1
fi
mv "${decompressed_base}.bin" "${raw_dir}/${resource_path}"
else
echo "raw segment extraction needs a single archive file, got: ${archive_path}" >&2
exit 2
fi
tools/cp77_toolbox.sh convert serialize "${raw_dir}" --outpath "${json_dir}"