Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] Hexploration

1520985385

Edited 1540925515
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Hexploration This thread has been closed. The new support thread for the script is here:&nbsp;<a href="https://app.roll20.net/forum/post/6927322/script-hexploration-thread-2/?pageforid=6927322#post-6927322" rel="nofollow">https://app.roll20.net/forum/post/6927322/script-hexploration-thread-2/?pageforid=6927322#post-6927322</a>
1520986459
The Aaron
Pro
API Scripter
neat!
1520991870
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That's pretty darn clever.
1520992560
Gold
Forum Champion
I'm pretty hexcited about this. Will test it out soon (within a few weeks, when practical for my games).
1521000900

Edited 1521001023
GiGs
Pro
Sheet Author
API Scripter
I've tried running this a few times, but I keep getting "Error: PathMath is not defined" It's hard to say what's going wrong. I'm just creating a polygon, then when it's complete, selecting it and clicking the macro. My map has vertical hexes. Is there anything special i have to do to set it up, or something basic I'm missing when making the polygons? More detailed error code from the log: "ReferenceError: PathMath is not defined\n&nbsp; &nbsp;&nbsp; at getHexesInArea (apiscript.js:14150:20)\n&nbsp; &nbsp;&nbsp; at fillArea (apiscript.js:14114:17)\n&nbsp; &nbsp;&nbsp; at _.each.sel (apiscript.js:14254:13)\n&nbsp; &nbsp;&nbsp; at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9)\n&nbsp; &nbsp;&nbsp; at msg (apiscript.js:14252:13)\n&nbsp; &nbsp;&nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:65:16)\n&nbsp; &nbsp;&nbsp; at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:70:8)\n&nbsp; &nbsp;&nbsp; at /home/node/d20-api-server/api.js:1510:12\n&nbsp; &nbsp;&nbsp; at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560\n&nbsp; &nbsp;&nbsp; at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)"
1521002217
The Aaron
Pro
API Scripter
I think that might be one of Stephen’s other scripts. Check the Roll20 repo?
1521002314
The Aaron
Pro
API Scripter
Yeah: &nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/blob/master/PathMath/1.5/PathMath.js" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/blob/master/PathMath/1.5/PathMath.js</a>
1521008006
GiGs
Pro
Sheet Author
API Scripter
Thanks, I found it also needs MatrixMath. Now, that i have the dependencies, it crashes after drawing a single hex. Errors in log: "⬢⬢⬢ Initialized Hexploration v1.0 ⬢⬢⬢" "Hexploration ERROR: Cannot read property 'get' of undefined" "TypeError: Cannot read property 'get' of undefined\n&nbsp; &nbsp; at Object.persistHex (apiscript.js:1681:21)\n&nbsp; &nbsp; at _.chain.map.hex (apiscript.js:1742:29)\n&nbsp; &nbsp; at Function._.map._.collect (/home/node/d20-api-server/node_modules/underscore/underscore.js:172:24)\n&nbsp; &nbsp; at _.(anonymous function) [as map] (/home/node/d20-api-server/node_modules/underscore/underscore.js:1496:34)\n&nbsp; &nbsp; at fillArea (apiscript.js:1726:6)\n&nbsp; &nbsp; at _.each.sel (apiscript.js:1863:13)\n&nbsp; &nbsp; at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9)\n&nbsp; &nbsp; at msg (apiscript.js:1861:13)\n&nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:65:16)\n&nbsp; &nbsp; at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:70:8)" "Hexploration ERROR: Cannot read property 'get' of undefined" "TypeError: Cannot read property 'get' of undefined\n&nbsp; &nbsp; at Object.persistHex (apiscript.js:1681:21)\n&nbsp; &nbsp; at _.chain.map.hex (apiscript.js:1742:29)\n&nbsp; &nbsp; at Function._.map._.collect (/home/node/d20-api-server/node_modules/underscore/underscore.js:172:24)\n&nbsp; &nbsp; at _.(anonymous function) [as map] (/home/node/d20-api-server/node_modules/underscore/underscore.js:1496:34)\n&nbsp; &nbsp; at fillArea (apiscript.js:1726:6)\n&nbsp; &nbsp; at _.each.sel (apiscript.js:1863:13)\n&nbsp; &nbsp; at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9)\n&nbsp; &nbsp; at msg (apiscript.js:1861:13)\n&nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:65:16)\n&nbsp; &nbsp; at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:70:8)"
G G said: Thanks, I found it also needs MatrixMath. Now, that i have the dependencies, it crashes after drawing a single hex. Errors in log: "⬢⬢⬢ Initialized Hexploration v1.0 ⬢⬢⬢" "Hexploration ERROR: Cannot read property 'get' of undefined" "TypeError: Cannot read property 'get' of undefined\n&nbsp; &nbsp; at Object.persistHex (apiscript.js:1681:21)\n&nbsp; &nbsp; at _.chain.map.hex (apiscript.js:1742:29)\n&nbsp; &nbsp; at Function._.map._.collect (/home/node/d20-api-server/node_modules/underscore/underscore.js:172:24)\n&nbsp; &nbsp; at _.(anonymous function) [as map] (/home/node/d20-api-server/node_modules/underscore/underscore.js:1496:34)\n&nbsp; &nbsp; at fillArea (apiscript.js:1726:6)\n&nbsp; &nbsp; at _.each.sel (apiscript.js:1863:13)\n&nbsp; &nbsp; at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9)\n&nbsp; &nbsp; at msg (apiscript.js:1861:13)\n&nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:65:16)\n&nbsp; &nbsp; at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:70:8)" "Hexploration ERROR: Cannot read property 'get' of undefined" "TypeError: Cannot read property 'get' of undefined\n&nbsp; &nbsp; at Object.persistHex (apiscript.js:1681:21)\n&nbsp; &nbsp; at _.chain.map.hex (apiscript.js:1742:29)\n&nbsp; &nbsp; at Function._.map._.collect (/home/node/d20-api-server/node_modules/underscore/underscore.js:172:24)\n&nbsp; &nbsp; at _.(anonymous function) [as map] (/home/node/d20-api-server/node_modules/underscore/underscore.js:1496:34)\n&nbsp; &nbsp; at fillArea (apiscript.js:1726:6)\n&nbsp; &nbsp; at _.each.sel (apiscript.js:1863:13)\n&nbsp; &nbsp; at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9)\n&nbsp; &nbsp; at msg (apiscript.js:1861:13)\n&nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:65:16)\n&nbsp; &nbsp; at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:70:8)" Same here.&nbsp;
1521034216

