Jump to content

[Tool] Xenonauts PFPK archive packer/unpacker


Recommended Posts

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.




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.




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 by Lt_Parsons
Link to comment
Share on other sites

  • 4 weeks later...


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 by Lt_Parsons
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by Lt_Parsons
Link to comment
Share on other sites

  • 1 year later...

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 by comandercom
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...