New program to help set up VASL scenarios

JohanVrijdaghs

Recruit
Joined
Jan 27, 2018
Messages
18
Reaction score
3
Country
llBelgium
You're going to have to call your neighbour again :)

Tell them to create a file called logging.yaml in the config/ sub-directory that looks like this:
Code:
version: 1

formatters:
    standard:
        format: "%(asctime)s.%(msecs)03d | %(message)s"
        datefmt: "%H:%M:%S"

handlers:
    file:
        class: "logging.FileHandler"
        formatter: "standard"
        filename: "c:/temp/vasl-templates.log"
        mode: "w"

loggers:
    vasl_mod:
        level: "DEBUG"
        handlers: [ "file"]
    vassal_shim:
        level: "DEBUG"
        handlers: [ "file" ]
Change the path to the output log file to something suitable.

Create another file called logback-test.xml in the same directory as vasl-templates.exe (i.e. not the same directory as above) that looks like this:
Code:
<configuration debug="false">

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
    <file>c:/temp/vassal-shim.log</file>
    <append>False</append>
    <encoder>
        <pattern>%d{yyyy-MM-dd HH:mm:ss} | %msg%n</pattern>
    </encoder>
</appender>

<root level="WARN">
    <appender-ref ref="FILE" />
</root>

<logger name="vassal_shim.VassalShim" level="DEBUG" />
<logger name="vassal_shim.LabelArea" level="WARN" />

</configuration>
Change the path to the output log file to something suitable.

Restart the program, try to update a scenario, so that the error happens again. Then post the log files here.
he just changed the chrome edition from a 87 to 88, as also the chromedriver, for the time being: it works 😊😊😊
 

Jazz

Inactive
Joined
Feb 3, 2003
Messages
10,883
Reaction score
1,315
Location
The Empty Quarter
Country
llLithuania
Yeah, unfortunately it's not something I can really do anything about; VASSAL is just extremely slow loading images. The more images there are, the longer it takes.

5 minutes is a bit excessive, though. The images finally show up, though, right? If you get the "broken image" image, that would explain why it's taking so long, because VASSAL has a really long time-out before it gives up on an image and moves on to the next one.
It is a fair number of images...6 or 7 as I recall?

The other confounding issue....I could get the images right in VASL....once. Since then, I have not been able to get the images back. I suspect a lot of the load time is due to trying to load images that for some reason (that I have not been able to figure out) the images are not where the system expects them to be and it just takes that long to decide to throw in the towel and go without?
 

Pacman Ghost

Member
Joined
Feb 25, 2017
Messages
439
Reaction score
240
Location
A maze of twisty little passages, all alike
Country
llAustralia
It is a fair number of images...6 or 7 as I recall?
That's not so many :)
16174

I suspect a lot of the load time is due to trying to load images that for some reason (that I have not been able to figure out) the images are not where the system expects them to be and it just takes that long to decide to throw in the towel and go without?
Yes, that's right. Open the User Settings and make sure that Get images from is set to "the internet". Then go back and update your scenarios.
 

Rocket-Man

Space is only 100Km up
Joined
Dec 6, 2006
Messages
401
Reaction score
4
Location
EST
Country
llUnited States
I can't get the Scenario Search function to work. No matter what I type in the Name box, when I click the search magnifying glass I get the following error as shown in the image below:

Couldn't get the scenario index.
invalid start byte

16320

My settings are shown below. I have verified I have the correct version of the Chrome driver (Chrome version 88.0.4324.104 (Official Build) (64-bit) and ChromeDriver 88.0.4324.96). I am using the java version that is included with VASSAL.

16315

I'm using VASSAL 3.4.13 and VASL 6.6.1. Yes I know these versions are not officially supported, but they should not affect the Scenario Search function.

Operating system is Windows 10 Professional OS Build 18363.1316.
 
Last edited:

Pacman Ghost

Member
Joined
Feb 25, 2017
Messages
439
Reaction score
240
Location
A maze of twisty little passages, all alike
Country
llAustralia
I can't get the Scenario Search function to work. No matter what I type in the Name box, when I click the search magnifying glass I get the following error as shown in the image below:

Couldn't get the scenario index.
invalid start byte
Sorry about this, I just noticed it myself last night. The hosting company moved the website to a new server without notifying me, and has broken everything :oops: I'll post an update here when I get things going again.
 

Rocket-Man

Space is only 100Km up
Joined
Dec 6, 2006
Messages
401
Reaction score
4
Location
EST
Country
llUnited States
Sorry about this, I just noticed it myself last night. The hosting company moved the website to a new server without notifying me, and has broken everything:oops: I'll post an update here when I get things going again.
No worries. I was just scratching my head trying to figure out what I did wrong. Thanks for the quick reply.
 

jomolungma

Member
Joined
Jan 19, 2021
Messages
56
Reaction score
33
Location
Virginia
Country
llUnited States
Is there a setting to modify the background colors of the tables for things like scenario name, SSRs, etc.? If not, is there a way to include that so that it pops up a color wheel that allows you to pick a color by how it looks and then it auto-populates the hash code for that color?
 

jomolungma

Member
Joined
Jan 19, 2021
Messages
56
Reaction score
33
Location
Virginia
Country
llUnited States
If you come up with something cool, maybe send it to me and I'll include it in the release, or otherwise make it available to everyone else. This was always an idea I had in the back of my mind for the program...
Will do. I’ll tool around some with it this week. I had been just manually editing each snippet’s HTML in the VASL label and it was getting a bit tiresome. I didn’t realize I had as much control over the templates from within your program, so now I’ll switch my focus to that and see if I can streamline things.
 

