Post by cheburat0rr on Sept 13, 2019 14:57:59 GMT
Requires Python 2.
You have to uncheck the "Read only" box in the pac's right click property menu first time after extracting it from the dmc3-0.nbz archive to be able to write to it. Or just delete it after unpacking stuff from it and create a new one later.
Use through the command prompt (shift right click on the folder you use for pacs and select "Open command window here" to open it with that folder as working directory or type cmd into the address bar) by typing a script's name (if you got both python 2 and 3, specify the version with "py -2" before the name) and either a .pac file for unpacking or a folder for repacking,
so
will extract the contents of pl000.pac and
will repack it.
Typing a script's name without any additional arguments will loop through all the pacs in a folder, processing all internal pacs as well. Repacker in this mode only processes folders if there's a corresponding pac (since it requires an argument), so don't delete them.
To process a range of files, after a script's name, type in the starting and ending files separated by space.
To process all internal pacs automatically while processing a single pac, type all after a pac's name/folder. Don't use it on plXXX pacs and enemy ones, they got subpacs with animations, that have completely fucked up headers with incorrect file count and pointers randomly scattered around, not sure what's going on there, repacking them like the rest will result in animation glitches. All of the batch extraction options will unpack all the subpacs, so don't use them for extraction. Batch repacking is fine if you didn't touch such subpacs.
To process PTX archives e.g. basic.ptx, which contains font and some icons, type it's name with .ptx extension for both extracting and repacking.
To remove headers from the "tm2" textures, type it's name and you'll get a readable dds file. To add the header, specify a dds file (with extension) and it'll output a copy with a header and .tm2 extension.
Update 8:
Turns out python doesn't automatically numerically sort, so the batch processing options would first process all the files starting with 1 even if it's 10000 before processing 2, made it sort. There's still an issue with it somewhy ignoring alphanumerical (containing both numbers and letters) pac names as range arguments, so if you specify like id100v as the ending file it'll iterate over every file in the folder after the starting one. This doesn't happen upon getting to alphanumerical pacs if the ending pac doesn't contain any letters. So don't use alphanumerical pacs as ending ones. I can't be bothered to find out why that happens right now, if anyone knows, let me know.
Added moveset videos handling, they are just a bunch of dds images acting as frames, so you can record a video and extract it's frames as separate images if you wanna edit them.
Update history:
Update 4:
fixed a minor bug, which could prevent texture archive detection.
Update 5:
Fixed improper unpacking of some textures.
Update 6:
Made the tool write down more fields in the texture headers to fix effect textures.
Update 7:
Added batch processing options.
You have to uncheck the "Read only" box in the pac's right click property menu first time after extracting it from the dmc3-0.nbz archive to be able to write to it. Or just delete it after unpacking stuff from it and create a new one later.
Use through the command prompt (shift right click on the folder you use for pacs and select "Open command window here" to open it with that folder as working directory or type cmd into the address bar) by typing a script's name (if you got both python 2 and 3, specify the version with "py -2" before the name) and either a .pac file for unpacking or a folder for repacking,
so
ex.py pl000.pac
will extract the contents of pl000.pac and
re.py pl000
will repack it.
Typing a script's name without any additional arguments will loop through all the pacs in a folder, processing all internal pacs as well. Repacker in this mode only processes folders if there's a corresponding pac (since it requires an argument), so don't delete them.
To process a range of files, after a script's name, type in the starting and ending files separated by space.
To process all internal pacs automatically while processing a single pac, type all after a pac's name/folder. Don't use it on plXXX pacs and enemy ones, they got subpacs with animations, that have completely fucked up headers with incorrect file count and pointers randomly scattered around, not sure what's going on there, repacking them like the rest will result in animation glitches. All of the batch extraction options will unpack all the subpacs, so don't use them for extraction. Batch repacking is fine if you didn't touch such subpacs.
To process PTX archives e.g. basic.ptx, which contains font and some icons, type it's name with .ptx extension for both extracting and repacking.
To remove headers from the "tm2" textures, type it's name and you'll get a readable dds file. To add the header, specify a dds file (with extension) and it'll output a copy with a header and .tm2 extension.
Update 8:
Turns out python doesn't automatically numerically sort, so the batch processing options would first process all the files starting with 1 even if it's 10000 before processing 2, made it sort. There's still an issue with it somewhy ignoring alphanumerical (containing both numbers and letters) pac names as range arguments, so if you specify like id100v as the ending file it'll iterate over every file in the folder after the starting one. This doesn't happen upon getting to alphanumerical pacs if the ending pac doesn't contain any letters. So don't use alphanumerical pacs as ending ones. I can't be bothered to find out why that happens right now, if anyone knows, let me know.
Added moveset videos handling, they are just a bunch of dds images acting as frames, so you can record a video and extract it's frames as separate images if you wanna edit them.
Update history:
Update 4:
fixed a minor bug, which could prevent texture archive detection.
Update 5:
Fixed improper unpacking of some textures.
Update 6:
Made the tool write down more fields in the texture headers to fix effect textures.
Update 7:
Added batch processing options.