Error message for uncalled send-to-location trait

I’ve encountered a vassal problem. I have a windows 11 64 bit computer, and I’m using vassal 3.8.0, but I saw the problem too with the previous version. I have not tested with earlier vassal versions.

I have a deck of tech tiles on a map called Tech. During game setup, I deal out 3 random tech tiles to a faceup display in Tech via 3 send-to-location commands: goSpace1, goSpace2, and goSpace3. A player can buy one of the tiles and move it to his player map window (e.g. “Red”). It joins his common tiles. The player map has an irregular grid. One region point is called “a1”. All tiles of this type have a command (^W) to send it to “a1,” which is a region that does not exist in the Tech window. I have a restricted command trait that hides ^W if it is not on a player map, i.e. it’s still on the Tech map. So far, so good.

I start a new game. The mod deals the first tech tile via goSpace1. It works, but I get this message:

Bad Data in Module: Piece: tech7 Trait: Send To Location - Go to Wheel => Ctrl+W Source: Region[{“a1”}]=a1 Error: Region not found.

This is an error message for a command that no one called.
“tech7” is the tech tile’s name, a random selection. “Go to Wheel” is the menu command for ^W. “goSpace1” has nothing to do with ^W other than the goSpace commands and ^W are traits in a tech tile. This should not be happening. Here’s the ^W command breakdown:

Send to location trait. “Go to Wheel”, control-W. Region on selected map. {CurrentMap}, region={“a1”}

I get the message only once, the first time I issue goToSpace1 and not for the others. If I undo and redo, I don’t get the message. I have to restart a new game to get the message. It sounds like I have a spurious ^W while the tech tile is on the Tech map, but that should be impossible because I have restricted the command to prevent this.

I added a report trait on ^W to see what CurrentMap was, and I made sure I checked override. The report never appears. I then duplicate the ^W trait and put the new command below the ^W one. I change the menu command and the ^W to a named command: gotohell. I start a game, and the error message complains about “gotohell,” which is never called.

I then change {CurrentMap} to {“Red”} in the ^W trait. I don’t get a message, but the tile doesn’t go to Red either. I smell a preprocessing rat.

If vassal could talk, I think it would say this: “Stan, I did goSpace1 as you asked, but as a courtesy I checked the syntax of another send-to-location in that piece. It looked suspicious because the Tech map doesn’t have an “a1” region. Just saying. I’m going to report this only once for your convenience. You can thank me later.”

Oddly enough, I had an earlier version of this mod where it didn’t complain. It happened only after I added a couple of lines unrelated to the scenario, and it continued even after I backed them out. It’s like I woke it up.

I think I can get around it, but it’s the kind of thing that would drive others nuts. Joel Toeppen in another thread complained about something vaguely similar, but his problem vanished when he did undo-redo. Maybe they are related. I can provide a stripped down vmod if someone wants to explore, but I’m not going to do it unless someone asks.

Oh, by the way, I see 3.8 lets me control movement via a property, but I don’t see how to do that. I don’t see anything new in does-not-stack.

Vassal reports the Bad Data only once if the text is the same so as not to spam the log. It’s quite likely the Bad Data occurs everytime. It only reports it on the first occurence.

When Vassal “Renders” a piece, it will look at all the commands defined on the piece. It will, to some extend, check if the command is valid. So, what happens is, when the tech7 piece is on the Tech map - i.e., CurrentMap=="Tech" - is that there’s no valid region called a1, and therefore complains.

The piece should go to the region named a1 on the Red map - if your restriction is set up correctly.

But, perhaps there’s something I’m not getting. If you could post your module somewhere, it will be easier to help you.

Yours,
Christian

What surprised me was the message didn’t reappear after an undo-redo. I expected vassal to reset the complete state.

Thanks for the info. I didn’t know it would behave this way. I didn’t know about this extra error checking.

I also know why it didn’t go to the red window. It was because the command was never issued. I substituted red for current map just to see if the error checking would pass it by. It did as I expected.

If your problem is solved, please remember to mark the solution. It helps other users find the solution to their problem. Only you as OP can do that.

Yours,
Christian