Removing the Fat from Mods

I’ve noticed as a newbie mod developer that if I replace an image for maps and tiles and such, for example, and then I unzip the vmod folder, all of the old images I’ve used during development are still stored in the images folder.

Is there a way to trim this fat off of the mods without recreating the entire mod?

(NOTE: I have a Mac, and I haven’t figured out a way to unzip a mod, add or remove files, and then re-zip it without breaking the mod. If there is a way to do that, it would obviously be the easiest way.)

  1. Rename your existing mod to _old.vmod. (this will create a backup)

  2. Unzip the mod you just renamed using the unzip utility of your choice. On a Mac, you’ll probably get a folder called “_old”.

  3. Open that folder. You should see a file named BuildFile, a folder named Images, and some other bits and pieces.

  4. In the Images folder, delete all the obsolete images.

  5. Move up one level to the folder that contains BuildFile, the Images folder, etc. (the module ‘root’ level)

  6. Select all these folders and files and pick Archive Files.

  7. On a Mac, you will now have a file called Archive.zip. Rename this zip file to the name of your module: .vmod.

  8. Drag this up one level, to the same folder where your backup is.

  9. Now, on the Module Manager menu, Vassal will think your new zip file is the old module. Open the re-zipped module in Vassal and test it, to make sure you didn’t delete any images or other files by mistake. If you get an error, use your backup to recover whatever files you deleted and repeat the process.

A mistake everyone seems to make is re-zipping the wrong ‘level’ of files. You want to re-zip at the module root level (this is the level where you see BuildFile, the Images folder, etc), and not zip the folder that -contains- all this.

If you re-zipped the wrong level, when you go to open the file in Vassal , it will typically say ‘Invalid Vassal module.’

I had tried that and it didn’t work, but I finally figured out why.

Mac OSX seems to be setup to hide filename extensions, so even though I thought I was renaming a file to:

Game.vmod

… I was actually renaming it to:

Game.vmod.zip

… with the .zip extension being hidden from the Finder’s view.

Just in case anyone else is having this problem on a Mac, I solved it by clicking “Get Info” on the file and unchecking the “Hide Extension” flag. Then I renamed it from within the Get Info window and it worked.

Thanks!

You can also get around this hassle of the “hidden extension” by opening Finder Preferences and checking “Show all filename extensions” under the Advanced tab.