I broke Vassal.

WARNING! Don’t try this at home:

I was trying to make a complicated trigger to send a piece back to a previous location after moving from one board to another board and used something like the following:

Calculated Property Start X:
If(CurrentBoard == “Small Hex Map” && OldX == “”, CurrentX, If(CurrentBoard == “Small Hex Map”, OldX, GetProperty(“Start X”)))

Calculated Property Start Y:
If(CurrentBoard == “Small Hex Map” && OldY == “”, CurrentY, If(CurrentBoard == “Small Hex Map”, OldY, GetProperty(“Start Y”)))

Not only did this lock up Vassal as soon as I started a new game, but it locked it up so hard that I can’t even open the Prototype function containing the calculated properties to edit them even after a reboot of my PC. It seems like Vassal is still trying to run the calculated properties in the background even in the editor. Perhaps the piece preview pane is trying to calculate the properties?

I’m new at Vassal and I’m not sure what is happening. I suspect that the above expressions are trying to be evaluated earlier than I thought and the pieces exist in an offboard state at some point during start up and the expressions result in an infinite loop.

This is a nasty condition to wind up in.

What you can do is change the .vmod extension to .zip (a module is really just a zip file) and extract it. You’ll find a file called “build”. You can edit that directly with notepad or similar text editor. I’m guessing you can just search for the equation, delete it, rezip the module back into a .vmod. This should at least allow you to open it.

The problem is being caused because yes, Calculated Properties are not only evaluated while a piece is on a Map, but while in the Game Palette and all other locations.

This is normally not a problem, except that your Calculated Properties are referencing themselves. Start X is referencing GetProperty(“Start X”), so you are getting into a hard infinite loop trying to recalculate Start X. Vassal is supposed to detect infinite loops and throw an exception, but looks like this one is not being checked.

Your only way out at this point is to follow DrNostromo’s suggestion and edit the buildfile to change the text of these properties to something that won’t loop, then try again.