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 -- Window and Door Support! Import .dd2vtt files to create Dynamic Lighting Lines, Lights, Doors, Windows, Objects, etc.

1673229416

Edited 1673229428
The Aaron
Roll20 Production Team
API Scripter
UniversalVTTImporter Update v0.1.11 &nbsp;-- Added support for the new Doors and Windows.&nbsp; These are mostly supporting only by UDL.&nbsp; If you're using LDL, you'll probably want to stick with the exiting door support.&nbsp; However, the Windows actually work correctly with LDL (Doors work like windows in LDL.&nbsp; If there are LDL holdouts out there that want to have door support, I could probably write something that ties a UDL Door to an LDL line that could be toggled on and off with an opened UDL Door, just post below...). Note: UniversalVTTImporter will use the tooltip area on a graphic for storing a collection of created IDs to make it easy to clean up.&nbsp; It will blindly stomp on whatever is in there when it does the import.&nbsp; Since this is on the Map layer, that shouldn't be a problem, but you've been warned! =D Many new configuration options in the help: !uvtt --help Door and Window Support Use Window Objects &nbsp;-- Instead of creating DL Lines for windows, create DL Window Objects.&nbsp; Defaults to On. Use Door Objects &nbsp;-- Instead of creating DL Lines for doors, create DL Door Objects.&nbsp; Defaults to On. 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/11038224/" rel="nofollow">https://app.roll20.net/forum/permalink/11038224/</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.
1673233088
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Exceedingly cool!
Please forgive my naivete, but what does this API do, exactly?
1673397211
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It supports importing files from&nbsp; Universal VTT supporting mapping programs, such as Dungeondraft.
Does it convert existing maps in Roll20?
Does it only support Dungeondraft?&nbsp; I use DungeonFog.
1673555303
The Aaron
Roll20 Production Team
API Scripter
It supports a thing that writes in the UniversalVTT format, which I think is only Dungeon Draft. If you have maps in Dungeon Draft already, you can export them and import them. Be sure to follow the listed steps (particularly the website form).&nbsp; I don't know DungeonFog. If they have an export, I can look at supporting it.&nbsp;
1673557071
The Aaron
Roll20 Production Team
API Scripter
Ok, I just tested DungeonFog.&nbsp; It does have an export for Universal VTT!&nbsp; It works great!&nbsp; I updated the website to make it easier to load both .dd2vtt and .df2vtt files!
This is super awesome, thank you for sharing this with the community! Is there a way to convert Foundry VTT modules and EncounterPlus modules into UniversalVTT? Basically I have some Foundry VTT modules (maps) and EncounterPlus maps that I'd love to convert to Roll20 with this. I already have the base map images, just need to convert the walls and doors.
1673889203
The Aaron
Roll20 Production Team
API Scripter
I've not looked at Foundry Modules before. I'm sure a converter could be created for them, but I've not done it.&nbsp;
Hey there, for some reason, the maps I'm building in DungeonDraft have the Windows showing up as Doors once I import them. Can you help?&nbsp;
1674599350
Sr. K
Pro
Sheet Author
Red Archon said: Hey there, for some reason, the maps I'm building in DungeonDraft have the Windows showing up as Doors once I import them. Can you help?&nbsp; I've been there, you have to select allow light in DungeonDraft Portal Tool settings to place windows instead of doors. Thanks for the script!
1676173783

Edited 1676173821
I use the Dungeon Alchemist Importer for my Dungeon Alchemist maps, and I believe this is similar, but how do I export the UniversalVTT version into a .df2vtt file for when I want to import a Dungeonfog map?
1676181021
The Aaron
Roll20 Production Team
API Scripter
In Dungeon Fog, when you're in a map, click Export (1.), click the down arrow next to the file extension (2.), click Universal VTT (3.):
1676182598

Edited 1676221751
The Aaron said: In Dungeon Fog, when you're in a map, click Export (1.), click the down arrow next to the file extension (2.), click Universal VTT (3.): Very cool.....One thing I noticed is that the importer will lay down a pair of doors perfectly stacked on top of each other.&nbsp; Not a biggie....I just drag one away and delete it.&nbsp; It may be something I am doing.&nbsp;&nbsp;
1676297170

