New program to help set up VASL scenarios

punchdrunk

Recruit
Joined
Jul 30, 2022
Messages
9
Reaction score
4
Country
llCanada
I'm guessing you're running from source. Python often has problems with SSL certificates, so try some of the things suggested on this page. If you're using an old version of Python, that might be causing it as well (since it may not have the latest certs).
I am using a fresh Python 3.10 install. I had to go into the Applications folder and there's an 'Install Certificates.command". Ran that (which is just a pip install command) and all good now.

I am running from source. I thought running from source was the only option on Mac right now. Is there another way?
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
I am running from source. I thought running from source was the only option on Mac right now. Is there another way?
You can run it using Docker, like Graystonw is :)

You can also run a pre-compiled binary, but since I don't have a Mac, I can't produce these. However..., since you've got it running from source, if you make one of these (one command, see the bottom of the For developers page) and send it to me, I'll make it available on the Github release page (make sure you build from the v1.9 tag).

It'll be a ZIP or TAR, but it looks like it's not too hard to convert that into a DMG. I'm sure Graystonw would be good for a slab of beer for such a thing. Granted, it'll be American beer, but it's still (maybe) better than nothing... 💡
 

punchdrunk

Recruit
Joined
Jul 30, 2022
Messages
9
Reaction score
4
Country
llCanada
You can run it using Docker, like Graystonw is :)

You can also run a pre-compiled binary, but since I don't have a Mac, I can't produce these. However..., since you've got it running from source, if you make one of these (one command, see the bottom of the For developers page) and send it to me, I'll make it available on the Github release page (make sure you build from the v1.9 tag).

It'll be a ZIP or TAR, but it looks like it's not too hard to convert that into a DMG. I'm sure Graystonw would be good for a slab of beer for such a thing. Granted, it'll be American beer, but it's still (maybe) better than nothing... 💡
That’s my hope, but there’s still some weirdness I need to figure out with the shim. My install was not working until I rebuilt, and then it began working. Now I just started with a “fresh” directory install and I am getting errors that it can’t find the shim even after rebuilding it. Plus my original working one can’t find the shim anymore and I didn’t touch it!

I noticed though that all the app directory settings (Vassal, vasl, extensions, boards) were set already in the new one as well, so some things are being cached outside the vasl-templates directory. I wonder if something is being shared or cached by Python and/or Java related to the shim. I’ll try again from a fresh reboot just in case some weird memory caching stuff is going on.

Also I am not a Mac expert. I use them now but none of my dev experience is in a Mac environment. I’ve got some actual work to do right now but will try and dig into this some more later tonight.
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
My install was not working until I rebuilt, and then it began working.
My first guess would be that the JAR that's in source control is not compatible with the version of Java you're using. Java compatibility goes back a few versions, but not indefinitely. The one in the repo was built using Java 14, against VASSAL 3.4.2. By rebuilding it, the resulting JAR artifact will, of course, be compatible with your version of Java.

The JAR can be found in the repo at $/vassal-shim/release/, and is located using relative paths (in vassal.py). So, if it's not a Java version problem, what is the exact error message you're getting?

