PDA

View Full Version : Pointer Templates for HEX Maps...



Blackfoot
March 4th, 2014, 02:29
Can someone point me at where the code is that handles pointer templates?
Hex maps don't do the same colored areas that are created on square maps... also the shapes are obviously 'wrong' as they should be 'HEX' shaped rather than square shaped.
I'm looking for the code where this stuff is handled in CoreRPG.

Nickademus
March 4th, 2014, 02:40
I'd say send Dulux-Oz a message. He seems to work a lot with hex maps and I know he had a pointer extension.

You might be able to find him around the boards.... you know... spamming.

dulux-oz
March 4th, 2014, 03:55
You might be able to find him around the boards.... you know... spamming.

Spamming?!? - I'll "spam" you in a moment :p

I know - I bight too easily.

Check out this thread (https://www.fantasygrounds.com/forums/showthread.php?19253-Custom-Pointers-Coding-Toolkit-Over-Several-Posts) - the last several posts are not really relevant, but the first dozen or so are.

This is not an extension that you can simply "drop in", its a Toolkit to help draw different types of Pointers - but it does require some coding on the user's part.

I also never got the shading working - never actually tried - I'm working on some other stuff at the moment so if you get it working let me know, otherwise I'll have a crack when I'm free (a few weeks from now).

Any questions just ask. :)

Oh, and Nick: Tutorial Videos link in my Sig.

Blackfoot
March 4th, 2014, 04:07
Yeah.. I'm actually looking for where the code that controls the 'coloring' templates is.

Nickademus
March 4th, 2014, 04:54
Oh, and Nick: Tutorial Videos link in my Sig.

Really, so that's where you put them. Would you believe I was looking for them the other day and couldn't find them. *smirk*

dulux-oz
March 4th, 2014, 15:17
Yeah.. I'm actually looking for where the code that controls the 'coloring' templates is.

JPG never exposed that functionality to me - at least as far as I know.

Actually, Moon, is that functionality exposed? And if not, could it be?

And for that matter, could you expose the option for mid-point snap-points in a hex-grid - or at least enough so that I (or someone else) could write an extension to allow this functionality - I believe that there are enough people (such as JohnD & Blackfoot, amongst others) to make it worthwhile.

Cheers

Nickademus
March 4th, 2014, 15:20
I will be using hexes as well in the future.

Moon Wizard
March 4th, 2014, 19:19
The pointer grid coloring is not exposed, and there is really no easy way to provide a quick API to it. It would need to be rewritten from scratch with script interaction in mind.

Regards,
JPG

Blackfoot
March 4th, 2014, 19:26
Sounds like folks need to get clicking on Moon Wizard's idea Informer!
Vote for HEX Pointer support! (https://fg2app.idea.informer.com/proj/?ia=40923)
Vote for improved HEX Map Support!! (https://fg2app.idea.informer.com/proj/?ia=76540)
Vote for Space and Reach on HEX Maps! (https://fg2app.idea.informer.com/proj/?ia=76539)

dulux-oz
March 5th, 2014, 09:49
@JPG=> What about the Hex-Grid Mid-Point of Hex-Side Snap-Points? Any chance of allowing us access to those - or even the Co-Ords of the Hex-Verticies Snap-Points - please?

Moon Wizard
March 5th, 2014, 23:14
It can potentially be calculated from the grid offset, grid size and image size; which is essentially what FG does when it draws the grid. It's non trivial to expose, because the exact coordinates are never saved, just calculated when redraw is needed.

Regards,
JPG

dulux-oz
March 6th, 2014, 03:12
It can potentially be calculated from the grid offset, grid size and image size; which is essentially what FG does when it draws the grid. It's non trivial to expose, because the exact coordinates are never saved, just calculated when redraw is needed.

Regards,
JPG

Are the grid offset, grid size and image size exposed? If so, where (admittedly, I haven't looked for them yet)? I would also think/assume we would need the HEX-Grid orientation (horizontal or vertical) - again, is this exposed (or can it be calculated from elements that are exposed)?

If I can get this working I'll turn it into an Extension for those who want to use it (or Moon can take the work and incorporate it into the next update, if he wants) - but first, I've got to get it working :)

Cheers

Moon Wizard
March 6th, 2014, 18:01
https://www.fantasygrounds.com/refdoc/imagecontrol.xcp

Grid offset (getGridOffset), grid size (getGridSize) and image size (getImageSize) are definitely exposed. I just looked and grid type is exposed too (getGridType returns nil, "square", "hexcolumn" or "hexrow").

Regards,
JPG

tdewitt274
March 16th, 2014, 17:06
Not sure if something like this will help: https://www.redblobgames.com/grids/hexagons/

I've been looking int hex grids for an HTML project and stumbled on this site a LONG time ago for maps. I found it again and noticed the "new" page on hexagons. Once you wrap your head around the alternate method, it makes sense.

I'm not sure if the distance "bug" in FG has been resolved. It's been a long time since I checked and possibly has been resolved.

Moon Wizard
March 16th, 2014, 19:59
That's a very nice write-up of hex grid implementation. Several parts look similar to my notes when I was rebuilding portions of the hex grid system last year.

I believe that hex grid distances are currently measured in hex grid "units" where a unit is the distance between center points of two adjacent hex grid center points.

Regards,
JPG