Edited 1521034269
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Oh, right. I also updated PathMath to support this script. Here's the new PathMath:&nbsp; <a href="https://github.com/Cazra/roll20-api-scripts/blob/h" rel="nofollow">https://github.com/Cazra/roll20-api-scripts/blob/h</a>...
Looks great! It's working now for me. I just noticed one thing: The token that reveals hexes needs to represent a character. Most people will probably have a "party token" that doesn't represent a single character in the journal
1521044902
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Right, this is mentioned in the script's README/One-Click documentation.
1521045543
GiGs
Pro
Sheet Author
API Scripter
Okay now I have VectorMath installed too, it's working. It's pretty great. This will be a huge benefit to hexmapping exploration games.&nbsp; It's a shame it doesnt work for squares, it would be a pretty useful alternative to fog of war i think for people who cant use dynamic lighting because its too demanding, or whatever. Just have a token that represents vision and move it around to clear a room.&nbsp; Manual fog of war is so clunky.
Stephen L. said: Right, this is mentioned in the script's README/One-Click documentation. Yes, I saw that afterwards. Just mentioning it because my party token on the map didn't represent a character, and I think that's the case for most people. But once I adjusted it, the script works like a charm.&nbsp; Luckily, I have some travelling/hexcrawling planned for my next session, so this comes in just in time! Thanks!
1521046930

Edited 1521046981
Ada L.
Marketplace Creator
Sheet Author
API Scripter
G G said: Okay now I have VectorMath installed too, it's working. It's pretty great. This will be a huge benefit to hexmapping exploration games.&nbsp; It's a shame it doesnt work for squares, it would be a pretty useful alternative to fog of war i think for people who cant use dynamic lighting because its too demanding, or whatever. Just have a token that represents vision and move it around to clear a room.&nbsp; Manual fog of war is so clunky. I'm not sure how useful that would be for dungeon crawling since the purpose here is to reveal one tile at a time. That could get a bit tedious clearing out each tile with the light source token one at a time. Probably a better solution for that use-case would be large, polygonal fog-of-war areas that get removed as PCs step into their area.
Excellent! I will give it a spin this weekend for sure.
This is great! Can it be used to reveal hexes that are one or more spaces away from the players rather than just the one they land on?&nbsp;
1521366332

Edited 1521366368
GiGs
Pro
Sheet Author
API Scripter
At present it removes hexes when you move your token on top of them. That suggests an idea though: clear all hexes the token is adjacent to. I suppose you could set a range, from 0 (land on top) to whatever, but 1 would be very useful.
1521413735
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Cool idea! I'll add it to the roadmap.
Could you add an option, where you draw a path, and the script fills the complete map EXCEPT the hexes that were covered by the path area? Like an inverted fill?
1521492418

