Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: electrojustin on August 15, 2014, 05:41:36 pm
-
So long story short I wrote a tiny packer and an unpacker for VP files for UNIX based operating systems (tested on Linux, will likely work on Mac OSX and *BSD, but OSX and *BSD users will have to compile from source. See below). They have basically no dependencies.
I don't like wxWidgets or Java, so I wrote both command line utilities using standard C libraries. I think my distro (Arch Linux) has a newer version of wxWidgets in the repositories; wxLauncher and wxVPViewer work tolerably with a few GTK related bugs, but a lot of the wx-based utilities will have major issues when this particular version reaches the rest of the community (deprecated and even flat out REMOVED a lot of things, some weird assertion failure bugs, mysterious crashes, the whole nine yards).
Let me know if it extracts improperly or the VP files it generates don't work with something! On a side note, it doesn't have very good sanity checking or error handling yet, so 9 times out of 10 typing something wrong will result in a segfault (make sure you include a '/' at the end of directory paths!!!).
You can get the code here: https://github.com/electrojustin/yavpa. Compilation is as simple as "make".
If you run a 64 bit operating system that supports ELF, e.g. Linux (FreeBSD folks, I think it's dynamically linked so I'm not sure my binary will work for you, see above for source compilation), and want to just download the binaries: https://github.com/electrojustin/yavpa/releases
-
Sounds awesome, and if it supports, or could support listing directory structure somehow, and specific file extraction, it would be simple enough to make a front end for.
-
specific file extraction
Can be done. Very easily. Might even post a patch later tonight.
listing directory structure
Like textually? I dunno what a good way would be of listing the directory structure, but if anyone can think of a good one, the unpacker has a really nice internal representation of the file tree that would make this extremely simple.
it would be simple enough to make a front end for
Alas, I don't know any graphical APIs to a meaningful extent. I do a little OpenGL here and there, but raw OpenGL seems like a poor choice for this sort of thing. Perhaps it's time to finally learn GTK...but there goes the ability to run on OSX.
-
Something probably tab-delimited, that is both human readable, but also machine parseable, would allow a frontend to 'browse' the VP like 7-zip or the like, or most other VP tools. Or allow command line only 'browsing', something which I don't think has ever been done before, and which would be pretty cool I think. I wasn't suggesting that you take a stab at the GUI, merely that by doing the legwork of creating the crossplatform CLI unpacker, anyone could create a front end for it however they see fit.
-
Something probably tab-delimited, that is both human readable, but also machine parseable
That actually sounds like a really good way of doing it. Like Python code. Would be super simple to implement too, likely less than 10 lines of code.
Yeah my intent with the whole CLI thing was to pave the way for scripting (like maybe helping a cross platform mission editor get off the ground).
Just for the heck of it, I might even make a separate binary that allows file browsing with ncurses :P
-
Just pushed an update. Added the single file extraction thing and added a form of tab-delimited textual file listing. Let me know if you have ideas on how to improve it!
-
Can this be extended to work with file-roller? It would be really cool if there was a gui for this and file-roller already handles a ton of file formats. As far as I know it just relies on the commandline tags being compatible...
-
Nice work :D
I just wrote a similar program, and posted it in this thread http://www.hard-light.net/forums/index.php?topic=88759.0