Tricky property question

So I have this situation that stumps me.

Lets say, I make a global property named A1 representing a space on the board.

By default the value of A1 is set to 0.

I store the name of the piece that moves on the space A1 into the global property A1.

So now A1’s value is $BasicName$.

However I want another global property, say one called Old Value to store the original value of A1 before it changes to $BasicName$.

I have a bunch of global properties similar to A1 representing multiple spaces, and I have my game piece send its name as a value to a global property using $LocationName$ to determine the name of the global property.

Basically, Set Global Property $LocationName$ to value $BasicPiece$.

Here is the problem, I’m trying to get Old Value global property to get the original value of the A1 global property by asking the piece its $LocationName$ to serve as the name of the global property A1.

So my question is, will Old Value take the value from the global property A1 with the same name as $LocationName$, or will it simply store the pieces actual location from the system property?

With the recent release of Vassal 3.2.0 I thought I might have figured out a solution to my problem using the calculated expression {GetProperty(“GetProperty(LocationName)”)}

However it is not working like I had hoped, when trying to set a Dynamic Property value directly to that as a value.

It is however leaving the dynamic property value blank as opposed to leaving its original value, does this always happen when trying to set a value that for some reason cannot be set?

The reason I’m not doing this with triggers is because I need the Global Properties old value stored just before it changes to a new value, but changing Properties always happens before triggers so a trigger is useless.

I’ve tried simply not triggering the current LocationName set to the Global Property until after the Global Property’s current value can be stored, but it has for some reason broken my system for setting the Global Property to the pieces current Basic Name which must be trigger by a on movement GKC.

Does anyone else have a possible solution to all this?

Edit: Sorry, not a calculated expression, just a normal expression or “built” expression I guess. Still getting use to the new vassal. And this forum could still use a longer lasting edit button.

Still have the problem just wanted to correct what I previously said.

Haven’t had time to look in detail, but

{GetProperty(“GetProperty(LocationName)”)

is not going to do the job. This will return the value of the property named GetProperty(LocationName) which I am sure is not what you want. I think what you are after is

{GetProperty(GetProperty(LocationName))

Thanks for the response! However that is neither working.

Although instead of setting an empty value, its setting the expression itself as a value like a string.

A.K.A the value of Old Value became {GetProperty(GetProperty(LocationName)) instead of what it was suppose to hopefully get.

To be clear, I’m trying to set the value of a property to the current value of a different property, the second property being named after a location, by using a pieces location to determine the name of that property, to get the value of that property to set to the previous property.

Sounds kind of crazy.

oops, my typo, I forgot the closing }. Should have been

{GetProperty(GetProperty(LocationName))}

Thanks for the attempt, but that expression causes vassal to bug out.

Welp, I guess that answers that one then, oh well.

Thanks again for the help Brent.

Thus spake reddeblu:

Thanks for the attempt, but that expression causes vassal to bug out.

Bug out how? If this is an actual problem, we need a better description
of it than that.


J.

In regards to your original question: if your pieces move via a Send To Location or Move Fixed Distance or Return to Deck, then I think it’s just a matter of correctly ordering the traits. Set Old Value to GetProperty(GetProperty(LocationName)) last, so that it will be dealt with first. Then, second to last or something, have your piece move and set $LocationName$ to $BasicName$.

On the other hand - if your pieces are dragged and dropped - then set Old Value to GetProperty(GetProperty(OldLocationName)).

Bug out as in, the window pops up that says EEK! A BUG!

Of course after that happens I tend not to try and go further without restarting Vassal.

I’ve sent a report via that window if it helps.

If it also helps I came to the Internal Error window by making a Dynamic Property on a piece, having it set value directly to {GetProperty(GetProperty(LocationName))}, and triggering it with a Key Command Applied To All Pieces Ending Movement, then proceeded to move the piece.

Beyond that I’m afraid I don’t know, sorry I should have been more clear about what resulted.

Thanks very much, that has enabled me to reproduce the problem. It is definitely a bug in vassal and I am looking into it. Joel, this is the NoSuchField WrapperMap bug.
Brent.