Deleting Graphics

I originally made a set of graphic files for the dice that I’m working on for the game in the vassal engine and recently upgraded the graphics, but the old ones stay in the .mod and I have yet to figure out how to remove outdated graphics from the .mod to conserve space, is there a way, or do I have to complete the module over again now that I’ve added files with different names or extensions?

There are two ways. The first one is to open the mod file with a zip editor (winrar or 7zip, for instance) and remove the images by hand. If they are few enough it can be easily done.

Another way is to use a version of vassal that is currently on the svn server at vassalengine.svn.sourceforge.net … s/cfedeli/ .

The latter will be doable if you know how to use svn and to run directly from java source code. It basically adds a function to the editor that searches for unused images in the module and gives an option to delete them. I wrote it, but I have not yet documented it, and have no clue whether or not it will be included in a release.

Thus spake “Kard”:

Modules are ZIP archives. You can unzip your module, remove the images,
and rezip it.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

I’m trying to do the same thing (remove extra images from a module), but I can’t seem to rezip it so that it will work again as a module. When I zip it and then try to open it in Vassal I get the error “The file is not a valid Vassal module.” I can’t rename the zip file to become a VMOD file, either… it just adds “.vmod” to the file name, but doesn’t change the file to be a VMOD file.

???

Typically, when you unzip a module, you’ll unzip it to a new folder, or your unzip utility may do this automatically. Let’s call this folder the Unzip Folder. Inside the Unzip folder you’ll get something like the following:

Images folder
buildFile
info
moduleData
Possibly some other folders (for example, Sounds, Help, etc)

No surprises here, this is just the basic contents of the module after unzipping.

Now, go into the Images folder and delete the files you don’t want anymore.

When you’re all done, select and then re-zip all of these files and folders -at this level-. Typically you can do this by selecting the files and choosing Compress, Zip These Files, or something like that from a context menu.

What is common is that people go up one level instead and re-zip the entire Unzip Folder. But that folder was only created by the unzip utility when you unzipped–it wasn’t part of the original module. Vassal needs those files at the root level inside the zip file in order to recognize your module as valid. If you re-zip the Unzip folder instead of just its contents, Vassal will go to open your mod and not find what it needs–instead, it’ll find a folder with some stuff inside. And then return the ‘Not a Valid Vassal Module’ error.

So, in the example, you’d select and then re-zip the Images folder, buildFile, etc, and end up with a new zip file at the same level. At the end of the process, inside the original Unzip folder, you’d have this:

Images folder
buildFile
info
moduleData
more folders, etc…
Plus, the newly zipped file, which has had the unwanted images removed from the Images folder.

This newly zipped file is what you rename to .vmod. Move it somewhere else on your hard drive. You can then delete the Unzip folder.

You can also delete straight from the unzip window, if that’s something you want to do. :slight_smile:

Thus spake “Grudunza”:

You’re probably munging the internal structure of the archive when you
rezip it. What files and directories do you see at the root of your
rezipped module?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Yeah, it was what mycenae was describing. Funny thing is, I’ve zipped and unzipped and used Vassal modules before and it worked fine, but this time I couldn’t understand what was going wrong.

Thanks!