Problem with substring reporting error in log but working right on counter

I have a situation here where we have a value for AA that decrements with damage, but the decrementation is not linear. You may have three AA values on a ship. The first is “5” the second is “3” and the third is “1” so simply decrementing the dynamic value of AA won’t do the trick. We got around that by making a marker that holds a string of the values that looks like this.


So the name of the marker is aa5310

The value looks like this: 5 3 1 0 note the spaces in the string, we pull two characters at a time so the first two are _5 the second two are _3 and so on. These get displayed on the counter. (underscore not part of the real value just to show that the space is intentional)

To figure out what two characters to show we have this in the Label text:

{aa5310.substring(localAA2,localAA2+2).trim()}

This works on the piece and it is all good, but for each separate marker (separate reusable values that might be on many ships in a game), it reports an error in the log which I want to eliminate or supress

This value for flight deck damage works without error and looks like this:

{flightDeckDamage.substring(localFlightDeck2,localFlightDeck2+2).trim()}

Below: Counter with full strength, counter with AA and Flight deck decremented once, counter with AA and Flight deck decremented twice.

Screenshot 2024-07-12 at 8.55.41 AM

Screenshot 2024-07-12 at 8.56.02 AM

Screenshot 2024-07-12 at 8.56.17 AM

The error looks like this and is on start of the module, not generated as the game is played.

  • Bad Data in Module: Piece: Trait: Text Label - AA Factor aa5310 - {aa5310.substring(localAA2,localAA2+2).trim()} Source: {aa5310.substring(localAA2,localAA2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.

Anyone have an idea on this? The only difference between flight deck data and AA data is that the marker for the AA is in a prototype several layers deep and the marker for the flight deck is in the prototype for the ship class so it is consumed at the same level as the text label.

I think your implementation is too complicated. Here is how I would do your problem.

It would be a perfect spot for an array, but Vassal doesn’t do arrays, so I’d have to fake it. In array-ese, I would define an array v[4] (v for values). V[0]=5, v[1]=3, v[2]=1, v[4]=0. I’d also define a dynamic property aaindex=0. Each time this ship takes aa damage, I’d increment aaindex by 1. In java, it would be ++aaindex. This means the ship’s current aa value is always aa = v[aaindex].

In vassal, I first would create 4 marker traits: v0=5, v1=3, v2=1, v3=0.
I would make a dynamic property, aaindex with range 0-3, no wrapping. I would add an increment-by-1 command, let’s say increment_aaindex. I would also create another dynamic property called aa to conveniently hold the value.

When the ship got damage, I would run through a trigger that did this:
Increment_aaindex.
Aa = GetProperty(“v” + aaindex).
Done.

1 Like

OK I left out the dynamic property in my description that is set just as you say. Exactly. I wanted an array too and of course there is none. So the difference is that you have different markers for the values and I have one string. Both of us are faking an array. (ARE YOU LISTENING VASSAL).

The problem with this solution presented is that you would need to do all the markers for each class of ship in the class prototype so there would be four (n) markers and I could cycle through them and that is fine. A good simple solution. However, there are many classes of ships (40+) and perhaps 10 AA configurations so as I have them defined now, they are in one place and available to all ship classes and modifiable in one location in a prototype at the bottom of the stack.

In this case that isn’t really that useful but in terms of programming, I like having an array (which does not exist) and the string better than the markers defined in each ship class because now the same data is in multiple places and that scares me as I do make mistakes and need to update some values.

I guess my question is why does one use generate an error and a copy/paste/change does NOT generate one.

I will think about trying your solution and I understand exactly how to do that. Thank you it is a great idea

Could you please turn in the Audit Trail preference, reproduce the problem and post any additional information that appears in the errorlog. It should show what the actual value of aa5310 and localAA is at the time of the error.

Both of us are faking an array. (ARE YOU LISTENING VASSAL).

The hardest part of incorporating new functionality is often envisaging what the implementation would look like and what the use cases are.

What do think the definition of an Array would look like?

  • Perhaps a type of Dynamic Property that allows a list of values?

How do you envisage accessing elements of that array?

  • Via a function?
  • Via Beanshell native array reference notation?

Do you expect to be able to set new values into individual array elements?

  • What would that look like?

Just found it.

See below for the log

Perhaps a type of Dynamic Property that allows a list of values?<<

That would be great! Ideally it would be like a js array:

aaArray[5,3,1,0] and I would want to reference it like so
aaArray[2] to get 1 or aaArray[0] to get 5

or with strings

aaArray[“cat”,“mouse”,“goat”] and I would want to reference it like so: aaArray[2] to get “goat” or aaArray[0] to get “cat”

How do you envisage accessing elements of that array?<<

Not that familiar with Java but as above would be great. As long as it is documented and I can return a value from the array by index, I could do anything if you had good examples for me to work from

I think that we should be able to set values programmatically. I don’t know how I would use that, but I think if we have them they should be complete in that you could read and write to them.

I see that I AM getting an error in one of my flight decks.

I don’t see a problem. It avoids godawful string parsing and is easy to understand.

1 Like

You need to enclose your copy-pasted logs in back-tics (`) to disable formatting (if you didn’t notice, all your asterisks (*) are being erased and instead toggling italics on or off). For multi-line logs, use 3 back-tics (```) before and after. It also looks like the longer lines in that error log got truncated somewhere, with a $ sign added at the end.

If you’re pasting code, you can also enclose within [code] [/code] to get some syntax highlighting and a horizontal scrollbar.

1 Like
errorLog-3.5.8		key-3.6.15		lock-3.6.2
errorLog-3.6.15		key-3.6.19		lock-3.6.5
errorLog-3.6.19		key-3.6.2		lock-3.6.6
errorLog-3.6.2		key-3.6.5		lock-3.6.7
errorLog-3.6.5		key-3.6.6		lock-3.7.1
errorLog-3.6.6		key-3.6.7		lock-3.7.8
errorLog-3.6.7		key-3.7.1		lock-3.7.9
errorLog-3.7.1		key-3.7.8		plugins
errorLog-3.7.8		key-3.7.9		prefs
errorLog-3.7.9		lock-3.5.8		qcconfigs
ext			lock-3.6.15		tiles
key-3.5.8		lock-3.6.19		vassal.vmoptions
mabrown@HQ-C02GJ0ZDMD6P VASSAL % cd errorLog-3.7.9
cd: not a directory: errorLog-3.7.9
mabrown@HQ-C02GJ0ZDMD6P VASSAL % nano errorLog-3.7.9

  UW PICO 5.09                                                                                                                                                                  File: errorLog-3.7.9                                                                                                                                                                     

2024-07-12 14:09:19,966 [21402-main] INFO  VASSAL.launch.StartUp - Starting
2024-07-12 14:09:20,034 [21402-main] INFO  VASSAL.launch.StartUp - OS Mac OS X 14.4.1 x86_64
2024-07-12 14:09:20,035 [21402-main] INFO  VASSAL.launch.StartUp - Java version 21.0.2
2024-07-12 14:09:20,035 [21402-main] INFO  VASSAL.launch.StartUp - Java home /Volumes/Matt BU/VASSAL.app/Contents/MacOS/jre
2024-07-12 14:09:20,035 [21402-main] INFO  VASSAL.launch.StartUp - VASSAL version 3.7.9
2024-07-12 14:09:22,699 [21402-AWT-EventQueue-0] INFO  VASSAL.launch.ModuleManager - Manager
2024-07-12 14:09:28,719 [21402-SwingWorker-pool-1-thread-1] INFO  VASSAL.launch.AbstractLaunchAction - Loading module file /Volumes/Matt BU/GWAS:SWWAS/__DEV SP DEV/SP-DEV <-- Hot Copy/SP_Dev-7.vmod
2024-07-12 14:09:30,536 [21402-SwingWorker-pool-1-thread-1] INFO  VASSAL.launch.TilingHandler - No images to tile.
2024-07-12 14:09:30,537 [21402-SwingWorker-pool-1-thread-1] INFO  VASSAL.launch.AbstractLaunchAction - Loading module SWWAS - South Pacific 2022
2024-07-12 14:09:30,558 [21402-SwingWorker-pool-1-thread-1] INFO  VASSAL.tools.io.ProcessLauncher - launching /Volumes/Matt BU/VASSAL.app/Contents/MacOS/jre/bin/java -Xms2048M -Xmx2048M -Duser.home=/Users/mabrown -Duser.dir=/Volumes/Matt BU/VASSAL.app -cp Contents/Resources/Java/Vengine.jar -Xdock:name=SWWAS - South Pacific 2022 -Xdock:icon=/Volumes/Matt BU/$
2024-07-12 14:09:31,866 [21419-main] INFO  VASSAL.launch.StartUp - Starting
2024-07-12 14:09:31,876 [21419-main] INFO  VASSAL.launch.StartUp - OS Mac OS X 14.4.1 x86_64
2024-07-12 14:09:31,876 [21419-main] INFO  VASSAL.launch.StartUp - Java version 21.0.2
2024-07-12 14:09:31,877 [21419-main] INFO  VASSAL.launch.StartUp - Java home /Volumes/Matt BU/VASSAL.app/Contents/MacOS/jre
2024-07-12 14:09:31,877 [21419-main] INFO  VASSAL.launch.StartUp - VASSAL version 3.7.9
2024-07-12 14:09:31,877 [21419-main] INFO  VASSAL.launch.Launcher - Editor
2024-07-12 14:09:32,911 [21402-ProcessLauncher-2] WARN  VASSAL.tools.logging.LoggedOutputStream - 2024-07-12 14:09:32.911 java[21419:6025609] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicati$
2024-07-12 14:09:33,311 [21402-ProcessLauncher-2] WARN  VASSAL.tools.logging.LoggedOutputStream - 2024-07-12 14:09:33.311 java[21419:6025609] *** WARNING: References to Carbon menus are disallowed with AppKit menu system on macOS 14 and newer. Use instances of NSMenu and NSMenuItem directly instead. See https://developer.apple.com/documentation/macos-release$
2024-07-12 14:09:38,082 [21419-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - SWWAS - South Pacific 2022 version 1.4
2024-07-12 14:09:38,311 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa3210 - {aa3210.substring(localAA*2,localAA*2+2).trim()} Source: {aa3210.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 14:09:38,405 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa4210 - {aa4210.substring(localAA*2,localAA*2+2).trim()} Source: {aa4210.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 14:09:38,420 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa5310 - {aa5310.substring(localAA*2,localAA*2+2).trim()} Source: {aa5310.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 14:09:38,435 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa6420 - {aa6420.substring(localAA*2,localAA*2+2).trim()} Source: {aa6420.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 14:09:38,486 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - Flight Deck Damage - {flightDeckDamage.substring(localFlightDeck*2,localFlightDeck*2+2).trim()} Source: {flightDeckDamage.substring(localFlightDeck*2,localFlightDeck*2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference $
2024-07-12 14:09:38,597 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa108530 - {aa108530.substring(localAA*2,localAA*2+2).trim()} Source: {aa108530.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 14:09:38,662 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa10 - {aa10.substring(localAA*2,localAA*2+2).trim()} Source: {aa10.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 14:09:38,708 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa20 - {aa20.substring(localAA*2,localAA*2+2).trim()} Source: {aa20.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 14:09:38,835 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa53210 - {aa53210.substring(localAA*2,localAA*2+2).trim()} Source: {aa53210.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 14:20:04,903 [21419-AWT-EventQueue-0] INFO  VASSAL.tools.io.ProcessLauncher - launching /Volumes/Matt BU/VASSAL.app/Contents/MacOS/jre/bin/java -classpath Contents/Resources/Java/Vengine.jar -Duser.dir=/Volumes/Matt BU/VASSAL.app VASSAL.launch.ModuleManager --update-module /Volumes/Matt BU/GWAS:SWWAS/__DEV SP DEV/SP-DEV <-- Hot Copy/SP_Dev-7.vmod
2024-07-12 14:57:51,743 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog -  Source: warship-1.png Error: Image not found. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 14:59:21,897 [21402-SwingWorker-pool-1-thread-2] INFO  VASSAL.launch.AbstractLaunchAction - Loading module file /Volumes/Matt BU/GWAS:SWWAS/DEV RTM/DEV/GWAS-Remember the Maine 1.5 DEV <--HOT/GWAS-Remember_the_Maine_1.5.vmod
2024-07-12 14:59:22,790 [21402-SwingWorker-pool-1-thread-2] INFO  VASSAL.launch.TilingHandler - No images to tile.
2024-07-12 14:59:22,791 [21402-SwingWorker-pool-1-thread-2] INFO  VASSAL.launch.AbstractLaunchAction - Loading module GWAS - Remember the Maine 2024
2024-07-12 14:59:22,795 [21402-SwingWorker-pool-1-thread-2] INFO  VASSAL.tools.io.ProcessLauncher - launching /Volumes/Matt BU/VASSAL.app/Contents/MacOS/jre/bin/java -Xms2048M -Xmx2048M -Duser.home=/Users/mabrown -Duser.dir=/Volumes/Matt BU/VASSAL.app -cp Contents/Resources/Java/Vengine.jar -Xdock:name=GWAS - Remember the Maine 2024 -Xdock:icon=/Volumes/Matt$
2024-07-12 14:59:24,276 [23523-main] INFO  VASSAL.launch.StartUp - Starting
2024-07-12 14:59:24,317 [23523-main] INFO  VASSAL.launch.StartUp - OS Mac OS X 14.4.1 x86_64
2024-07-12 14:59:24,317 [23523-main] INFO  VASSAL.launch.StartUp - Java version 21.0.2
2024-07-12 14:59:24,317 [23523-main] INFO  VASSAL.launch.StartUp - Java home /Volumes/Matt BU/VASSAL.app/Contents/MacOS/jre
2024-07-12 14:59:24,318 [23523-main] INFO  VASSAL.launch.StartUp - VASSAL version 3.7.9
2024-07-12 14:59:24,318 [23523-main] INFO  VASSAL.launch.Launcher - Editor
2024-07-12 14:59:24,559 [21402-ProcessLauncher-2] WARN  VASSAL.tools.logging.LoggedOutputStream - 2024-07-12 14:59:24.559 java[23523:6072018] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicati$
2024-07-12 14:59:25,669 [21402-ProcessLauncher-2] WARN  VASSAL.tools.logging.LoggedOutputStream - 2024-07-12 14:59:25.669 java[23523:6072018] *** WARNING: References to Carbon menus are disallowed with AppKit menu system on macOS 14 and newer. Use instances of NSMenu and NSMenuItem directly instead. See https://developer.apple.com/documentation/macos-release$
2024-07-12 14:59:28,511 [23523-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - GWAS - Remember the Maine 2024 version 1.5
2024-07-12 15:02:46,502 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog -  Source: merchnt-3.png Error: Image not found. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 15:04:22,609 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog -  Source: merchnt-2.png Error: Image not found. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 15:04:22,611 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog -  Source: merchnt-1.png Error: Image not found. Turn on the Audit Trail preference to generate more details in the errorlog.
2024-07-12 15:08:32,855 [21419-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog -  Source: ThanksAndLinksSouthPacificPanel-m.html Error: HTMLImageFinder not found
2024-07-12 15:08:45,197 [23523-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - Exiting
2024-07-12 15:18:59,880 [21419-AWT-EventQueue-0] INFO  VASSAL.tools.io.ProcessLauncher - launching /Volumes/Matt BU/VASSAL.app/Contents/MacOS/jre/bin/java -classpath Contents/Resources/Java/Vengine.jar -Duser.dir=/Volumes/Matt BU/VASSAL.app VASSAL.launch.ModuleManager --update-module /Volumes/Matt BU/GWAS:SWWAS/__DEV SP DEV/SP-DEV <-- Hot Copy/SP_Dev-7.vmod
2024-07-12 15:44:09,636 [21419-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - Exiting
2024-07-12 15:44:15,390 [21402-SwingWorker-pool-1-thread-3] INFO  VASSAL.launch.AbstractLaunchAction - Loading module file /Volumes/Matt BU/GWAS:SWWAS/__DEV SP DEV/SP-DEV <-- Hot Copy/SP_Dev-7.vmod
2024-07-12 15:44:15,787 [21402-SwingWorker-pool-1-thread-3] INFO  VASSAL.launch.TilingHandler - No images to tile.
2024-07-12 15:44:15,788 [21402-SwingWorker-pool-1-thread-3] INFO  VASSAL.launch.AbstractLaunchAction - Loading module SWWAS - South Pacific 2022
2024-07-12 15:44:15,790 [21402-SwingWorker-pool-1-thread-3] INFO  VASSAL.tools.io.ProcessLauncher - launching /Volumes/Matt BU/VASSAL.app/Contents/MacOS/jre/bin/java -Xms2048M -Xmx2048M -Duser.home=/Users/mabrown -Duser.dir=/Volumes/Matt BU/VASSAL.app -cp Contents/Resources/Java/Vengine.jar -Xdock:name=SWWAS - South Pacific 2022 -Xdock:icon=/Volumes/Matt BU/$
2024-07-12 15:44:17,313 [25778-main] INFO  VASSAL.launch.StartUp - Starting
2024-07-12 15:44:17,340 [25778-main] INFO  VASSAL.launch.StartUp - OS Mac OS X 14.4.1 x86_64

@jrwatts Thank you!

nano is still cutting off the end of longer lines. Why not just use cat?

Can you please re-generate the error after turning the Audit preference on? It should display the values of the variables in the expression.

1 Like
2024-07-17 12:12:30,356 [30303-main] INFO  VASSAL.launch.StartUp - Starting
2024-07-17 12:12:30,384 [30303-main] INFO  VASSAL.launch.StartUp - OS Mac OS X 14.4.1 x86_64
2024-07-17 12:12:30,384 [30303-main] INFO  VASSAL.launch.StartUp - Java version 21.0.2
2024-07-17 12:12:30,384 [30303-main] INFO  VASSAL.launch.StartUp - Java home /Users/mabrown/Desktop/VASSAL.app/Contents/MacOS/jre
2024-07-17 12:12:30,384 [30303-main] INFO  VASSAL.launch.StartUp - VASSAL version 3.7.9
2024-07-17 12:12:31,251 [30303-AWT-EventQueue-0] INFO  VASSAL.launch.ModuleManager - Manager
2024-07-17 12:12:47,984 [30303-SwingWorker-pool-1-thread-1] INFO  VASSAL.launch.AbstractLaunchAction - Loading module file /Volumes/Matt BU/GWAS:SWWAS/__DEV SP DEV/SP-DEV <-- Hot Copy/SP_Dev-7.vmod
2024-07-17 12:12:49,455 [30303-SwingWorker-pool-1-thread-1] INFO  VASSAL.tools.io.ProcessLauncher - launching /Users/mabrown/Desktop/VASSAL.app/Contents/MacOS/jre/bin/java -classpath Contents/Resources/Java/Vengine.jar -Xmx150M -Duser.home=/Users/mabrown VASSAL.tools.image.tilecache.ZipFileImageTiler /Volumes/Matt BU/GWAS:SWWAS/__DEV SP DEV/SP-DEV <-- Hot Copy/SP_Dev-7.vmod /Users/mabrown/Library/Application Support/VASSAL/tiles/59b8b9b728ff7098874f885331cd3b030663badc 256 256
2024-07-17 12:12:50,126 [30318-main] INFO  VASSAL.tools.image.tilecache.ZipFileImageTiler - Starting
2024-07-17 12:12:50,198 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiling images/CVS05 Kamikawa Maru.jpg, heap size is 150
2024-07-17 12:12:50,308 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiled images/CVS05 Kamikawa Maru.jpg, heap size is 27
2024-07-17 12:12:50,308 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiling images/CVS06-Kunikawa-Maru.jpg, heap size is 27
2024-07-17 12:12:50,320 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiled images/CVS06-Kunikawa-Maru.jpg, heap size is 27
2024-07-17 12:12:50,320 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiling images/CVS08 Kiyokawa Maru.jpg, heap size is 27
2024-07-17 12:12:50,331 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiled images/CVS08 Kiyokawa Maru.jpg, heap size is 27
2024-07-17 12:12:50,331 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiling images/CVS09 Sanyo Maru.jpg, heap size is 27
2024-07-17 12:12:50,339 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiled images/CVS09 Sanyo Maru.jpg, heap size is 27
2024-07-17 12:12:50,339 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiling images/CVS10 Sanuki Maru.jpg, heap size is 27
2024-07-17 12:12:50,354 [30318-main] INFO  VASSAL.tools.image.tilecache.FileArchiveImageTiler - Tiled images/CVS10 Sanuki Maru.jpg, heap size is 27
2024-07-17 12:12:50,355 [30318-main] INFO  VASSAL.tools.image.tilecache.ZipFileImageTiler - Exiting
2024-07-17 12:12:50,703 [30303-SwingWorker-pool-1-thread-1] INFO  VASSAL.launch.AbstractLaunchAction - Loading module SWWAS - South Pacific 2022
2024-07-17 12:12:50,708 [30303-SwingWorker-pool-1-thread-1] INFO  VASSAL.tools.io.ProcessLauncher - launching /Users/mabrown/Desktop/VASSAL.app/Contents/MacOS/jre/bin/java -Xms2048M -Xmx2048M -Duser.home=/Users/mabrown -Duser.dir=/Users/mabrown/Desktop/VASSAL.app -cp Contents/Resources/Java/Vengine.jar -Xdock:name=SWWAS - South Pacific 2022 -Xdock:icon=/Users/mabrown/Desktop/VASSAL.app/Contents/Resources/VASSAL.icns VASSAL.launch.Player --load -- /Volumes/Matt BU/GWAS:SWWAS/__DEV SP DEV/SP-DEV <-- Hot Copy/SP_Dev-7.vmod
2024-07-17 12:12:51,461 [30329-main] INFO  VASSAL.launch.StartUp - Starting
2024-07-17 12:12:51,472 [30329-main] INFO  VASSAL.launch.StartUp - OS Mac OS X 14.4.1 x86_64
2024-07-17 12:12:51,472 [30329-main] INFO  VASSAL.launch.StartUp - Java version 21.0.2
2024-07-17 12:12:51,472 [30329-main] INFO  VASSAL.launch.StartUp - Java home /Users/mabrown/Desktop/VASSAL.app/Contents/MacOS/jre
2024-07-17 12:12:51,472 [30329-main] INFO  VASSAL.launch.StartUp - VASSAL version 3.7.9
2024-07-17 12:12:51,472 [30329-main] INFO  VASSAL.launch.Launcher - Player
2024-07-17 12:12:52,524 [30303-ProcessLauncher-2] WARN  VASSAL.tools.logging.LoggedOutputStream - 2024-07-17 12:12:52.524 java[30329:2898893] *** WARNING: References to Carbon menus are disallowed with AppKit menu system on macOS 14 and newer. Use instances of NSMenu and NSMenuItem directly instead. See https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14#Menus
2024-07-17 12:12:55,909 [30329-AWT-EventQueue-0] INFO  VASSAL.build.GameModule - SWWAS - South Pacific 2022 version 1.4
2024-07-17 12:13:20,145 [30329-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa3210 - {aa3210.substring(localAA*2,localAA*2+2).trim()} Source: {aa3210.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. See the errorlog for more details. 
Expression Audit:
   Source type=Piece Trait
   Source name=Piece: 
   Source description=Trait: Text Label - AA Factor aa3210 - {aa3210.substring(localAA*2,localAA*2+2).trim()}
   Source field=Label text
   Source Expression={aa3210.substring(localAA*2,localAA*2+2).trim()}
    localAA=0
    aa3210=
   Error=e: inline evaluation of: ``_xyzzy=_plugh("");'' : Method Invocation aa3210.substring
2024-07-17 12:13:20,193 [30329-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa53210 - {aa53210.substring(localAA*2,localAA*2+2).trim()} Source: {aa53210.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. See the errorlog for more details. 
Expression Audit:
   Source type=Piece Trait
   Source name=Piece: 
   Source description=Trait: Text Label - AA Factor aa53210 - {aa53210.substring(localAA*2,localAA*2+2).trim()}
   Source field=Label text
   Source Expression={aa53210.substring(localAA*2,localAA*2+2).trim()}
    localAA=0
    aa53210=
   Error=e: inline evaluation of: ``_xyzzy=_plugh("");'' : Method Invocation aa53210.substring
2024-07-17 12:13:20,213 [30329-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa6420 - {aa6420.substring(localAA*2,localAA*2+2).trim()} Source: {aa6420.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. See the errorlog for more details. 
Expression Audit:
   Source type=Piece Trait
   Source name=Piece: 
   Source description=Trait: Text Label - AA Factor aa6420 - {aa6420.substring(localAA*2,localAA*2+2).trim()}
   Source field=Label text
   Source Expression={aa6420.substring(localAA*2,localAA*2+2).trim()}
    localAA=0
    aa6420=
   Error=e: inline evaluation of: ``_xyzzy=_plugh("");'' : Method Invocation aa6420.substring
2024-07-17 12:13:20,217 [30329-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - Flight Deck Damage - {flightDeckDamage.substring(localFlightDeck*2,localFlightDeck*2+2).trim()} Source: {flightDeckDamage.substring(localFlightDeck*2,localFlightDeck*2+2).trim()} Error: Expression evaluation error. See the errorlog for more details. 
Expression Audit:
   Source type=Piece Trait
   Source name=Piece: 
   Source description=Trait: Text Label - Flight Deck Damage - {flightDeckDamage.substring(localFlightDeck*2,localFlightDeck*2+2).trim()}
   Source field=Label text
   Source Expression={flightDeckDamage.substring(localFlightDeck*2,localFlightDeck*2+2).trim()}
    localFlightDeck=0
    flightDeckDamage=
   Error=e: inline evaluation of: ``_xyzzy=_plugh("");'' : Method Invocation flightDeckDamage.substring
2024-07-17 12:13:20,239 [30329-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa420 - {aa420.substring(localAA*2,localAA*2+2).trim()} Source: {aa420.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. See the errorlog for more details. 
Expression Audit:
   Source type=Piece Trait
   Source name=Piece: 
   Source description=Trait: Text Label - AA Factor aa420 - {aa420.substring(localAA*2,localAA*2+2).trim()}
   Source field=Label text
   Source Expression={aa420.substring(localAA*2,localAA*2+2).trim()}
    localAA=0
    aa420=
   Error=e: inline evaluation of: ``_xyzzy=_plugh("");'' : Method Invocation aa420.substring
2024-07-17 12:13:20,261 [30329-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa20 - {aa20.substring(localAA*2,localAA*2+2).trim()} Source: {aa20.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. See the errorlog for more details. 
Expression Audit:
   Source type=Piece Trait
   Source name=Piece: 
   Source description=Trait: Text Label - AA Factor aa20 - {aa20.substring(localAA*2,localAA*2+2).trim()}
   Source field=Label text
   Source Expression={aa20.substring(localAA*2,localAA*2+2).trim()}
    localAA=0
    aa20=
   Error=e: inline evaluation of: ``_xyzzy=_plugh("");'' : Method Invocation aa20.substring
2024-07-17 12:13:20,283 [30329-AWT-EventQueue-0] WARN  VASSAL.tools.ErrorDialog - Piece:  Trait: Text Label - AA Factor aa10 - {aa10.substring(localAA*2,localAA*2+2).trim()} Source: {aa10.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. See the errorlog for more details. 
Expression Audit:
   Source type=Piece Trait
   Source name=Piece: 
   Source description=Trait: Text Label - AA Factor aa10 - {aa10.substring(localAA*2,localAA*2+2).trim()}
   Source field=Label text
   Source Expression={aa10.substring(localAA*2,localAA*2+2).trim()}
    localAA=0
    aa10=
   Error=e: inline evaluation of: ``_xyzzy=_plugh("");'' : Method Invocation aa10.substring
2024-07-17 12:13:22,476 [30303-ProcessLauncher-2] WARN  VASSAL.tools.logging.LoggedOutputStream - 2024-07-17 12:13:22.476 java[30329:2898893] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.

This is it I think

@Brent_Easton

Again this value works and it starts at “1” and when I decrement it it gets “0” (both strings) that I expect. I do not know why it errors and then works all the same but it does.

My goal is to eliminate the error in the log visible to the players at this time because I believe they are working…

Here are some more screen shots. I see that the marker aa10 is the last one in the error log so here is where it comes from:

My base definition of Blocks.Ship

Here is the aa10 marker

Here is calling it in a text area in a ship class prototype which references the Blocks.Ship through a couple other prototypes

In case that log truncates here are two screenshots of the audit log

Sorry for the many messages, My bad.

Here is Yamato at full AA

With 1 AA hit

With 2 AA hits

With 3 AA hits

With 4 AA hits

As you can see the AA (the yellow number in the red circle at the bottom right of the counter) IS working as expected, it degrades from 5 → 3 → 2 → 1 → 0, but the error in the log persists.

  • Bad Data in Module: Piece: Trait: Text Label - AA Factor aa53210 - {aa53210.substring(localAA*2,localAA*2+2).trim()} Source: {aa53210.substring(localAA*2,localAA*2+2).trim()} Error: Expression evaluation error. See the errorlog for more details.

For completeness here is the Dynamic Property for localAA

The errorlog is showing that when the errors are being generated, the values of the aa arrays are not set. There is also no Piece name specified which is suspicious.

When you say

The error looks like this and is on start of the module, not generated as the game is played.

Is that when you first load the module, before starting a game, or when you first start a game?

I may need to have a look at the module to dig deeper.

First thank you for looking at this.

So no it is not when the module starts, I watched carefully and it occurs when you start the module, start a game, decline a log file, then you open one of the piece palettes for one of the sides, then it gives you the errors.

This is before you click on a piece, just open the palette. For example here, the Japanese pieces palette. That is found under Japanese Private → Japanese Counters or Allied Private → Allied Counters. The errors show when you call one of the palettes and then does it again when you call the next.

You are exactly right. I think this is an undefined variable when called but by the time you want to USE a counter, it is defined and works fine hence it working after the errors…

I am sending you a link to a download if you have the time to procede further.

I put the variables for the AA into the root most prototype for the ships and it is common to both sides.

The one error there though is not for AA but the flight deck damage and that is constructed the same way, but the marker is in the definition for the class.

IJN Yamato ← Counter in the palette
----_Axis.Graveyard
----BB Yamato Class ← Flight Deck defined here (on carrier)
--------Blocks.splashes (Ignore - shell splashes)
--------Blocks.Long
------------Blocks.Constants
------------Blocks.Menus
------------Blocks.Ships ← AA values defined here

(This is reverse order with the counter on top)

I think I need to instantiate the markers when the palette loads or before. Any tip on that?

Thanks, I will have a look.

Pieces in the Palette have certain errors suppressed as they don’t have access to all the properties that exist when on the Map. I may need to tweak this.