jomolungma

Member
Joined
Jan 19, 2021
Messages
56
Reaction score
33
Location
Virginia
Country
llUnited States
If you come up with something cool, maybe send it to me and I'll include it in the release, or otherwise make it available to everyone else. This was always an idea I had in the back of my mind for the program...
Do you happen to know what version of CSS VASSAL is capable of implementing? I'm trying to use the CSS box-shadow function, but it won't show up in VASL. I've loaded my code in a regular browser and it's fine, so I know the code works, but I just can't get the box-shadow to appear in VASL and I think maybe it's just not capable of implementing that function via a label right now. I like the effect and would like to include it in my custom templates for your program so that it creates some of the snippets in colored tables that are drop-shadowed. Thanks!
 

Pacman Ghost

Member
Joined
Feb 25, 2017
Messages
439
Reaction score
240
Location
A maze of twisty little passages, all alike
Country
llAustralia
Do you happen to know what version of CSS VASSAL is capable of implementing? I'm trying to use the CSS box-shadow function, but it won't show up in VASL
:rotflmao: Sorry mate, the HTML engine in VASSAL is late-90's vintage, so yeah, box-shadow is not going to work. I have indentations in my head from beating it against a wall, trying to write templates that work both in a modern browser and that ancient renderer 😢
 

jomolungma

Member
Joined
Jan 19, 2021
Messages
56
Reaction score
33
Location
Virginia
Country
llUnited States
:rotflmao: Sorry mate, the HTML engine in VASSAL is late-90's vintage, so yeah, box-shadow is not going to work. I have indentations in my head from beating it against a wall, trying to write templates that work both in a modern browser and that ancient renderer 😢
Ah, dang. Well, I can probably recreate the effect, sort of, with offset borders and weird table layouts. I’ll play around with it. Thanks for the info!
 

jomolungma

Member
Joined
Jan 19, 2021
Messages
56
Reaction score
33
Location
Virginia
Country
llUnited States
I'm wondering what scripting language is used in the templates for the if/else statements, etc. Is it Jinja? Something else? I think the app uses Flask, which I think uses Jinja, but I’m not sure. I’m not a programmer by trade or even hobby, but past careers and education took me close enough to programming that I can decipher most code and write some myself occasionally.

Essentially, I'm trying to write a statement inside scenario.j2 that looks in the SCENARIO_LOCATION string for the country (i.e. is 'france' in SCENARIO_LOCATION) and then changes the color mapping of the scenario box to match the colors of the flag of that particular country. In looking at the format of the other script statements in the templates I thought I had the syntax, but VASL-Templates.exe keeps returning an error when I try to capture a snippet. So was just wondering what language syntax I should be using to get the program to execute my code. The error seems to trigger whenever it encounters my {%if ‘france’ in SCENARIO_LOCATION%} statement, so maybe either “in” is not an available call or my syntax around ‘france’ is wrong? I’ve also tried bracketing SCENARIO_LOCATION, to no avail. I haven’t tried {%if ‘france’ in ‘{SCENARIO_LOCATION}’ %}, but I will later this morning. I couldn’t get simply {% if ‘bc’ in ‘abcdef’ %} to work, so I think maybe it’s the “in” call. I dunno. Any help appreciated. Thanks very much!
 
Last edited:

Pacman Ghost

Member
Joined
Feb 25, 2017
Messages
439
Reaction score
240
Location
A maze of twisty little passages, all alike
Country
llAustralia
Is it Jinja? Something else? I think the app uses Flask, which I think uses Jinja, but I’m not sure.
Yes, the application is written using Flask, and yes, the templates are Jinja, but there's one important thing missing. Due to browser security restrictions, the templates have to be processed in the front-end, which means that 'm using a Javascript library to do that, which only implements a subset of what Jinja normally has, and in particular, it doesn't have some Python language features such as "in".

Unfortunately, I can't think of a way to do what you want, but if you want, it might be possible to make a change to the code to add this functionality. I vaguely remember hitting the same problem myself, so it looks like it would be useful...
 

jomolungma

Member
Joined
Jan 19, 2021
Messages
56
Reaction score
33
Location
Virginia
Country
llUnited States
Yes, the application is written using Flask, and yes, the templates are Jinja, but there's one important thing missing. Due to browser security restrictions, the templates have to be processed in the front-end, which means that 'm using a Javascript library to do that, which only implements a subset of what Jinja normally has, and in particular, it doesn't have some Python language features such as "in".

Unfortunately, I can't think of a way to do what you want, but if you want, it might be possible to make a change to the code to add this functionality. I vaguely remember hitting the same problem myself, so it looks like it would be useful...
Well, I'm not a good enough programmer - not actually a programmer at all really - to assist in that process, but it sounds like a lot of work. I wouldn't go through the trouble unless you found a need greater than just my silly formatting issue. I can always change the color codes from within the resulting HTML to match the country, it doesn't have to be scripted. If, however, you were to figure out a way to more fully open up access to the Jinja code, I would probably take advantage of it in a number of other ways. Thanks for getting back!
 

Pacman Ghost

Member
Joined
Feb 25, 2017
Messages
439
Reaction score
240
Location
A maze of twisty little passages, all alike
Country
llAustralia
it sounds like a lot of work.
Challenge accepted! I'll get something to you later today. I've been beating my head against a wall, dealing with the hosting company, trying to get my websites fixed, so beating my head against a wall trying to get some Javascript to work will be an improvement. Yes, it's that bad :mad:
 
Top