Reproducable saving bug when DIR names are changed...

With a module open, if a DIR housing counter images is renamed, you’ll get an error such as:

java.io.FileNotFoundException: D:\games\VASSAL-mods\War-of-Resistance\counter-sheets\CHINESE\0-1-4 Inf X 20T1-back.png (The system cannot find the path specified)

This is easily reproducible by following these steps:

  1. Create new module
  2. Add a new piece and image from directory X
  3. Save module
  4. Rename directory X to directory Y
  5. Save module again (error! file not found!)

Why I ran into this bug:

I organize my counter images into sub-folders, and prefix them all as DONE when I complete adding each folder’s contents.

While this is not a show-stopping bug, it’s annoying and shouldn’t happen. The module has already been saved, and NO changes made, but it still wants to check the original file paths when saving again. There is no need for this to be done if the artwork is already incorporated into the module file via a previous save…

Shad,

When you add a new image to a module via the Editor, it is loaded in a way that only references the image on disk, it cannot be properly incorporated into the module until you save it. When you save the module, the images are all saved to disk and the saved module on disk is complete and will not show any errors.

However, that does not change anything in the module still currently in memory - it still only has references to the images on disk. The module has not been magically loaded back off the from the save you made. So when you save the file again after renaming the directory, it still has to go to disk and does not find the images.

If you want to do this, the correct procedure is

  1. Create new module
  2. Add a new piece and image from directory X
  3. Save module
  4. Close Vassal
  5. Rename directory X to directory Y
  6. Load module

B.


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

Post generated using Mail2Forum (mail2forum.com)

So am I damaging my modules or not by saving, renaming, and closing in that order?

Or saving, renaming, and moving on to other edits in the session?

Thus spake “Shad”:

I’m not sure that this is a bug. You’re moving files which VASSAL is using
whithout telling VASSAL where they’ve gone. I don’t see what else VASSAL
can do in that situation, other than tell you that it can’t find the files.

Suppose we changed it so that after writing module, the new module file was
made active. Then we’d start getting bug reports about people altering
images but not having the changes show up in the module. It’s not clear to
me that this is better, let alone enough better to warrant making the change.


J.


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

Post generated using Mail2Forum (mail2forum.com)

Ok, well this “problem” for me seems to be predicated on my ignorance as to the inner workings of VASSAL.

I assumed that saving meant everything was squared away, and I was free to change the original files.

This isn’t the case, for reasons given, so I’ll change my methods accordingly.

Thus spake “Shad”:

If you want to give me an argument for why it would cause fewer problems
the other way (or for some third way which avoids both problems), go
ahead, I’ll listen. I’m just not convinced presently that we have something
better to change to.


J.


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

Post generated using Mail2Forum (mail2forum.com)

I got nothin. Just tryin to be helpful by reporting a bug.