Piece property "oldLocation" and Send to Location reporting

There were updates to the Send to Location trait in 3.2.0 as noted in the ChangeLog:

  • Traits that move a counter (Send To Location, Return to Deck, Moved Fixed Distance, Pivot) now update the same location Oldxxxxxx properties that Drag and Drop movement does. [RFE 1792]

I’m curious if there have been additional changes to the StL trait in subsequent releases. Here’s why:

My intention is to provide useful messages when pieces are eliminated from play–namely, to specify the location from which a unit got eliminated. I have this working for some types of pieces, but not others. For simplicity’s sake, let’s say my Map Window for the game board is GameMap, and I have another Map Window where all the At-Start Stacks of land and naval units are stored called Forces.

In the game, if land units are eliminated, they are sent from GameMap to their proper place on Forces by a Send to Location. When that keystroke is invoked, a Report Action fires that says something like “2 regulars eliminated in $oldLocation$.” When this StL movement between two separate map windows occurs, the value of $oldLocation$ is returned just as you would expect and everything works as I intend…i.e., you get something like “2 regulars eliminated in Vienna.”

However, when naval units are eliminated in the game, they are supposed to be placed on the Turn Track, which is on GameMap, i.e. the same map window. The Turn Track area is covered with a Zone called “Turn Track”. When the exact same method as above is attempted, the value of $oldLocation$ is incorrect–the message will say “Spanish galleon eliminated in Turn Track”, instead of the map Zone where it was located before performing the Send to Location.

The clumsy workaround I have is to use a Trigger to fire a Report Action first (using the piece’s current location), then a silent Send to Location to do the actual movement.

So in summary, using $oldLocation$ appears to work fine when Send to Location movement is performed between two separate map windows, but the value is not updating properly for movement within a single map window, at least not when the target destination has a Zone.

Thus spake JoelCFC25:

There were updates to the Send to Location trait in 3.2.0 as noted in
the ChangeLog:

  • Traits that move a counter (Send To Location, Return to Deck, Moved
    Fixed Distance, Pivot) now update the same location Oldxxxxxx properties
    that Drag and Drop movement does. [RFE 1792]

I’m curious if there have been additional changes to the StL trait in
subsequent releases. Here’s why:

The last change to the code in SendToLocation.java was in 3.1.20. Lots
of things have changed w/r/t property evalutation, though, so I can’t
guarantee you that nothing which affects it has changed.


J.

This appears to be a bug. I have reproduced it in a small test module and have opened a new bug

Bug 10211 - $oldLocation$ for Report Format is not set on Send To Location on same map

target 3.2.7

I have committed a fix for this change to svn 8737.

When RFE 1792 was implemented, the Report State trait was never updated to take advantage of it properly. There has been a problem with reporting Old Location for some time, this should fix it once and for all.

Thus spake Brent Easton:

I have committed a fix for this change to svn 8737.

When RFE 1792 was implemented, the Report State trait was never updated
to take advantage of it properly. There has been a problem with
reporting Old Location for some time, this should fix it once and for
all.

Merged to trunk@8738. Try 3.2.7-svn8739:

vassalengine.sourceforge.net/builds/


J.

This build works–$oldLocation$ and $location$ now return expected values for reporting when using Send to Location for movement within a single map.

Thanks!