Create account / Log in

Removing the Fat from Mods

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Removing the Fat from Mods

Postby GamesOnTheBrain » March 8th, 2011, 5:16 pm

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.)
User avatar
GamesOnTheBrain
 
Posts: 13
Joined: August 2nd, 2008, 11:21 pm

Re: Removing the Fat from Mods

Postby mycenae » March 8th, 2011, 5:49 pm

1. Rename your existing mod to <mod name>_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 "<mod name>_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: <module name>.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.'
mycenae
 
Posts: 392
Joined: May 16th, 2008, 6:41 pm

Re: Removing the Fat from Mods

Postby GamesOnTheBrain » March 8th, 2011, 7:02 pm

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!
User avatar
GamesOnTheBrain
 
Posts: 13
Joined: August 2nd, 2008, 11:21 pm

Re: Removing the Fat from Mods

Postby bdgza » March 9th, 2011, 8:57 am

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.
bdgza
 
Posts: 290
Joined: February 26th, 2010, 10:51 am


Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests