Possible Bug - Mat Cargo & Move fixed distance Trait

Hello all;
I am having issues with the Mat Cargo Trait which is used for dice that can be placed and moved on Cards. The Die (Mat Cargo) moves with the Card (Mat) when using click and drag but not when The mat is moved with the Move fixed distance Trait. The module can be downloaded here and if you right click on the card and select “Test” as per the image below you will see that the dice is left behind.

Not sure if it is a bug or I have done something wrong. The Trait orders seem Ok.

Regards;
Darren

1 Like

I think it’s a bug. The documentation is quite clear and trait order does not seem to be a factor. I can replicate the same issue.

Send to Location seems to work as advertised in my module, so as a workaround I tried the following in your module instead. It works.

1 Like

Hello Mark;
If you want, place 4 cards in the 4 Zones :"New Development_1 etc. then position one of the Die on a card in “New Development_3 or 4”. Right-Click the card in “New Development_1” and select “Discard” you will see the cards move to the left (as they are supposed to) and some more strange behaviour. The Die does not move with the card as before but also, the card it is supposed to be attached to is now out of alignment as well. The zones for the Card positions on this Map each have a grid so they are supposed to snap into position.

It still a work in progress, when there is a Discard in one of these 4 zones, the cards on the Right of the Discard ONLY are supposed to move left one Zone but at the moment it is all of them. I haven’t worked out how to confine the GKC which does this to the Right- Hand Zones only yet.

This will all have to wait until I have finished work which is many hours away because I haven’t started yet. Thanks for taking the time to answer. Meanwhile, I will change the heading of this thread to include “bug” so that it might attract the Dev’s attention :slightly_smiling_face:

Regards;
Darren

It surely does, that will do what I need but hopefully Brent or someone will see this because the Online Manual says that Mat & Mat Cargos are supposed to move together with a Move Fixed Distance Trait. Thanks Mark.

Regards;
Darren

Now another problem. After replacing the dodgy MFD Trait with the Send To Location, the Die rides along as it is supposed to when preceding cards are discarded, moving from right to left. however, when the card (Mat) carrying the Die (Mat Cargo) is next to the card that is discarded, for some reason the Discard (which the Die is not attached to) takes the die with it to the Discard Tray. Revised Module here: DOWNLOAD.

I have a command which detaches the Mat Cargo from it’s Mat prior to the Mat being discarded and returns it to the “Quarters” area - that works fine but why does another piece steal the Mat Cargo from another? It would have been nice to have this all automated but Click & Drag is starting to look pretty good this is taking too much time for such a small thing.

Regards;
Darren

I made another copy of this module and removed all the automations so it is click and Drag only. The possible bug which is the title of this thread (Move Fixed Distance does not work with Mat & Mat Cargo) remains. The other problem with a discard “stealing” the cargo from another does not. So maybe there are some conflicting commands or something with the automated version with this second problem. This will have wait for the Weekend or whenever my patience has been restored.

Darren

I’ve logged the issue on the tracking system. Issue #13072.

1 Like

Thanks for that, we have started looking into the issue. I’ve reproduced it and identified an additional related bug. Once the Mat has left the cargo behind, any further MFDs on the Matt don’t seem to have any effect at all until you remove the cargo from the mat.

2 Likes

Thanks for looking at this Brent. There is also a problem if a Mat & Mat Cargo are next to a card which is discarded, the discard takes the Neighboring Cargo with it to the Discard Tray. When the Send To Location Trait is disabled or removed there is no problem. The Command for Discard also activates the STL which moves cards to the left so maybe my setup is at fault in this case, not sure. It is as though the Cargo moves left before the Mat it is placed on and is grabbed by the Discard. Anyway, thought I would mention it, the download for the module is in my earlier comment here Possible Bug - Mat Cargo & Move fixed distance Trait - #5 by dsmith71 if you want to try it.

Regards;
Darren

If the Cargo is actually being moved left by a stray command activation, then that would explain what you are seeing. If you do anything to move a counter off one mat and onto another, then it will become cargo of the second mat. That’s at the core of how mats work.

Hello Brent;
The command to discard sends another to a GKC in the Piece (Card) that activates a Send To Location (formerly a Moved Fixed Distance Trait) so that the remaining cards shift to the left. It is supposed to work sort of like a conveyor belt activated by the Discard so I wouldn’t say it is stray but possibly this setup is causing the problem? The discard “steals” the Cargo from the Mat only when it is next to the discard. I am trying to work around this by making the draw of a new card move the others to the Left but thought I would mention this because maybe it is part of the Mat cargo bug too.

