Create account / Log in

UGH! Bug appeared when attempting to save copy after editing

Issues with the Vassal engine.

Moderators: uckelman, Tim M

UGH! Bug appeared when attempting to save copy after editing

Postby Xenomorph » June 28th, 2018, 5:22 pm


So frustrated at the moment. I've been adding my own custom units and maps to the Panzerleader/Panzerblitz module and thought I should make copies when saving (in case something like a file hitting a bad spot on the computer disk etc). So after my next save I also did a "Save as" and simply added "-2" to the filename. I had the Windows directory open and noticed that when I did this, the file with the "-2" appeared in the directory but it was a generic windows file icon (ie not a Vassal module icon). I thought this was odd of course, and so simply went into Windows and made a copy of the Vassal module that way (the file that actually did have the Vassal icon, not the new blank icon file). Given all this, I decided to exit Vassal altogether and re-open the Vassal module (by clicking on the icon I always clicked on). That's when I got the bug message. The module won't open and neither will the copy I made. It appears that my attempt to do that original "Save as" and adding the "-2" somehow corrupted the file completely.

I did save a copy to the cloud (a couple hours worth of work ago, of course) and here I thought by creating a copy I'd save possible headaches but it appears that creating the copy was itself what caused the problem.

Oh, one more thing: it also occurred to me that possibly the edits I'd done just before saving had somehow created to bug. So I went into edit mode (that also gave me an a bug message but did let me edit) and undid the edits I'd just done before all this. Oddly, that allowed me to open the module BUT the map doesn't appear and the units window, while showing the names of the units, doesn't show any of the unit icons themselves. So odd.

Vassal 3.2.17, Windows 10, Module PanzerBlitz/Panzer Leader 3.5v02, Dell Alienware 13

Thanks so much for any help!
Posts: 6
Joined: June 6th, 2017, 12:52 am

Re: UGH! Bug appeared when attempting to save copy after edi

Postby RobS » June 28th, 2018, 7:05 pm

I stop at nothing to avoid using negative numbers.
Posts: 91
Joined: June 19th, 2011, 5:10 pm

Re: UGH! Bug appeared when attempting to save copy after edi

Postby Malnorma » June 29th, 2018, 11:08 am

I don't have any suggestions for fixing your problem without seeing the file, but just making a copy doesn't generally cause such problems. At the very least, always keep a last-known-good copy of your changes, and a backup of the original module to fall back on. If you're concerned that Vassal corrupted these, make the copies with Explorer instead and name them appropriately
(Panzer-original.vmod, Panzer-Working.vmod, Panzer-WIP.vmod).

I like to edit the module I work on with version control. I have a top-level folder with a Makefile, and a bin and src folder. The src folder is just the unzipped contents of the module.

The Makefile just includes a few time-saving steps:

make test -> zips the src folder into a static module using "Test" as the version as a placeholder. This is the version I edit in Vassal.

make unpack -> the reverse; unzips the test module and overwrites the files in the src folder. It also runs a script to normalise the XML in the buildFile, because Vassal really likes to make a mess of that (like botched divider positions that really just make life difficult for users). Cleaning up some of this makes the diffs more useful to double-check what you've changed.

make module -> uses gitversion to get a version number from tags in the repo, then sets that version in buildFile and moduledata, and zips up src into the new release.

Takes a bit of setting up, but once it's done you'll never need to fear a botched edit again, especially if you save and commit the changes frequently in logical chunks. It also lets you experiment a bit more freely without wasting space on a bunch of mostly-identical zip files. Don't get carried away with source control though - the module format doesn't lend itself well to multiple branches or merging, mostly thanks to the piece id numbers.
Posts: 124
Joined: October 14th, 2015, 9:26 am

Re: UGH! Bug appeared when attempting to save copy after edi

Postby Xenomorph » June 29th, 2018, 2:57 pm

Really helpful, thanks! I decided to just re-do the importing units. The file was sort of a cluster bc I was learning as I went but now that I know enough to be dangerous I decided to just re-do it. Took a couple hours but I think it'll save me time whenever I want to edit the thing. Hmmm...never thought of RobS' idea about the "dash" as a negative number. But that makes sense!

Thanks for taking the time!
Posts: 6
Joined: June 6th, 2017, 12:52 am

Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 3 guests