Edited 1521492784
I used this last weekend for some hex crawling my group was doing.&nbsp; Things went really well.&nbsp; Nicely done! I edited the script to make the hexes black with dark grey outlines because I found that easier on the eyes than the built-in yellow.&nbsp; Maybe the ability to customize the color would be nice. I also moved a copy of the world map from the Map layer to the GM layer, lining them up exactly.&nbsp; That way, when I had it drop all the hexes on the mostly-unexplored world, I could still tell where things were since I now have a GM-only copy of the map right on top.&nbsp; It made it hard for me to see the "You Are Here" token, but I already know where that is, so it was doable. I don't know if that's something you could automate with the script as well, but I would sure like it for the next world map I set up this way.
1521492552
GiGs
Pro
Sheet Author
API Scripter
That's a great idea. I find the yellow a bit too bright too.
Great!
1521529114
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
neat trick!
consider me a possible hexvert for this i just might be :D&nbsp;
1521553304
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Adam E. said: I used this last weekend for some hex crawling my group was doing.&nbsp; Things went really well.&nbsp; Nicely done! I edited the script to make the hexes black with dark grey outlines because I found that easier on the eyes than the built-in yellow.&nbsp; Maybe the ability to customize the color would be nice. I also moved a copy of the world map from the Map layer to the GM layer, lining them up exactly.&nbsp; That way, when I had it drop all the hexes on the mostly-unexplored world, I could still tell where things were since I now have a GM-only copy of the map right on top.&nbsp; It made it hard for me to see the "You Are Here" token, but I already know where that is, so it was doable. I don't know if that's something you could automate with the script as well, but I would sure like it for the next world map I set up this way. Nice trick! I already had plans to allow GMs to choose colors for their hexes in the next version, but I'll see about implementing the trick of putting the map on the GM layer too. Arthur B said: Could you add an option, where you draw a path, and the script fills the complete map EXCEPT the hexes that were covered by the path area? Like an inverted fill? Sure, I'll add that to the roadmap.
The links seem to not work for me anymore.
1521992964
GiGs
Pro
Sheet Author
API Scripter
Looks like github might have changed its folder structure: Hexploration PathMath I think you might also need&nbsp; VectorMath
1522021453

Edited 1522021479
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Sorry, I deleted my branch after it got merged into the upstream master branch. The script is now available through Roll20's One-Click library.
1522086972

Edited 1522087281
Is there an option to reveal the hexes around the token, so the party can see a bit in front of them? Or maybe perhaps a Mouse click reveal hex option? =) Scrolled up and saw it had just been asked, im a lazy idiot, nevermind me! =P
1522138331
Havoc
Sheet Author
API Scripter
"fill: '#FFFF88'," I think you should be able to add another hex number like 60 to add transparency, to create a fog of war feel.
1522154629
Havoc
Sheet Author
API Scripter
Question: Are you able to port this thing into Fog of War? To create a fog of war based on the same selection and make it disappear one by one using a token?
1522157011
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Havoc said: Question: Are you able to port this thing into Fog of War? To create a fog of war based on the same selection and make it disappear one by one using a token? No, there is currently no interface in the API to manipulate the Fog of War.
1522970664
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Update: v1.1 Version 1.1 is now available in beta from the merge request here:&nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/pull/" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/pull/</a>... This update has the following changes: * The script now has a chat menu interface. * Implemented script configurations for hex colors. * Implemented reveal distance configuration. When a token moves, it will also reveal hexes out to this distance. * Hexes can now be named. When the named hex is revealed, it will announce that it has been discovered in the chat. * Implemented inverted fill. This works like the ordinary polygon fill, except that every hex NOT in the selected polygons is filled instead. * Requires HTML Builder script. Preview:&nbsp;
1522971584
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That is terribly cool.
1522974724
GiGs
Pro
Sheet Author
API Scripter
Those are great improvements!
Awesome! That will be one of my must-have scripts!
Stephen L. said: Update: v1.1 Version 1.1 is now available in beta from the merge request here:&nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/pull/" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/pull/</a>... This update has the following changes: * The script now has a chat menu interface. * Implemented script configurations for hex colors. * Implemented reveal distance configuration. When a token moves, it will also reveal hexes out to this distance. Splendid! Awesome work man! &lt;3
Very nice Stephen! I remade the campaign map just to be able to use this script! :D
1523984884
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Glad ya'll are liking it!&nbsp; Version 1.1 is now available through the Roll20 One-Click library.