Regards;
Darren

Is the discard also a Mat? Do you use the feature that changes the edge conditions that Cargos ‘see’ as the edge of the mat? Could the shift left of the Mat be causing the cargo to ‘see’ the discard as a valid mat location?

1 Like

Yes. Two of the Decks are all Mats because they need to have the Dice (Cargo) move with them.

Both X & Y are set to Zero…

That is what I think might be happening. Is that normal or part of the bug? The Die (Cargo) would only have a microsecond to detach from its original Mat and attach to the discard before it disappears to the discard tray. I don’t see a way to delay the shift left to avoid this which is why I am (hopefully) changing how the Shift Left is activated from the Discard to drawing a replacement card instead.

Regards;
Darren

From what you are saying, the Die is being moved to a place where it could potentially belong to more than one mat.

You can’t really control which mat Vassal will ‘choose’ to associate the cargo with. The Cargo is just moved as normal pieces to the new location, where they take up residence on a Mat, if there is one there.

I used the command MoveOMap which I assigned to any Piece that ends movement on this Map so that the dice will be attached by dragging and placing them on the card. Your manual says that the Send To Location Trait also sends this Command…

Key Command

…so that may be why the dice switch Mats. I could assign a different Command and ad “Place On Card” or similar to the Right-Click menu for a manual attachment but simply placing the dice on the card makes for a more fluid game IMO.

Does the Move fixed Distance generate the same command as well? It does not say in the guide. If not then a de-bugged MFD may solve this problem?

I also found this in the Expression Builder…

Sleep

…not sure what it does I can’t find anything in the Manual but will experiment with it as well.

[Edit] never mind problem solved. The die will attach automatically without the MoveOnMap Command so all working now.

Regards;
Darren

Good you have worked it out.

Sleep(ms) refreshes the screen and sleeps for the specified number of milliseconds. I’m doing a run through the reference guide now, I’ll add that in.

1 Like

Thank for your help Brent. The last problem was my mistake, I had a command to attach the Cargo which wasn’t needed and was causing the Cargo to re-attach when the Send To Location was activated. Will the sleep Timer delay a command from firing by the specified time?

Regards;
Darren

Yes, That’s the idea, to slow down a sequence of commands so you can see the movement between each command. It’s a bit experimental, I’d be interested to get some feedback.

I tested the Sleep function with the problem I was having in this thread where a discard would move to the discard Tray and take the Mat Cargo with it from a neighbouring Mat. The Cards (Mats) were set up to move left, replacing the discard when the discard Command was issued. When the Command to Discard [SendToDiscard] was issued, A GKC sent the Command [ShiftDevLeft] to all Cards on the board position to the Right of the discard to shift them one zone to the left.

I used a Dynamic Property to activate the Sleep when [ShiftDevLeft] was detected.

The Mat Cargo remained on the original Mat when a neighbouring was discarded so it worked but there is a significant pause of roughly 3 seconds between when the discard occurs and the next card moves then another three seconds for the next card to shift etc.

The pause is about the same regardless whether the timer is set to 200 or 1ms. When I changed the timer to {Sleep()} all moved at normal speed and the Cargo remained on the board where it is supposed to be. All seemed fine except I did receive the following error;

2024-01-20 11:03:54,888 [9840-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece: Development_Command Station Trait: Dynamic Property - PauseCommand == ShiftDevLeft Source: {Sleep()} Error: Expression evaluation error. See the errorlog for more details. 
Expression Audit:
   Source type=Piece Trait
   Source name=Piece: Development_Command Station
   Source description=Trait: Dynamic Property - PauseCommand == ShiftDevLeft
   Source Expression={Sleep()}
   Error=: Command not found: Sleep()

A setting of {Sleep(0)} has the same 3 second delay result.
All of these Traits are in a Game Piece Prototype Definitions so are duplicated in all the cards in this Deck, possibly the command is delayed once when it is leaving the piece sending the GKS then again when it arrives in the Piece to be shifted.

Anyway here is some feedback and you can download the Demonstration here. The timer is set to 1 ms in this demonstration.


I hope this is useful.

Regards;
Darren

Thanks for the testing.

My memory was I was only playing around with testing this feature and when I look deeper, I find it is not properly implemented, so the Sleep is not working at all.

I’ll set up a test Build with this working if you could try it for me.

Regards,
Brent.

1 Like