PDA

View Full Version : Need code for zipping level packs


blurredd
Jul 14, 2009, 09:12 AM
Basically what I'm looking for is someone to create code in C++ that takes a std::list of level filenames and creates a zip containing the levels and optionally their tilesets and music. It may also be helpful if the code could handle getting all the levels in a pack based on the next level setting starting with a single level. I plan on adding the code to plus.exe (http://www.jazz2online.com/jj2+), though if you want to make your own program as well, I would be fine with that. I would do it all myself, but right now I can't find the inspiration.

Cataphract
Jul 26, 2009, 10:05 PM
I could do that, I already implemented something very similar ( retrieving transitive dependencies of a level, including music, tileset, next, secret and bonus levels). The only problem is I know absolutely nothing of C++ and I refuse to learn it :p
I'm very comfortable with C, though, so if you're still interested, say so.
Btw, saying "I'd do it, but it's too boring, so I'll leave it to the minions" is not a great way to motivate people :p

Grytolle
Jul 27, 2009, 03:01 AM
major minion

Dermo
Jul 27, 2009, 03:47 AM
Cataphract, where the hell have you been???

Cataphract
Jul 27, 2009, 07:29 AM
Well, you know, unsuccessfuly summoning strength to finish my degree. I've also worked 6 months as a Java developer, but I quit to focus on my thesis.

blurredd
Jul 27, 2009, 03:55 PM
I guess C is good enough. It doesn't really look like anyone else is willing to make the code anyway.

Cataphract
Jul 29, 2009, 10:08 AM
All right, I already handled the zip creation part. I can probably complete it before the end of the week.

Cataphract
Aug 1, 2009, 11:37 PM
I've finished it and will upload it together with the sources (so that you can integrate it to plus.exe) later today.

Cataphract
Aug 2, 2009, 12:36 AM
Done, see http://www.jazz2online.com/J2Ov2/downloads/info.php?levelID=5606

blurredd
Aug 2, 2009, 11:09 AM
Awesome! Thanks for the good work. Though I'm not able to run PackPacker.exe just yet.

Cataphract
Aug 2, 2009, 01:40 PM
But are you having any problem or you simply haven't tried yet?

blurredd
Aug 2, 2009, 03:35 PM
I'm having a problem. "This application has failed to start because the application configuration is incorrect." I would assume it's because your program requires me to have runtime components from a version of Visual C++ I currently don't have.

Cataphract
Aug 2, 2009, 05:21 PM
I've rebuilt it and tested it in Windows XP and Windows 2000. There should be no problems now.

The problem was - precisely to avoid statically linking against the C runtime and having to distribute the visual studio runtime - I had linked the program against msvcrt.dll, which is present in all versions of windows. However, the vista version of the file has more functions exported than the ones from XP and 2000. You can add a small object file that contains the missing functions as a dependency (there's a version of such object that only supplies the functions missing in XP, in w2k and w2k3), which I did, but I also had to change the crt headers folder, which I forgot to do. Oddly, in the end _wfopen_s was still missing, so I replaced it with _wfopen.

Puffie40
Aug 9, 2009, 07:19 PM
I tinkered with it a little bit just now, and I notice it does not include the level you list. It may be I cannot understand the command line, as the little summery is hard to make sense of.

when I use it I type the following:

Packpacker /z ex01 ex02

this gets it going (It throws a hissy fit if I put just ex01), but it ignores ex01 and packs ex02 along with everything else in the series.

In hindsight, It may work right If I input ex01 twice.

Other than that, it works beautifully, and I like the convenience it provides.

Cataphract
Aug 10, 2009, 07:32 PM
You're calling it incorrectly. /z specifies the name of the zip file. So it would try to create a zip file named ex01 and start searching at ex02. You probably want "PackPacker /Z pack.zip ex01"

That is, if I remember correctly.