Wrong location report when using Delete trait

Hi,
When using Report Action on a Delete trait, the $oldLocation$ or $location$ don’t report the location where the unit was when deleted, but the previous location, if was moved. For example, if I place the unit on the map from the Game Piece Palette and delete it, the location is not reported. If I place the unit and move to other location, the reported location will be the one I initially placed the unit. I tried it using $location$ and $oldLocation$ properties but on both cases without sucess.
It just happens in Vassal 3.2.8.
When using 3.1.20 $oldLocation$ works fine, it reports the location where the unit was deleted…

(Sorry for my bad grammar, I hope I was clear enough…)

Toze Santos

Try changing the order of the ReportDeleteAction and Delete traits in the piece’s trait list. For example, if you list the ReportDeleteAction trait before the Delete trait, then move the Report Action trait so it is below Delete – lower in the trait list.

Back in 3.1.19, I discovered if I listed a Report Delete Action first, then it would show the location as null. If I put the report trait after the delete trait, it worked properly. I have never checked it after 3.1.19, so I don’t know if it now works properly.

Yep, I tried to do it (change the order of the traits) but the problem persists. I even created a new module with a piece with only Delete and Report traits just for test, changed the order of both and even so I got the same problem.
I think this is a bug of Vassal, but that’s strange no one else has reported the same problem. Will be me doing something wrong?
But I really tried a lot of possibilities before place this mensage to be sure I was not doing anything wrong!!

It’s possible that the Delete trait’s interaction with the $location$ and $oldLocation$ properties needs to be updated. The Send to Location trait recently needed changes regarding these properties–Report Action was returning the correct values when StL was used to send a piece from one map window to another, but returning the wrong values when StL moved a piece to a new spot within the same map window.

Well, while this bug is not fixed there is an easy way to make the Delete trait report the real location where the unit was delete using a Dinamic

Property to get the hex where the unit is and send it to the Report.

To the unit with the Delete trait give a DP named delete_loc, for example, and a command to “Set value directly” $LocationName$
On the map the unit will be deleted add the command that change the DP to “Key Command to apply to all units ending movement on this map”.
(That will give to the DP the name of the hex where the unit is…)

On the Report trait add $delete_loc$ to the “Report format” (and other information you want, of course, like the name of the unit, etc.)

This way, when you delete the unit the Report will get $delete_loc$ that is the name or number of the location where the unit was deleted.

Thus spake tozesantos:

Well, while this bug is not fixed there is an easy way to make the
Delete trait report the real location where the unit was delete using a
Dinamic

If you want the bug fixed, make a minimal test module demonstrating
the problem, with instructions for triggering it, and post those here.


J.

Hi Joel,
In the links below you can download the test modules demonstrating the problem.
I had made two modules, one using VASSAL 3.2.8 and other using 3.1.20.
Just open the modules and place the units on the mapboard and delete them. On 3.2.8 I created two units with a Delete and Report traits, one using $location$ on the Report and other using $oldLocation$. But you will see none of them reports correctly the location from where the unit is deleted. On 3.1.20 I have a unit with $oldLocation$ on the Report and this one reports correctly…

dl.dropboxusercontent.com/u/103 … _1_20.vmod

dl.dropboxusercontent.com/u/103 … 3_2_8.vmod

Thanks in advance for your help…

Toze Santos

I’m seeing the same issue on modules I’m working on. Thanks for working on this.
But for some reason it works if the message contains Deleted piece → $oldPieceName$ at $oldMapName$:$oldLocation$

But not if I use any none ‘old’ variables. $PieceName$ at $MapName$:$oldLocation$