Special Grid Numbering Not Working with 3.6.7 (Solved!)

The 18xx style grid notation reporting I developed in 3.6.5 does not work in 3.6.7. I tried it in 3.6.6, and it seems to work there.

Here is a link to a sample module using it:
Edit: Changed link to version which now works:

The part that no longer works is the Location format in the Grid Numbering of the Main Map.

In 3.6.7 the chat log says this when I place a number 3 tile in hex C4:

  • SampleTilesOnMap version 0.005

  • Bad Data in Module: Source: {column+((2*row)-((“ABCDEFGHIJKLMNOPQRSTUVWXYZ”).indexOf(column)%2))} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.

  • TrackTile3 moves Tile_3 → *

  • TrackTile3 placed in facing SW

When I tried to re-install 3.6.6 I got this error:
image

So in 3.6.5 placing the tile in hex C4 generates this chat log:

  • SampleTilesOnMap version 0.005
  • TrackTile3 moves Tile_3 → C4 *

  • TrackTile3 placed in C4 facing SW

This is what I expect in the chat log from that action (working correctly)

I don’t know how to get the error log.

Location of error logs

1 Like

Thanks.

The error log:

2022-06-08 19:43:56,605 [7212-main] INFO VASSAL.launch.StartUp - Starting
2022-06-08 19:43:56,613 [7212-main] INFO VASSAL.launch.StartUp - OS Windows 11 10.0 amd64
2022-06-08 19:43:56,613 [7212-main] INFO VASSAL.launch.StartUp - Java version 18.0.1
2022-06-08 19:43:56,613 [7212-main] INFO VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.7\jre
2022-06-08 19:43:56,613 [7212-main] INFO VASSAL.launch.StartUp - VASSAL version 3.6.7
2022-06-08 19:43:56,692 [7212-AWT-EventQueue-0] INFO VASSAL.launch.ModuleManager - Manager
2022-06-08 19:44:05,627 [7212-SwingWorker-pool-2-thread-1] INFO VASSAL.launch.AbstractLaunchAction - Loading module file D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 19:44:05,663 [7212-SwingWorker-pool-2-thread-1] INFO VASSAL.launch.TilingHandler - No images to tile.
2022-06-08 19:44:05,664 [7212-SwingWorker-pool-2-thread-1] INFO VASSAL.launch.AbstractLaunchAction - Loading module SampleTilesOnMap
2022-06-08 19:44:05,669 [7212-SwingWorker-pool-2-thread-1] INFO VASSAL.tools.io.ProcessLauncher - launching C:\Program Files\VASSAL-3.6.7\jre\bin\java -Xms512M -Xmx512M -Duser.home=C:\Users\jimmy -Duser.dir=C:\Program Files\VASSAL-3.6.7 -cp lib\Vengine.jar -Dsun.java2d.d3d=false VASSAL.launch.Editor --edit – D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 19:44:06,308 [3644-main] INFO VASSAL.launch.StartUp - Starting
2022-06-08 19:44:06,317 [3644-main] INFO VASSAL.launch.StartUp - OS Windows 11 10.0 amd64
2022-06-08 19:44:06,317 [3644-main] INFO VASSAL.launch.StartUp - Java version 18.0.1
2022-06-08 19:44:06,317 [3644-main] INFO VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.7\jre
2022-06-08 19:44:06,317 [3644-main] INFO VASSAL.launch.StartUp - VASSAL version 3.6.7
2022-06-08 19:44:06,318 [3644-main] INFO VASSAL.launch.Launcher - Editor
2022-06-08 19:44:07,756 [3644-AWT-EventQueue-0] INFO VASSAL.build.GameModule - SampleTilesOnMap version 0.005
2022-06-08 19:44:20,472 [3644-AWT-EventQueue-0] WARN VASSAL.tools.ErrorDialog - Source: {column+((2*row)-((“ABCDEFGHIJKLMNOPQRSTUVWXYZ”).indexOf(column)%2))} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.
2022-06-08 19:45:15,113 [3644-AWT-EventQueue-0] INFO VASSAL.build.GameModule - Exiting
2022-06-08 19:45:24,070 [7212-SwingWorker-pool-2-thread-2] INFO VASSAL.launch.AbstractLaunchAction - Loading module file D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 19:45:24,075 [7212-SwingWorker-pool-2-thread-2] INFO VASSAL.launch.TilingHandler - No images to tile.
2022-06-08 19:45:24,076 [7212-SwingWorker-pool-2-thread-2] INFO VASSAL.launch.AbstractLaunchAction - Loading module SampleTilesOnMap
2022-06-08 19:45:24,077 [7212-SwingWorker-pool-2-thread-2] INFO VASSAL.tools.io.ProcessLauncher - launching C:\Program Files\VASSAL-3.6.7\jre\bin\java -Xms512M -Xmx512M -Duser.home=C:\Users\jimmy -Duser.dir=C:\Program Files\VASSAL-3.6.7 -cp lib\Vengine.jar -Dsun.java2d.d3d=false VASSAL.launch.Editor --edit – D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 19:45:24,597 [18300-main] INFO VASSAL.launch.StartUp - Starting
2022-06-08 19:45:24,608 [18300-main] INFO VASSAL.launch.StartUp - OS Windows 11 10.0 amd64
2022-06-08 19:45:24,608 [18300-main] INFO VASSAL.launch.StartUp - Java version 18.0.1
2022-06-08 19:45:24,608 [18300-main] INFO VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.7\jre
2022-06-08 19:45:24,608 [18300-main] INFO VASSAL.launch.StartUp - VASSAL version 3.6.7
2022-06-08 19:45:24,608 [18300-main] INFO VASSAL.launch.Launcher - Editor
2022-06-08 19:45:25,835 [18300-AWT-EventQueue-0] INFO VASSAL.build.GameModule - SampleTilesOnMap version 0.005
2022-06-08 19:53:16,014 [18300-AWT-EventQueue-0] INFO VASSAL.build.GameModule - Exiting
2022-06-08 19:53:17,912 [7212-AWT-EventQueue-0] INFO VASSAL.launch.ModuleManagerWindow - Exiting

