Mat shrinking in 3.6.0

Is the description in help correct?

"Key Command to force attach to any mat found at current location:

If the piece receives this key command, it will immediately search for (and attempt to attach itself to) any available mat at its current location; if it was already attached to a mat but is no longer overlapping it, it will be detached."

It appears that this means this command (and not the detach command) should be sufficient to detach Cargo from a Mat that has just been shrunk, but in testing it does not seem to have this effect. Does the description need updating, or is this a bug? (or maybe I did something wrong, but it seems like it should be simple enough)

What would I do (steps in the module) to attempt to activate what you’re trying to do there?

You have a commander with 5+ units on it, and you right-click the commander and select shrink mat. That makes the mat have a length of about 4 units, and applies the force attach command to all units.

All 5+ units will still move with the commander.

Thx I will have a look.

I think you just have some kind of key command issue here – the pieces you want to receive the “find new mat” command are never actually receiving the key command. Probably trace that down with some “report” traits or something until you are getting the “setup” command reported received in the target (cargo) pieces? I think they might not be receiving your GKC.

Ah, a capitalisation problem, yes, thank you. Sorry.

1 Like

No problem. And for clarity to anyone coming by later – yes the description you gave above about how this all “should work” is correct. AFAIK :slight_smile:

Hmm, still doesn’t work. This build includes a “mat attach command received” report. Only units that should be detached actually report, I’m not sure why that is, but regardless, they stay on the Mat.

Seems like it’s actually working to me – I shrink the mat and voila, if I click on the leader and move him he moves without that piece.

Caveat – you might still have the other units selected since you haven’t changed the current selection (you’ve just unbound some of the piece(s) from the mat). So if you just started a drag without deselecting the cargo pieces then they would of course “come with” since that’s the normal Vassal behavior when you have a bunch of pieces selected and you drag on one. You can probably make it more intuitive for users in this case by using the Deselect trait – like after the cargo piece runs the “find new mat” you could have it check a trigger if CurrentMat=="" and if so deselect itself.

1 Like

Wow, I do seem to be wasting your time today, sorry!

Yes, I need to deselect the pieces as part of the shrink, d’oh.

1 Like

No problem at all. It’s tricksy stuff. And you can’t set a code breakpoint like I can :wink: