Page 1 of 1

Help with oblique grid numbering, please

PostPosted: September 11th, 2020, 5:45 am
by grouchysmurf
Cheers.

In Tonkin by Kim Kanger, published by Legion Wargames, hex numbering is oblique and it uses letters.

I like this game a lot and invested many hours into enhancing its VASSAL module. It's not perfect and I am still improving on it but what buggers me most is that there is no way I could possibly add appropriate hex numbering within VASSAL current scope.

I know of at least one module that has oblique letter based number (A3R) but I can't on Earth figure out how to transfer its java code to my module.

I've been wondering if anybody could help me (as in: write the code and tutor me with regard incorporating it into my module) with it. I would be most grateful.

Re: Help with oblique grid numbering, please

PostPosted: September 13th, 2020, 1:36 am
by m3tan
I'm confused as to what exactly isn't supported by the existing Hex Grid feature in the Module Editor. It allows for vertical and horizontal (oblique) hex rows. It also allows for either numerical and alphabetic numbering of each row. Maybe I don't understand what you mean by oblique...

Re: Help with oblique grid numbering, please

PostPosted: September 13th, 2020, 8:42 am
by grouchysmurf
I'm confused as to what exactly isn't supported by the existing Hex Grid feature in the Module Editor. It allows for vertical and horizontal (oblique) hex rows. It also allows for either numerical and alphabetic numbering of each row. Maybe I don't understand what you mean by oblique...


Oblique as in... oblique :-)

Take a look:

Image

Green arrow marks hexes labelled after "R", red one -- after "S". Sideways numbering is "normal" i.e. each row has its distinct number.

Re: Help with oblique grid numbering, please

PostPosted: September 13th, 2020, 11:12 am
by Brent Easton
In the A3R module, you will find a folder called ThirdReich that contains a number of files including one called HexGridNumbering.class. Copy this folder into your module using 7-zip or similar. Open your module using the Vassal Editor and open the Hex Grid component you have created. Delete any existing Grid Numbering and use the option 'Import class' and import a class named ThirdReich.ObliqueHexGridNumbering

That should add a component that you can configure to create the oblique grid.

Regards.

Re: Help with oblique grid numbering, please

PostPosted: September 13th, 2020, 6:33 pm
by grouchysmurf
Cheers, Brent. Yes, I tried that before. Sorry to report that it ends with an error:

https://pastebin.com/raw/eAnSwbMP

Re: Help with oblique grid numbering, please

PostPosted: September 13th, 2020, 9:58 pm
by Brent Easton
I will poke around, I should still have the source for it somewhere. I'll see if I can get it going for you.

Re: Help with oblique grid numbering, please

PostPosted: September 14th, 2020, 5:07 am
by grouchysmurf
Brent Easton wrote:I will poke around, I should still have the source for it somewhere. I'll see if I can get it going for you.


Oh, that would be absolutely and very much extra-appreciated.

Re: Help with oblique grid numbering, please

PostPosted: September 14th, 2020, 10:31 am
by Brent Easton
It's looking like it is actually a Vassal bug preventing custom classes from being imported from the Editor.

You can get around it like this:

1. Start with a fresh copy of the module.
2. Copy the ThirdReich folder into the module.
3. Edit the buildfile, find the text 'VASSAL.build.module.map.boardPicker.board.mapgrid.HexGridNumbering' and replace it with 'ThirdReich.ObliqueHexGridNumbering'.

You should be able to edit the module and adjust the numbering.

Regards,
Brent.

Re: Help with oblique grid numbering, please

PostPosted: September 14th, 2020, 12:49 pm
by grouchysmurf
Yikes! It worked. Thanks so much.

Re: Help with oblique grid numbering, please

PostPosted: September 17th, 2020, 2:47 am
by Cattlesquat
grouchysmurf wrote:Yikes! It worked. Thanks so much.


That is more or less the standard reaction with one's first successful custom class import :)