I’m guessing the problem has something to do with the row and column properties in the Grid Numbering.

Why don’t you do as the error log asks, and turn on the Audit Trail preference and run it again?

Error Log with Audit Trail:

2022-06-08 21:30:00,799 [6532-main] INFO VASSAL.launch.StartUp - Starting
2022-06-08 21:30:00,811 [6532-main] INFO VASSAL.launch.StartUp - OS Windows 11 10.0 amd64
2022-06-08 21:30:00,811 [6532-main] INFO VASSAL.launch.StartUp - Java version 18.0.1
2022-06-08 21:30:00,811 [6532-main] INFO VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.7\jre
2022-06-08 21:30:00,812 [6532-main] INFO VASSAL.launch.StartUp - VASSAL version 3.6.7
2022-06-08 21:30:00,893 [6532-AWT-EventQueue-0] INFO VASSAL.launch.ModuleManager - Manager
2022-06-08 21:30:15,532 [6532-SwingWorker-pool-2-thread-1] INFO VASSAL.launch.AbstractLaunchAction - Loading module file D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 21:30:15,571 [6532-SwingWorker-pool-2-thread-1] INFO VASSAL.launch.TilingHandler - No images to tile.
2022-06-08 21:30:15,572 [6532-SwingWorker-pool-2-thread-1] INFO VASSAL.launch.AbstractLaunchAction - Loading module SampleTilesOnMap
2022-06-08 21:30:15,576 [6532-SwingWorker-pool-2-thread-1] INFO VASSAL.tools.io.ProcessLauncher - launching C:\Program Files\VASSAL-3.6.7\jre\bin\java -Xms512M -Xmx512M -Duser.home=C:\Users\jimmy -Duser.dir=C:\Program Files\VASSAL-3.6.7 -cp lib\Vengine.jar -Dsun.java2d.d3d=false VASSAL.launch.Editor --edit – D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 21:30:16,237 [9180-main] INFO VASSAL.launch.StartUp - Starting
2022-06-08 21:30:16,249 [9180-main] INFO VASSAL.launch.StartUp - OS Windows 11 10.0 amd64
2022-06-08 21:30:16,249 [9180-main] INFO VASSAL.launch.StartUp - Java version 18.0.1
2022-06-08 21:30:16,249 [9180-main] INFO VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.7\jre
2022-06-08 21:30:16,249 [9180-main] INFO VASSAL.launch.StartUp - VASSAL version 3.6.7
2022-06-08 21:30:16,249 [9180-main] INFO VASSAL.launch.Launcher - Editor
2022-06-08 21:30:17,768 [9180-AWT-EventQueue-0] INFO VASSAL.build.GameModule - SampleTilesOnMap version 0.005
2022-06-08 21:31:44,130 [9180-AWT-EventQueue-0] INFO VASSAL.build.GameModule - Exiting
2022-06-08 21:32:06,823 [6532-SwingWorker-pool-2-thread-2] INFO VASSAL.launch.AbstractLaunchAction - Loading module file D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 21:32:06,827 [6532-SwingWorker-pool-2-thread-2] INFO VASSAL.launch.TilingHandler - No images to tile.
2022-06-08 21:32:06,828 [6532-SwingWorker-pool-2-thread-2] INFO VASSAL.launch.AbstractLaunchAction - Loading module SampleTilesOnMap
2022-06-08 21:32:06,829 [6532-SwingWorker-pool-2-thread-2] INFO VASSAL.tools.io.ProcessLauncher - launching C:\Program Files\VASSAL-3.6.7\jre\bin\java -Xms512M -Xmx512M -Duser.home=C:\Users\jimmy -Duser.dir=C:\Program Files\VASSAL-3.6.7 -cp lib\Vengine.jar -Dsun.java2d.d3d=false VASSAL.launch.Editor --edit – D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 21:32:07,363 [19576-main] INFO VASSAL.launch.StartUp - Starting
2022-06-08 21:32:07,373 [19576-main] INFO VASSAL.launch.StartUp - OS Windows 11 10.0 amd64
2022-06-08 21:32:07,373 [19576-main] INFO VASSAL.launch.StartUp - Java version 18.0.1
2022-06-08 21:32:07,373 [19576-main] INFO VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.7\jre
2022-06-08 21:32:07,373 [19576-main] INFO VASSAL.launch.StartUp - VASSAL version 3.6.7
2022-06-08 21:32:07,373 [19576-main] INFO VASSAL.launch.Launcher - Editor
2022-06-08 21:32:08,588 [19576-AWT-EventQueue-0] INFO VASSAL.build.GameModule - SampleTilesOnMap version 0.005
2022-06-08 21:32:20,037 [19576-AWT-EventQueue-0] WARN VASSAL.tools.ErrorDialog - Source: {column+((2row)-((“ABCDEFGHIJKLMNOPQRSTUVWXYZ”).indexOf(column)%2))} Error: Expression evaluation error. See the errorlog for more details.
Expression Audit:
Source type=
Source name=
Source field=Location format
Source Expression={column+((2
row)-((“ABCDEFGHIJKLMNOPQRSTUVWXYZ”).indexOf(column)%2))}
column=C
row=02
Error=internal Error: Unimplemented binary String operator
2022-06-08 21:33:17,863 [19576-AWT-EventQueue-0] INFO VASSAL.build.GameModule - Exiting

