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 (thread 2)

1540925429

Edited 1546215687
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Hexploration v1.2 Old thread:&nbsp; <a href="https://app.roll20.net/forum/post/6179141/script-hexploration/?pageforid=6179141#post-6179141" rel="nofollow">https://app.roll20.net/forum/post/6179141/script-hexploration/?pageforid=6179141#post-6179141</a> This script allows the GM to conceal areas of a hex grid with individual opaque hexes. Then characters can explore the hexes to reveal them. To create a hex-filled area, first draw a polygon containing the area you want filled with hexes. Then select the polygon and activate the 'Hexploration_fill' macro installed by this script. That's it! Further documentation is included on the script's GitHub page. The script is available through the One-Click library. Demo: Known Issues: None Future Roadmap: Translation support for menu Option to ping to discovered location
1540925469
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Update v1.2 This update includes the following changes: Added Maximum Reveal Distance configuration. While this is set, hexes currently being drawn will only be revealed if you are within the specified number of hexes. Line of sight is enforced when revealing hexes. Hexes can now be given icons.
Awesome!
While I no longer use Roll20.&nbsp; But I still check in occasionally to see what the community has developed. This is a very cool script!
1546004384
Kai
Sheet Author
Stephen, the icons are a great addition to your script. I use it in my Curse of Strahd campaign, while the players explore the Barovia map. They had an absolute blast. Would it be possible to add an option that automatically zooms a newly discovered token for all players as if the GM had pressed shift+z with the token selected?&nbsp;
1546215650
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Kai said: Stephen, the icons are a great addition to your script. I use it in my Curse of Strahd campaign, while the players explore the Barovia map. They had an absolute blast. Would it be possible to add an option that automatically zooms a newly discovered token for all players as if the GM had pressed shift+z with the token selected?&nbsp; Sounds like a useful idea! I'll add it to the development roadmap.
Is it possible to also have semi-transparent hexes? I like the idea of using greyed tiles to represent hexes that haven't been properly explored but are known of (either they have been to an adjacent hex, or have gained map info somehow). Would it be possible to have, for example, a layer of opaque hexes that are revealed when the token steps with 1 hex of it, and then another layer of semi-transparent hexes that are only revealed when the token enters that tile directly? Image showing kind of what I mean:
1551372144
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Yes, you can have semi-transparent hexes by specifying a CSS-style rgba function for the color. E.g.&nbsp; rgba(0, 0, 0, 0.5) The above color would be black with 50% transparency.&nbsp; Currently, the script doesn't support changing the transparency of hexes as you move closer to them, though it would be possible to implement this in a future update.
I've had it working previously, but I had to restart it and now I can't get it to fill in maps anymore. AFAIK nothing changed.
1552406533
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Could you copy-paste the text of that stack trace from the API output console? It gets cut off in that image.
1552418542

Edited 1552418559
I was dead tired and didn't consider it for some reason, sorry about that. Hexploration ERROR: Cannot read property 'get' of undefined" "TypeError: Cannot read property 'get' of undefined\n&nbsp; &nbsp; at Object.deletePath (apiscript.js:3781:18)\n&nbsp; &nbsp; at Object.deleteHex (apiscript.js:3770:27)\n&nbsp; &nbsp; at _.chain.map.hex (apiscript.js:3972:27)\n&nbsp; &nbsp; at Function._.map._.collect (/home/node/d20-api-server/node_modules/underscore/underscore.js:205:24)\n&nbsp; &nbsp; at _.(anonymous function) [as map] (/home/node/d20-api-server/node_modules/underscore/underscore.js:1639:39)\n&nbsp; &nbsp; at _fillHexes (apiscript.js:3967:6)\n&nbsp; &nbsp; at fillInverseArea (apiscript.js:4026:12)\n&nbsp; &nbsp; at msg (apiscript.js:4200:11)\n&nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:65:16)\n&nbsp; &nbsp; at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151: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.deletePath (apiscript.js:3781:18)\n&nbsp; &nbsp; at Object.deleteHex (apiscript.js:3770:27)\n&nbsp; &nbsp; at _.chain.map.hex (apiscript.js:3972:27)\n&nbsp; &nbsp; at Function._.map._.collect (/home/node/d20-api-server/node_modules/underscore/underscore.js:205:24)\n&nbsp; &nbsp; at _.(anonymous function) [as map] (/home/node/d20-api-server/node_modules/underscore/underscore.js:1639:39)\n&nbsp; &nbsp; at _fillHexes (apiscript.js:3967:6)\n&nbsp; &nbsp; at fillArea (apiscript.js:3942:12)\n&nbsp; &nbsp; at _.each.sel (apiscript.js:4188:13)\n&nbsp; &nbsp; at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:186:9)\n&nbsp; &nbsp; at msg (apiscript.js:4186:13)"