so some things are being cached outside the vasl-templates directory.
If you use the desktop app, settings are stored in ~/.vasl-templates.conf. If you're running the webapp from source, they're in $/vasl_templates/webapp/config/*.cfg.
 

punchdrunk

Recruit
Joined
Jul 30, 2022
Messages
9
Reaction score
4
Country
llCanada
And I'm an anything-but-beer guy. I'll settle for some cider or a Churchill-style martini aka a glass of gin with some olives in it.

The error I'm getting is that it can't find the vassal-shim. There's also some weirdness on startup about a few things, but that was there even when the vassal-shim was found. . Everything except the last ERROR comes up immediately at startup. The ERROR is thrown once the window loads and tries to connect. I get the red error overlay message in the main app saying the same thing. The app still works for everything else (no crashing or anything.)
Here's the output from my terminal:
Code:
Unused VASL overrides: adf:1824, adf:1822, adf:1823, 08d:75
Expected multiple images but didn't find them: adf:1828, adf:1829, adf:1830
WARNING:vasl_mod:Unused VASL overrides: adf:1824, adf:1822, adf:1823, 08d:75
WARNING:vasl_mod:Expected multiple images but didn't find them: adf:1828, adf:1829, adf:1830
ERROR:root:Can't check the VASSAL version: Can't find the VASSAL shim JAR.
Using Python 3.10, Java 18.0.2 so should be ok there. The OS on this machine is still Catalina though (10.15.7). But I had it working yesterday!
 

punchdrunk

Recruit
Joined
Jul 30, 2022
Messages
9
Reaction score
4
Country
llCanada
Okaaaaay. So I just re-ran the dev setup from vasl-templates-1.9. pip install --editable .[dev]
Once that was done everything is fine again (aside from the warnings). But not just in that one directory. Now my several different installs all work and before that none of them did. So something is getting setup in the overall environment from running the dev install that is allowing vassal-shim to be found.

It is also then quite likely that what made it work for me yesterday was not re-building the shim but rather that I did the dev setup as step 1 of rebuilding, and didn't try the app again until I'd rebuilt. So, progress!
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
But not just in that one directory. Now my several different installs all work and before that none of them did. So something is getting setup in the overall environment from running the dev install that is allowing vassal-shim to be found.
I can't explain how this could be happening. vassal.py locates the JAR relative to itself, so there's no way it's going to find the JAR in another repo. Doing an editable install means that the code is run directly from where it is (instead of being copied over to site-packages/ and run there), so by definition, it's a local, non-global installation.

Have you set up separate virtualenv's for each repo? One thing I can think of is that you're running the program using the vasl-templates command, which is set up during the pip install, and is installed into the current virtualenv. So, if you activate the virtualenv for installation A, cd to installation B, then run the vasl-templates command, you will actually be running the code from installation A.

If you haven't created virtualenv's, each installation will be using the same site-packages/ (whether it be system or user), then that could maybe explain how fixing one installation magically causes the others to start working. But I don't think so, since the JAR doesn't get installed when you do a non-editable install, so it's never going to work anyway.

But all this is moot, since the code should've picked up the JAR that's in source control. And even if you've rebuilt it, it should've overwritten the old one i.e. it will still live at the same file path.

The only way I can think of to get the outcome you've reported is that you done a non-editable install (so the code has gone into site-packages/), the code complained about not finding the JAR (because it doesn't get installed into site-packages/), so you've cd'ed into site-packages/vasl-templates/vassal-shim/ and built the vassal-shim JAR from there (not $/vassal-shim/ in your local repo), thus creating a new JAR at a location where the code in site-packages/ can find it, and ta-da: things work. No. this doesn't make sense either, because the vassal-shim/ directory doesn't get installed into site-packages/. I'm stumped :(

I would:
  • delete all your installations
  • make sure all your site-packages/ are clean i.e. there is no vasl-templates package, nor a possible spurious releases/ directory that may have inadvertently been created (if my hypothesis above is correct)
  • clone the repo again, create a virtualenv, do an editable pip install
I just tried this on a clean installation of Fedora 36, and it works.
 
Last edited:

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
The second beta in the v1.10 release cycle is available here. If you are running from source or using Docker, there is a new branch up on Github.

The headline feature in this release is something that many of y'all will appreciate: a WYSIWYG editor for the HTML content. You get all the standard editing features, as well as some ASL-specific things like commonly-used special characters and player flags.
22553

You can create some fairly complex content, but keep in mind that everything will eventually end up in VASSAL, which has a very old HTML rendering engine, so it'd be better to keep things simple, otherwise you might end up having to edit a lot of the generated HTML manually, anyway.

HTML is also now sanitized. There aren't many attack vectors (e.g. someone sends you a vasl-templates save file, or you download one from the ASL Scenario Archive), and even if some malicious HTML got into VASSAL, it's unlikely anything would happen :rolleyes:. However, it could still mess up vasl-templates, so it's prudent to clean things up before using them.

The UI has also been tightened up and improved in many places. They say everyone has at least one super-power that's completely useless, and mine is an ability to see when things are mis-aligned. It's been quietly driving me nuts for a very long time to see things not quite lined up properly in the UI, and so a lot of this release is addressing my OCD and fixing these :(

If you installed the previous beta (v1.10.beta1), and you like to be tidy, you can delete the compass Extras label ($/data/default-template-pack/extras/compass.j2) added in that release, since this is now part of the main template pack.

Other changes

  • Made the new compass label part of the main template pack (instead of an Extras).
  • Snippets can now be generated from the dialog used to add/edit them (scenario and player-specific notes).
  • Made some UI elements resizable.
  • Improved the initial positioning and sizing of dialogs, and got them to remember any changes made.
  • Tightened up the player flags, and how they are resized.
  • Tightened up how theaters at the ASL Scenario Archive are mapped to ours.
  • Tidied up text coming from the ASL Scenario Archive and ROAR.
  • Changed how Java is detected (and reported) from the PATH.
  • Got 1/2" counters showing at the smaller size again.
  • SSR snippets can now be auto-generated.
  • Fixed a problem auto-generating a snippet for a simple note that has no content.
  • Fixed a timing error during startup that could stop vehicle/ordnance multi-applicable notes from being available.
  • Removed code supporting Internet Explorer.
  • If changes have been made when adding /editing scenario and player-specific notes, the dialog confirms before closing.
  • Updated some parts of the UI that were being missed after importing a scenario from the ASL Scenario Archive.
  • Included the ASL Scenario Archive and ROAR ID's, and git branch commit ID, in updated .vsav files.
 
Joined
Jul 20, 2021
Messages
9
Reaction score
0
Country
llUnited States
Any guesses as to why the Snippet button isn't creating any HTML? Everything is correctly loaded and was working perfectly. I think the only computer change I did was sync stuff to OneDrive, but all the folders are correct. No error messages. Also sometimes the HTML Snippet button will work for a couple of times when I first load it, and then stop after a couple of Snippets generated.
- Cheers
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
Also sometimes the HTML Snippet button will work for a couple of times when I first load it, and then stop after a couple of Snippets generated.
I haven't ever seen this, or heard about someone having this problem. Open in a browser, open the console tab in Developer Tools, and see if the problem happens there, and if anything gets logged.
 
Joined
Jul 20, 2021
Messages
9
Reaction score
0
Country
llUnited States
Attached is the error messages that come up in the Developer Tools (same problem - clicking the "create snippet" button doesn't do anything.
22624
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
You've set up some of the Chapter H multi-applicable notes?

Send me a ZIP of your directory and the vasl-templates save file (.JSON extension) you're working on.

And what version of vasl-templates are you running (check the About box)?
 
Joined
Jul 20, 2021
Messages
9
Reaction score
0
Country
llUnited States
Yes to Chapter H. This was version 1.9, but it was happening with 1.8, so I tried 1.9 and have the same problem. Sending the files as PM. Thanks.
- Chris
 
Joined
Jul 20, 2021
Messages
9
Reaction score
0
Country
llUnited States
Directory is which files exactly? Tried zipping the vasl-templates folders, but "to big to attach". Attaching the zipped JSON file of the saved file.
Thanks. Sorry to trouble you! I was hoping it was going to be an obvious "oh you just need to ____ ".
Oh, also I tried loading one of the examples and everything seemed to be working normally.
- Chris
 

Attachments

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
Directory is which files exactly? ... Attaching the zipped JSON file of the saved file.
I meant the Chapter H data files you set up. It doesn't matter for the moment - right now, I'm thinking something's changed in the data/ sub-directory (in the installation directory). Send me a ZIP of that.

But I need the vasl-templates save file (with a .json extension), not the VASSAL .vsav one.

Sorry to trouble you! I was hoping it was going to be an obvious "oh you just need to ____ ".
No worries. I think this might be a bug, so it's good you've reported it.
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
Thanks for send the files through.

This looks like a bug - I think it's happening because you have set up your Chapter H notes, but haven't done the multi-applicable notes for the Landing Craft, and the scenario has a Landing Craft.

I've sent you my Landing Craft Chapter H notes, so save those on top of your (empty) files, restart the program, and see if that helps...
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
590
Reaction score
298
Location
A maze of twisty little passages, all alike
Country
llAustralia
The third beta in the v1.10 release cycle is now available here. If you are running from source, or in Docker, there is a new branch on Github.

IMPORTANT: If you are running the desktop app, the settings file is now stored in different location. While the program will automatically move your current file, it would be prudent to take a backup of it first:
  • Windows: C:\Users\YOUR-NAME\vasl-templates.ini
  • Linux/Mac: ~/.vasl-templates.conf
If you are installing on top of an existing installation, you should delete the directory $/data/default-template-pack/extras/kgs/.

The main new features for this release:
  • Single line textbox's (e.g. the scenario name, player descriptions) can now be edited WYSIWYG. They respond to simple formatting commands such as Ctrl-B or Ctrl-I (for bold and italic), or click the icon in the top-right corner to open a full editor.

  • The presentation of information in the National Capabilities labels has been improved.

  • Optimizations were made to scenario search, so it should be less sluggish (it can still be a bit laggy, but this seems to be a Chromium thing - it flies in Firefox).
Other minor changes and bug fixes:
  • Config and data files are now stored in the standard locations.
  • Improved the keyboard interface in the TURN TRACK dialog.
  • The "edit vehicle/ordnance" dialog now asks you to confirm closing it, if changes have been made.
  • Custom list bullets are only shown in the UI if they have been enabled.
  • The current directory for saving/loading files is not reset after choosing "New scenario."
  • Updated the National Capabilities label for the Free French.
  • Added an Extras template for Booby Traps.
  • Merged the Extras templates for Kampfgruppe Scherer.
  • Extras templates can now specify the width of their dropdown lists.
  • Moved the "edit template" buttons to a dropdown menu.
  • Tightened up how the program detects if HTML content has been changed.
  • Fixed a problem that was causing some vehicle comments to be incorrectly treated as having changed.
  • Focus is now set to the correct default button if there are nested dialogs.
  • Fixed a problem generating snippets if the Chapter H landing craft notes are missing.
  • Cached Chapter H images for extensions are now saved in their own sub-directory (this also fixes a problem on Windows where they weren't being cached properly).
  • Minor UI tweaks.
 
Top