Edited 1676297199
Howdy, I think that this script was implicated in the recent change. When I enter the command "!uvtt --help" , I no longer see anything in chat. Could be me, I'm trying to check all the scripts I use.
1676297478
The Aaron
Roll20 Production Team
API Scripter
Do you have AutoButtons installed? That's one that has been affecting other scripts.&nbsp;
I do have that, I had updated it manually to 0.8.1. I just went to disable it, uvtt worked, I re-enabled it, and uvtt continued to work.&nbsp; I now see that most/all of my not-working scripts just started working again. I wonder if some of the system changes just rolled back. At the moment,&nbsp;!uvtt --help works both with autoButtons 0.8.1 enabled or disabled So, thank you for the quick reply.
1676301917
The Aaron
Roll20 Production Team
API Scripter
Great, glad that got it working! AutoButtons was using a language feature that had to be disabled because of a security issue.&nbsp; Unfortunately, it didn't degrade smoothly and caused any scripts that came after it in the initialization order to be broken.&nbsp; That usage in AutoButtons has been fixed in the latest version, so updating it will allow the other scripts to start working.
1679656984

Edited 1679669448
Hello there! Huge newbie here! First, congrats for this API! It is accurate and just reflects all the work invested! However, I struggle with the lights… Here is my map in DungeonDraft: Once imported in Roll20, it seems fine: But when I switch to the player’s view (Ctrl+L), everything is too bright. &nbsp; I think it re-renders the lights that are already in the picture. I tried to export the JPEG (not the VTT) without lights, but it won’t help with the high brightness. Moreover, this workaround removes the cozy non-linear point light effect and the sunset ambient light. Am I missing something, or should I try to create lightning directly within Roll20? Sorry if I’m naive... I can provide files if needed. [EDIT]: For now, I disabled " Use Light Color ", which works kinda like I wanted (why???). I'll let this here if somebody finds himself in the same situation.
1679676867
The Aaron
Roll20 Production Team
API Scripter
Hi GGsparta, It is almost certainly the colored lights.&nbsp; Roll20's implementation of colored lights is a bit simplistic, and leads to blown out lighting for players.&nbsp; I should experiment with lowering brightness of colored lights when I build them in Roll20, but for now, I'd steer clear of them.&nbsp; If you want the effect of the light color, you can export from Dungeon Draft with lighting on, then use non-colored lights.&nbsp; &nbsp;When you export from Dungeon Draft with lighting on, it renders the effect of the light on the map, so you get the color and the light, but not the blown out lighting.&nbsp; The downside is you can't really move or remove the light without the map looking strange because of the rendered lighting effect, but for maps, that's generally not a problem. For cases where the light color doesn't matter, you could even do multiple exports with different of the lights in Dungeon Draft removed, so that only the colored lights get rendered to the map, but all the lights end up in Roll20.
1679677422
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Another thing to be aware of (probably not in this case, but it gives related results) is placing a lot of NPCs with Night Vision next to each other. It can make dark areas look unnaturally bright when seen by the GM. All of those areas of brightening overlap and add together.
Hey guys....Loving the API.&nbsp; One question, though...how does the API handle round rooms?&nbsp; I have used it a few times on round rooms and it was, well, off by quite a lot.&nbsp; The lines were good, there were just off by about 10 squares.&nbsp; This has only happened on one dungeon that had round rooms in it.&nbsp; Is it a problem, or was it user error.&nbsp; (Probably the later)&nbsp; I am about to upload a big dungeon with many round rooms in it..Is there a trick that I am not doing properly?&nbsp; Just curious.&nbsp;
1682909822
The Aaron
Roll20 Production Team
API Scripter
Hmm. It should work fine. If you want to PM me your .vttes file, I can try it out and see what happens?
1682963176

Edited 1682963375
The Aaron said: Hmm. It should work fine. If you want to PM me your .vttes file, I can try it out and see what happens? Let me upload the latest dungeon and see what happens.&nbsp; Hopefully all will be well.&nbsp; How can I send you the VTT file?&nbsp; Seems like can only attach a picture. &nbsp;&nbsp;
1682965135
The Aaron
Roll20 Production Team
API Scripter
I'd put it in a private gist:&nbsp; <a href="https://gist.github.com/" rel="nofollow">https://gist.github.com/</a> &nbsp;Then just send that.