Can you edit that and put three backticks (`) before and after the log (to remove the unwanted formatting)?

log with 3 back ticks:

2022-06-08 21:30:00,811 [6532-main] INFO  VASSAL.launch.StartUp - OS Windows 11 10.0 amd64
2022-06-08 21:30:00,811 [6532-main] INFO  VASSAL.launch.StartUp - Java version 18.0.1
2022-06-08 21:30:00,811 [6532-main] INFO  VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.7\jre
2022-06-08 21:30:00,812 [6532-main] INFO  VASSAL.launch.StartUp - VASSAL version 3.6.7
2022-06-08 21:30:00,893 [6532-AWT-EventQueue-0] INFO  VASSAL.launch.ModuleManager - Manager
2022-06-08 21:30:15,532 [6532-SwingWorker-pool-2-thread-1] INFO  VASSAL.launch.AbstractLaunchAction - Loading module file D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 21:30:15,571 [6532-SwingWorker-pool-2-thread-1] INFO  VASSAL.launch.TilingHandler - No images to tile.
2022-06-08 21:30:15,572 [6532-SwingWorker-pool-2-thread-1] INFO  VASSAL.launch.AbstractLaunchAction - Loading module SampleTilesOnMap
2022-06-08 21:30:15,576 [6532-SwingWorker-pool-2-thread-1] INFO  VASSAL.tools.io.ProcessLauncher - launching C:\Program Files\VASSAL-3.6.7\jre\bin\java -Xms512M -Xmx512M -Duser.home=C:\Users\jimmy -Duser.dir=C:\Program Files\VASSAL-3.6.7 -cp lib\Vengine.jar -Dsun.java2d.d3d=false VASSAL.launch.Editor --edit -- D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 21:30:16,237 [9180-main] INFO  VASSAL.launch.StartUp - Starting
2022-06-08 21:30:16,249 [9180-main] INFO  VASSAL.launch.StartUp - OS Windows 11 10.0 amd64
2022-06-08 21:30:16,249 [9180-main] INFO  VASSAL.launch.StartUp - Java version 18.0.1
2022-06-08 21:30:16,249 [9180-main] INFO  VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.7\jre
2022-06-08 21:30:16,249 [9180-main] INFO  VASSAL.launch.StartUp - VASSAL version 3.6.7
2022-06-08 21:30:16,249 [9180-main] INFO  VASSAL.launch.Launcher - Editor
2022-06-08 21:30:17,768 [9180-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - SampleTilesOnMap version 0.005
2022-06-08 21:31:44,130 [9180-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - Exiting
2022-06-08 21:32:06,823 [6532-SwingWorker-pool-2-thread-2] INFO  VASSAL.launch.AbstractLaunchAction - Loading module file D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 21:32:06,827 [6532-SwingWorker-pool-2-thread-2] INFO  VASSAL.launch.TilingHandler - No images to tile.
2022-06-08 21:32:06,828 [6532-SwingWorker-pool-2-thread-2] INFO  VASSAL.launch.AbstractLaunchAction - Loading module SampleTilesOnMap
2022-06-08 21:32:06,829 [6532-SwingWorker-pool-2-thread-2] INFO  VASSAL.tools.io.ProcessLauncher - launching C:\Program Files\VASSAL-3.6.7\jre\bin\java -Xms512M -Xmx512M -Duser.home=C:\Users\jimmy -Duser.dir=C:\Program Files\VASSAL-3.6.7 -cp lib\Vengine.jar -Dsun.java2d.d3d=false VASSAL.launch.Editor --edit -- D:\Jimmy\Vassal\Tips & Tricks\SampleTilesOnMap v0-005.vmod
2022-06-08 21:32:07,363 [19576-main] INFO  VASSAL.launch.StartUp - Starting
2022-06-08 21:32:07,373 [19576-main] INFO  VASSAL.launch.StartUp - OS Windows 11 10.0 amd64
2022-06-08 21:32:07,373 [19576-main] INFO  VASSAL.launch.StartUp - Java version 18.0.1
2022-06-08 21:32:07,373 [19576-main] INFO  VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.7\jre
2022-06-08 21:32:07,373 [19576-main] INFO  VASSAL.launch.StartUp - VASSAL version 3.6.7
2022-06-08 21:32:07,373 [19576-main] INFO  VASSAL.launch.Launcher - Editor
2022-06-08 21:32:08,588 [19576-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - SampleTilesOnMap version 0.005
2022-06-08 21:32:20,037 [19576-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog -   Source: {column+((2*row)-(("ABCDEFGHIJKLMNOPQRSTUVWXYZ").indexOf(column)%2))} Error: Expression evaluation error. See the errorlog for more details. 
Expression Audit:
   Source type=
   Source name=
   Source field=Location format
   Source Expression={column+((2*row)-(("ABCDEFGHIJKLMNOPQRSTUVWXYZ").indexOf(column)%2))}
   column=C
   row=02
   Error=internal Error: Unimplemented binary String operator
2022-06-08 21:33:17,863 [19576-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - Exiting```

Huh, looks like something is broken in the BeanShell interpreter. @Brent_Easton?

1 Like

This is the specific reason for the Unimplemented binary String operator error, the column variable has a value of “C” which is causing the arithmetical expression to fail.

D’oh! Don’t know how I missed that. I don’t understand how that expression could have ever worked.

Edit: Nevermind, I think the idea was to end with the string “C4” as the result–in other words, the initial + is supposed to be adding a string to an integer and resulting in a string (which apparently it did before 3.6.7).

Would adding .toString() after the last closing parenthesis fix it?

1 Like

Hmmm. Actually, that should work. If the first argument of + is a string, Beanshell should try and coerce the second argument into being a string as well.

Ah, I know what it is.

We did make a change where Strings commencing with “0” are internally stored as Strings, even if they look like an integer so that the leading “0” is not lost. These tend to only be created by HexGridNumberings and the leading “0” is significant when reporting. So in your case, you will need to convert row to and Integer before multiplying it by 2. This is a bit painful, but it is the only way we can keep the significant leading 0.

Integer.parseInt(row) should work.

1 Like

Ah, the law of unintended consequences strikes again! :sweat_smile:

1 Like

So, to summarize, the failure is actually with the 2*row part of the equation, because VASSAL is now refusing to automatically convert “02” to an Integer, because of the leading zero. The solution is to change 2*row to 2*Integer.parseInt(row).

1 Like

Correct.

There is a way to make this work in all cases, but it would require significant surgery on the Beanshell Interpreter and a significant run-time overhead for every arithmetic operator applied to two strings, or a String and an Integer, of first re-checking whether both are actually numbers and doing the numerical operation instead. I considered that this would likely impose an unacceptable performance hit.

1 Like

Hmm. Might want to rethink that, as we now know that change broke at least 1 module (admittedly, I think @pawnpusher only just added that feature to the module, but there’s no reason someone else couldn’t have already been doing math with numbers with leading zeros).

1 Like

:balance_scale:

How many complex modules will become unacceptably slow if the change is added so that one module (that we know of) can keep working unchanged using the old buggy behavior? Using Hex co-ordinates for any meaningful arithmetic is pretty esoteric. I would not have touched this except that the existing behavior was demonstrably bugged and correctly using Hex-coords with leading zeros in several different areas was impossible.

If this does turn out to be a wider problem, then I will consider adding a Compatibility option ‘Hex row/columns with leading zeros are numbers, not strings?’ Y/N

2 Likes

Well, another use of hex coordinates in meaningful arithmetic was demonstrated in another thread we both participated in recently, where Palad0n was trying to find the distance moved by a piece. I suppose that was still fresh in my mind as a possible example.

2 Likes

Yes, they are the 2 cases I am aware of and both were discussed extensively on the forum and Discord since it is such a tricky area to work with.

1 Like

Hmmm, this will potentially affect arithmetic on Square grid co-ordinates as well which is far more likely to have been used in the past.

Perhaps a better solution is to add a Global Option (i.e. can be set by the Module Designer) to opt-in to the ‘Convert numbers with leading zeros to strings’ behaviour. Then only modules that require that behaviour will need to be updated. And add some text to the Grid Numbering reference manual page about it.

1 Like

Thank you!

For the benefit of those who need the leading zeros in their hex designations (numbers), I will gladly add the conversion of the numeric part to my grid designation conversion formula.