Silent Victory - error with a Global Property when moving a Counter to a different Map

Hi folks,
there is an issue within the Silent Victory module:

when I draw a ship (say a Small Freighter) to the main map, then open the Patrol Log and drag the ship there, the Patrol Log should add the “tonnage” value from the ship to its Total Tonnage label, i.e increment that counter by the tonnage of the ship placed on the Patrol Log.

However the way it currently works is that even though the trigger seems to work (i.e. placing a ship on the Patrol Log), the Total Tonnage counter updates and shows the total tonnage of ships on the Main map, instead of those on the Patrol Log.

Additionally I see this error, when the first such instance occurs:

  • Bad Data in Module: Source: Property Expression=[{$DeckName$}], Property Name=]. Error: Small Freighter 81c (Unkai Maru #5) (2800)(?) [Set Global Property] . Unable to locate Global Property in Current Zone/Current Map/Module… See the errorlog for more details.

I suspect there is something afoul with the Global Poperty definitions between the Main map and the Patrol Log, but am unable to determine what… can anyone help here, or point me to something out of experience?

Have you tried contacting the module developer via the module page ?
(login required).

Given that it is Joel Toppen, who must have a myriad things up his sleeve, I do not see this as a very viable option :slight_smile: I can ping him for instance on BGG, but would love to hear from someone who stumbled upon such an error in the past.

Based on that error message, it looks like this might be another case of unnecessary $-signs within Beanshell (curly braces). If you can find where that {$DeckName$} expression is, and just remove the $-signs so it’s just {DeckName}, that might fix it. (Back before VASSAL 3.3, this was a syntax error that accidentally worked anyway. Since then, it causes an error.)

1 Like

I looked at the module for you (briefly). There are a number of things in it that don’t make sense to me (“why are you doing this or that?”). It is not obvious to me what is wrong, but yes, it does mix classic and bean shell syntax, which was more normal back in 2016 when it was made, and the $ use is probably the root of the problem. If Joel doesn’t address it himself, I’ll probably mess with it myself in a few days. Besides your problem, there are a couple other things that annoy me like fonts that are way, way too small. Write to me personally next week if you like (unless Joel takes this up). You can be my tester since I don’t know the game.

1 Like

Thank you guys!
jrwatts hit the nail first - when I removed the $-signs in the 2 below expressions, the Patrol Log window now counts the ships properly :slight_smile: Edited it as XML to find/replace all of them.

{$DeckName$}
{DeckName==$CurrentZone$}

Re: shilinski - which things irk you? I can have a look as I want to add some updated counters anyway…

I came to the same conclusion on the {$DeckName$} expression but I must have missed some occurrences of it. I changed the one in the ship prototypes but it didn’t seem to fix the issue. So, I concluded it was easier to replace it entirely with Calculated Properties for the Sunk and Tonnage totals, using functions that weren’t available back in 2016. This seems to work and is a lot more straightforward.

I can see things moved on whilst I was looking at the problem, but if you or anyone else might want to look at this alternative method, download my update now from Dropbox here.

1 Like

Good, then I’ll stay out of it as you seem to have it in hand. What irks me?

  1. In the Patrol window, why is each space a zone and a deck? And why test if deck==zone since they can never be different? I may be missing something, but this doesn’t make sense to me. I’d probably dump the decks so that I could see all sunk ships with a mouseover. I probably would use regions with snap-to enabled so that any ship that goes to that window must go to a space and not to the margins.

  2. The text under each patrol window space, which shows ships sunk and tonnage, is way too small as to be unreadable on my monitor. I’d either increase the size, or I’d enable mouseover so it would be readable.

  3. Property names have embedded spaces. I hate that, and in my opinion just asks for trouble.

  4. He left in stuff in commands that should have been removed. For example, every trigger retains the default menu command “trigger” and ^T. Leaving that crap in and having a user hit ^T will blow up the module.

3 Likes

I missed that one; there is presumably a zone-level tonnage tracker that is updated too and I broke that in my update. Monthly ship counts still works though, probably displaying <deckname>_numPieces.

1 Like

I believe the tonnage trackers are module-level and not zone-level. I still wonder why there are zones AND decks. If a ship is in a zone, then it’s in the same-named deck and vice versa. What’s the point? The only thing I can think of is he started with zones and then later added decks, but then why test everywhere for zone==deck? Even if a ship is in the margin, then zone==deck==null.

One other thing I think would be nice is if one could set the current date. Then a player could right click a ship and send it to the proper spot in the patrol window, so drag and drop would be unnecessary.

1 Like

Just returned to this (finally had all the updated images done) and did the proper “$” removal mentioned above. Is there a way to display each Patrol Log zone’s number of ships/tonnage without the Deck on top of it doing this? I mean a permanent state display (as it is currently done with the Decks), not a mouse-over display. I am not that versed in Vassal, so do not know all the ins and outs of how stuff can be achieved.

BTW, I increased the font size for the small text in there, still considering changing the color, as black on blue is not the best in terms of readability for those.

I could change the Property names to remove spaces, a simple edit in Notepad++ could achieve that.

I can also check that trigger thingie, if I am able to remedy that.

I don’t know the complexity of this module to guess how much this might impact performance, but you can use techniques in the Expressions reference page to do counts or sums of things.

Note especially the Sum(prop, expr, map) and Count(expr, map) examples, which you can use in a Text Label trait to sum/count things, specifying a given zone as part of the expression.

1 Like

thx, will check them out!