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,Update] UniversalVTTImporter -- Import .dd2vtt files to create Dynamic Lighting Lines, Lights, and Windows!

1660698491
The Aaron
Roll20 Production Team
API Scripter
UniversalVTTImporter Update v0.1.10 &nbsp;-- Added support for new Transparent barrier type on the dynamic lighting layer.&nbsp; Window support is back! Update v0.1.9 &nbsp;-- Fixed bug causing all portals to be windows! (Thanks&nbsp; Graham R. ) Update v0.1.8&nbsp; -- Added support for Opaque Objects, Window Portals, Colored Lights&nbsp; (Thanks&nbsp; Edward R. ) Many new configuration options in the help: !uvtt --help Create Open Portals &nbsp;is renamed to&nbsp; Open Portals Mode .&nbsp; There are now 4 options rather than just on and off: Movement Blocking Window &nbsp;will draw a line that blocks movement but not sight. (Default) Movement Blocking Window with Glass &nbsp;creates the line as above, but also creates a glass window pane on the map layer. GM Layer Line &nbsp;is the old "On" setting, and just draws the portal on the GM Layer instead of the DL layer, ready to move back and forth to open and close it. None &nbsp;is the old "Off", and draws nothing at all. Window Color &nbsp;sets the color for the Window Pane on the map layer, and the color of open portal lines on the GM or DL layer. Window Width &nbsp;sets the width of the Window Pane on the map layer.&nbsp; Open portal lines on the GM and DL layers get the&nbsp; Door Width . Object Color &nbsp;sets the color that Opaque Objects are drawn in on the DL layer. Object Width &nbsp;sets the width that Opaque Objects are drawn in on the DL layer. Object Transparent &nbsp;sets if Opaque Objects should just block movement and not sight. Note that you can now specify&nbsp; --no-objects &nbsp;to not use Opaque Objects at all: !uvtt --no-objects Light Color &nbsp;has been renamed to&nbsp; DL Layer Light Marker Color &nbsp;to better reflect what it is and remove confusion. Use Light Color &nbsp;toggles if you want to use the colors specified for lights in the import file.&nbsp; DungeonDraw can export a map with the lighting color applied to the map, or with the map unlit.&nbsp; Here's a comparison of the same map exported with and without lighting, and using Roll20 Light Colors and without: Unless you plan to move lights, or turn them on and off, you might chose to just export the color and not import the color, so that's why there's an option. One minor quality of life change, UniversalVTTImporter will now automatically clear previously created objects when you run it again.&nbsp; That makes it easy to try different configurations and then reimport all your maps when you have the setting you like.&nbsp; To be clear, running: !uvtt on a map you've already imported will now be the same as running this was: !uvtt --clear !uvtt The new code should show up in the 1-click on Tuesday, or you can get it now from my repo. Update v0.1.4 &nbsp;-- Fixed a bug where changing the exported scale of a map would cause the alignment of the objects created to be incorrect. (Thanks&nbsp; Dudemic ) Update v0.1.3 &nbsp;-- New --clear command and configurations options. (Thanks&nbsp; Jesse ,&nbsp; Stephen C. ) Added --clear command that removes all the lines and lights created for graphic.&nbsp; Configuration options for Wall Width, Wall Color, Door Width, Door Color, Light Color (aura on the DL layer), and creating open portals (generally, windows) on the GM layer.&nbsp; All configuration options are available in the help from: !uvtt --help or directly from: !uvtt-config Update v0.1.2 &nbsp;-- Added UDL support.&nbsp; Note that if you are using UDL, the UDL gets toggled off and on causing the map to be revealed briefly.&nbsp; This is a bug in the way UDL lights are supported with the API.&nbsp; I've reported it and will fix it when a fix becomes available.&nbsp; (Thanks&nbsp; Elias. Ö. S. ,&nbsp; Ben M.&nbsp; ) Update v0.1.1&nbsp; -- Added trimming of non breaking spaces to fix FireFox use.&nbsp; Created and documented companion website ( <a href="http://roll20api.net/uvtti.html" rel="nofollow">http://roll20api.net/uvtti.html</a> ) for preprocessing file for easier use.&nbsp; (Thanks&nbsp; Ryexandra ,&nbsp; Casey D. ,&nbsp; Justin S. ) UniversalVTTImporter provides a way to setup Dynamic Lighting lines and Lights stored in Universal VTT format, ala Dungeondraft. Commands !uvtt [--help] --help &nbsp;-- Displays this help Import Process The process for importing is pretty straight forward, but there are several steps, as follows: From your Universal VTT supporting mapping program, such as Dungeondraft, export your map as a&nbsp; .png &nbsp;or&nbsp; .jpg &nbsp;file. The API cannot create images from the Universal VTT, so you will need to upload it manually. Next export the Universal VTT version into a&nbsp; .dd2vtt &nbsp;file. Drop your map image file onto a page and scale it as desired. Open the properties by double clicking the image. Visit&nbsp; <a href="http://roll20api.net/uvtti.html" rel="nofollow">http://roll20api.net/uvtti.html</a> &nbsp;and sanitize and copy your&nbsp; .dd2vtt &nbsp;contents.&nbsp;&nbsp; Load the Universal VTT file in a text editor and copy the contents. Paste the contents into the GM Notes section of the map graphic and save changes. With the graphic selected, run&nbsp; !uvtt Your map should now have dynamic lighting lines, lines for doors and windows, and light sources from the original. View before: Adding .dd2vtt contents to the GM Notes: After selecting the graphic and running !uvtt:&nbsp; (Note: the red line is an open portal on the GM layer) View of the DL Layer, showing created light sources (purple aura), walls (brown) and doors (red). Next up I'll be adding commands to change the colors, selectively create open portals on the GM layer, clear the created walls, etc.&nbsp; Let me know if you have other feature requests or any issues!&nbsp; This should be in the 1-click on Tuesday. Prior Thread:&nbsp; <a href="https://app.roll20.net/forum/permalink/8824428/" rel="nofollow">https://app.roll20.net/forum/permalink/8824428/</a> Github:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/UniversalVTTImporter/UniversalVTTImporter.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/UniversalVTTImporter/UniversalVTTImporter.js</a> Support my work on If you use my scripts, want to contribute,&nbsp; and have the spare bucks to do so , go right ahead. However, please don't feel like you must contribute just to use them! I'd much rather have happy Roll20 users armed with my scripts than people not using them out of some sense of shame. Use them and be happy, completely guilt-free! Disclaimer:&nbsp; This Patreon campaign is not affiliated with Roll20; as such, contributions are voluntary and Roll20 cannot provide support or refunds for contributions.
1660705747

Edited 1660705766
This might be silly question/respond, but not understanding the use of this or how is this different from me creating my own lines, door lines, window lines.&nbsp; The Width / Set throws me off&nbsp; as well. Perhaps a video demo showcasing how this is effective / quicker??
1660707221
vÍnce
Pro
Sheet Author
Create a cool map with <a href="https://dungeondraft.net/" rel="nofollow">https://dungeondraft.net/</a> and you can import the map into roll20 with the dl walls and lighting already done.
1660734784
David M.
Pro
API Scripter
Right, this isn't a standalone script per se. It's intended to be used in conjunction with 3rd party s/w that exports to .dd2vtt format. If you don't make maps that way, the "normal" method is what you'd use.&nbsp;&nbsp;