I am creating a new MOD by changing and adding to an existing MOD.
I can see that the OLD images are still there for me to use but I would like to delete them to shrink the MOD size.
Is there a way to remove old images short of starting over from scratch?[/b]
Rename your existing mod modulename_old.vmod, where “modulename” is the actual name.
Unzip modulename_old using your zip utility of choice into a new folder. Let’s call this the Unzip folder; typically it will now be named modulename_old. You’ll have a folder named Images and some other files (such as BuildFile and some others).
In the Images folder, delete the images you don’t need anymore.
This is the tricky part: At the level of the BuildFile, re-zip the module files. Select the BuildFile, Images folder and everything else in the Unzip folder and zip them. When you are done, you will have a zip file inside the Unzip folder at the same level as the BuildFile that consists of all the files you want to include in the new module. (What you don’t want to do is select the entire Unzip folder from outside the folder and just zip it. This will produce an invalid module.)
Rename the new zip file modulename.vmod (remove the zip suffix), then move the module its original location. You can now delete the Unzip folder.
Right now the only way to remove old, unused images is to manually
edit the build file.
There is a Feature Request in to provide a more convenient way to do
this, but it turns out that determining which images are not used in
a module is harder than one might imagine.
The same method works for scenario files; just delete the .sav or .vsav files you don’t want instead of the images.
By ‘level of the build file’, that is to say, if you have two folders on your desktop, A & B, they are both at the same ‘level.’ Files inside folder B are one ‘level down’ from folder A. Folder A is one level ‘up’ from the files inside folder B.
If your unzip folder is on your desktop, and you zip that folder, you will get a new zip file with the unzip folder inside it and all your files inside that folder.
But when Vassal goes to open your new zip file, you will get the message ‘Invalid Vassal Module’ because Vassal expects the BuildFile, Images folder and other files at the root level–instead, what it finds is the folder you had all those files in, and it gets confused. It’s like unwrapping a wrapped Christmas present to find yet another wrapped box inside.
So, after deleting your unwanted files, when you re-zip the files (BuildFile, Images folder, Saved Games folder, etc), what you should do is open the unzip folder (that is, be at the same ‘level’ as the actual BuildFile), select all the files in it,and zip those. Try it out and see how it works.
Let’s not confuse people. I think you mean to manually edit the module file, not the ‘build file’?
What I would like to see is a ‘File Explorer’ available from the Module Editor that displays the contents of the module and allows you to dive into sub directories, highlight and preview images, select and delete files. The files would be marked for deletion and not written to the archive the next time the module is saved.
Convert your mod [MOD1.vmod] to a ZIP file. [MOD1.zip]
Unzip MOD1.zip
You now have a folder named MOD1
Inside you have an Images Folder and others. You can delete any images you find here if you like.
Remove any images you like. If you remove a necessary image you can replace it in the vassal editor. [be sure you have your images backed up]
Create a zip file from all the files and folders from the DIR that contains; __MACOSX, HELP, IMAGES, buildFile and moduledata. I did CRTL-A, right clicked and told it add to ZIP.
you will get a chance to name the Zip file in the Zip program. Change it to MOD1.ZIP
change MOD1.ZIP to MOD1.vmod
You can now open MOD1.vmod with Vassal and edit it. My file shrunk from 8MB to less than 1 MB. I got some errors because Vassal could not find some images. But these can be added as you would add a new image.
I followed the instructions here to remove unused image files, but when trying to open the module again, a window comes up saying that there has been a bug. I’ve tried to unzip/zip the renamed .vmod with Winrar and Winzip, even deleting the files without unzipping but I get the same error all the time.
I seem to recall that I’ve done this before for another module and it worked then. May it be a problem related to the Vassal version?
If I am correct the method has become much easier since two years ago. I’ve recently deleted just a few old images from my module without problem, and this is how I’ve done it:
Make a copy of the module, just to be safe.
Change the module filetype to .zip, and ONLY .zip (as far as I know). I tried .rar and got errors attempting to edit it.
Open the new .zip module with your favorite program, and then simply delete the unused images in the images folder, no build file meddling needed.
Then change the filetype back to a .vmod, and your good to go.
Again I have done this with just a few images and everything turned out fine, I do not know what the consequences are of deleting images which are in fact used, so be careful.
I followed the instructions here to remove unused image files, but when
trying to open the module again, a window comes up saying that there has
been a bug. I’ve tried to unzip/zip the renamed .vmod with Winrar and
Winzip, even deleting the files without unzipping but I get the same
error all the time.
I seem to recall that I’ve done this before for another module and it
worked then. May it be a problem related to the Vassal version?
I expect that you’re not correctly rezipping the module. It’s unlikely
that the problem has to do with the version of VASSAL you’re using.
What is the error message?