Lt_Parsons Posted May 11, 2014 Share Posted May 11, 2014 (edited) Some time ago (almost exactly a year, it seems) i discovered a great tool for unpacking game pfp archives that helped people with mapping/modding since then. This time as an exercise i tried to step up the game a little and made a packer/unpacker by myself. Here it is - xen_packer It can unpack pfp's and pack any files into archive again. Maybe it will be helpful to package new tilesets or something. This is a command line utility, if you launch it directly, it will run with default parameters. Instructions/info: xen_unpack.bat, xen_unpack_log.bat Unpacks files from PFPK archives, used by Xenonauts. Outputs processing info in console (xen_unpack.bat) or in log file (xen_unpack_log.bat). Usage: xen_unpack [[path]archive] [[path]output_folder|-l] [] - optional parameters, | - alternative parameters archive - path to archive file to unpack files from, defaults to 'GC_TilesXML.pfp' output_folder - path to folder to write output files into, default to archive folder Script unpacks all files found in the archive and creates in the same folder a text file that lists all output files separated by newline. if instead of output_folder there is '-l' parameter, script only reads archive and creates file that lists archive content. ------------------------------------------------ xen_pack.bat, xen_pack_log.bat Packs files into PFPK archive, used by Xenonauts. Outputs processing info in console (xen_pack.bat) or in log file (xen_pack_log.bat). Usage: xen_pack [[path]file_list] [[path]archive] [] - optional parameters file_list - path to text file with input file names separated by newline, defaults to 'GC_TilesXML_list.txt' archive - output archive file path, defaults to 'file_list_1.pfp' in the same folder as the file_list Script assumes that all files mentioned in file_list are in the same foler as file_list. Ignores files in file_list with paths longer then 255 characters, because of archive format. Tested it on existing game archives (GC_TilesXML.pfp and GC_UnitsXML.pfp) by unpacking/repacking several time in a row - results seem bit-perfect when comparing with original archives and quickbms output. Game recognizes new archives automatically. It seems like any new or original content can be packed - tested by replacing all xmls from assets folder with archive containing them and by packing small test mod with sprites into new archive. Whole thing is written in JavaScript and uses node.js as script processor (because if you have one hammer, why use anything else, right? =). I'll be much obliged for any testing/suggestions/critique about the packer and its code. Edited June 3, 2014 by Lt_Parsons Quote Link to comment Share on other sites More sharing options...
kabill Posted June 3, 2014 Share Posted June 3, 2014 So, I'm being a bit stupid: I'd like to unpack the unit files, but I can't work out how I direct the unpacker towards the GC_UnitsXML archive. Any chance you could point me in the right direction? Quote Link to comment Share on other sites More sharing options...
Lt_Parsons Posted June 3, 2014 Author Share Posted June 3, 2014 (edited) Sure. If archive is in the same folder as packer command would be: xen_unpack GC_UnitsXML.pfp Or if you want to unpack to different folder (e:\xenonauts units\ for example): xen_unpack GC_UnitsXML.pfp "e:\xenonauts units\" And example with full path to the game: xen_unpack e:\Steam\steamapps\common\Xenonauts\assets\GC_UnitsXML.pfp "e:\xenonauts units\" Quotation marks are needed only if path contains spaces. P.s. If you have any suggestions how to rephrase the instructions more clearly, i'll be glad to do so. Edited June 3, 2014 by Lt_Parsons Quote Link to comment Share on other sites More sharing options...
kabill Posted June 3, 2014 Share Posted June 3, 2014 I just tried that, and it started extracting from the default archive (the map one) instead. Copy-pasted from the file name: xen_unpack GC_UnitsXML.pfp It is the .bat file I need to rename, and not the script file in the 'node' folder, isn't it? Quote Link to comment Share on other sites More sharing options...
Lt_Parsons Posted June 3, 2014 Author Share Posted June 3, 2014 (edited) No need to rename anything - it's a command line utility, you just type the command and it runs bat file with parameters. Forget to mention in description that it is command line, sorry. Edit: Or you can just copy the .bat file and edit "%1 %2" to any parameters you need and then just run it. Edited June 3, 2014 by Lt_Parsons Quote Link to comment Share on other sites More sharing options...
kabill Posted June 3, 2014 Share Posted June 3, 2014 Ah, yeah, thought I needed to change the file somehow and run it. But I've got it running now, thanks! (Also, it was helpful having this thread linked to off of the mod list after all). Quote Link to comment Share on other sites More sharing options...
comandercom Posted January 14, 2016 Share Posted January 14, 2016 (edited) Hey I've been trying to unpack the specters for a mod I'm creating and the xen_unpack command doesn't seem to be working. I've tried putting it in both folders in the packer program and I've also tried putting in the file path to the GC_unitsXML archive http://imgur.com/RnM7jHe. I'm not getting an output file anywhere. What am I doing wrong? Edit: I think I found a solution elsewhere. Thanks for making this awesome tool though! Edited January 14, 2016 by comandercom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.