Create account / Log in

Control-click function (flair) in VASL

Topics related to Vassal game modules.

Moderators: uckelman, Tim M

Control-click function (flair) in VASL

Postby msoong » April 7th, 2020, 7:41 pm

I use VASL (the ASL module) extensively, and one of my fav feature is I can control click on any point on the board and it generate a "flair" that opponent can see.
I notice that is seldom used in other VASSAL modules. How easy is it to port that? (would like to add that to a module I am working on)...
msoong
 
Posts: 52
Joined: November 18th, 2015, 12:26 am

Re: Control-click function (flair) in VASL

Postby Cattlesquat » April 9th, 2020, 2:54 am

It's not *super* hard to port once you have a copy of the custom class. I'm going to have you pull down the Paths of Glory module (which also has it) because I'm familiar with the layout of that one.
(1) Pull down Paths of Glory vmod (either 9.4 or 9.5). If you need to rename it from .vmod to .zip to get at its contents, go ahead and do that.
(2) Inside the zip/vmod you will find a directory "PBU". You need to copy that directory AND its contents (two .class files), to an IDENTICAL directory situation in your own module (so now inside your module the top level directory will include a PBU directory which then has the class file).
(3) Now open the editor on your module (first renaming it from zip to vmod if you need to do that). Go to the entry for your main map and select it. Right click and pick "Add Imported Class" (the very bottom option). In the dialog which comes up, put in "PBU.LookAt" and hit okay.
(4) Now save your module.
(5) Exit out of the editor, and then relaunch and open your module (or edit it again).
(6) Once you have a game going, try a Ctrl+RightClick on the map -- this should produce the "flare".
(7) As the very last entry under your Map you will now find a "LookAt" entry which gives you a limited ability to reconfigure the color and I think size of the flare.

And that should be it! Obviously if you want to make the custom class do something "even more customized" then you'd have to get a java environment up and running to compile things with, etc, which is... a substantial step up in difficulty/hassle (but if you're an engineer already then, well, it's just like another day at the office...)

Brian
User avatar
Cattlesquat
 
Posts: 941
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Control-click function (flair) in VASL

Postby Cattlesquat » April 9th, 2020, 2:57 am

Oh and I just realized it lets you Ctrl+Leftclick OR Ctrl+Rightclick to produce the same effect, never noticed that before. So anyway if that was throwing you, now you know.
User avatar
Cattlesquat
 
Posts: 941
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Control-click function (flair) in VASL

Postby ChuckS » May 13th, 2020, 9:43 pm

I see references in the code to red and blue colors, how do you change from green? Also can I use this code? Thx
ChuckS
 
Posts: 118
Joined: August 16th, 2016, 4:37 pm

Re: Control-click function (flair) in VASL

Postby Cattlesquat » May 14th, 2020, 6:51 pm

I think you can change the colors in the [LookAt] entry that ends up getting created at the bottom of the hierarchy for your Main Map (you can find it as the VERY bottom item under Paths of Glory map, for instance).

I didn't write it, Bill Thomson passed it along to me, but I think everything Vassal is open-source-land, so go for it.

Brian
User avatar
Cattlesquat
 
Posts: 941
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA


Return to Module General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests