The Warp Room
PAK Explorer - Patching - Printable Version

+- The Warp Room (https://thewarproom.com)
+-- Forum: Crash Bandicoot Modding (https://thewarproom.com/forumdisplay.php?fid=5)
+--- Forum: Modding Tutorials (https://thewarproom.com/forumdisplay.php?fid=10)
+--- Thread: PAK Explorer - Patching (/showthread.php?tid=13)



PAK Explorer - Patching - Neo_Kesha - 19-08-2018

All you need: NST Explorer, Patch and game itself.
1) Open PAK Explorer
2) Select txt file of patch you desire
3) Select game folder's archive folder
If backup is not present, all patched PAK files will be backed up
Patcher sytaxis:
open <pak> - opens pak for editing
repak - saves edited pak. If not exists already, backups original file, adding .patch_bak at the end.
open_import <pak> - opens pak to import from
replace pak <pak> <ID1> <ID2> - replaces file in opened pak with ID1 id by file from <pak> with id ID2
replace assets <ID> <asset> - replaces file with ID id in opened pak by asset
import <ID> - imports file with ID id from opened for import pak 
Example:
open crash1.pak
replace pak crash2.pak 4233004189 2971768986

replace assets 4144137678 res/texture.igz

repack

So, patch structure will be:
patch_name.txt
res/texture.igz

Patcher will open crash1.pak, replace it's 4233004189 asset with 2971768986 asset from crash2.pak, then replaces it's 4144137678 asset with external asset texture.igz from res folder relatively from patch script, repacks and backups pak.

NOTE: importing is not done yet. It works only partially.
Example:
open crash1.pak
open_import crash2.pak
import 2971768986
repack

If you have some requests or questions, ask freely.


RE: PAK Explorer - Patching - ARD - 27-08-2018

Thanks for this, the patching is a great feature and now that I've managed to use it for my level mod I'm gonna stick with it for anything else I release in the future.

I do have a question about how patching/replacing files works though - when you say it's based on Aluigi's BMS script, are you actually using quickbms and a modified BMS script to extract and replace files, or are you using another method? If you are using a modified script then is there any chance you could share it? And if not, do you think it would be possible to adapt whatever method you are using into a BMS script that can replace any file? I haven't tried it recently but afaik it's only the music and sound files that can be reimported using the MUA2 script.


RE: PAK Explorer - Patching - Neo_Kesha - 27-08-2018

(27-08-2018, 01:14 AM)ARD Wrote: Thanks for this, the patching is a great feature and now that I've managed to use it for my level mod I'm gonna stick with it for anything else I release in the future.

I do have a question about how patching/replacing files works though - when you say it's based on Aluigi's BMS script, are you actually using quickbms and a modified BMS script to extract and replace files, or are you using another method? If you are using a modified script then is there any chance you could share it? And if not, do you think it would be possible to adapt whatever method you are using into a BMS script that can replace any file? I haven't tried it recently but afaik it's only the music and sound files that can be reimported using the MUA2 script.

No, by that i've meant that i took BMS script to get knowledge about PAK format.
Don't know how to write this in BMS. And, basically, extraction is just the same, but repacking is extremely differs from extracting. It also needs original pak or list of IDs to repack, but BMS probably can open more that one file.

Why do you need BMS script? I can add bunch extraction into NST Explorer, or whatever you need.