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

1600187630
The Aaron
Roll20 Production Team
API Scripter
Did you install the API script?  Verify that you have a "Help: UniversalVTTImporter" handout:
1600188692

Edited 1600188716
Well you are the man - wish I had reached out earlier, I would have had more hair on my head. Thank you very much for your help and your work!
1600190726
The Aaron
Roll20 Production Team
API Scripter
No problem!  =D
ok so i searched dungeondraft on google - clicked top link... took me to your page on humble... **Email not valid** on all my emails???? and there is no *sign in* and when i search it ON Humble it does not exist :/
1600352674
The Aaron
Roll20 Production Team
API Scripter
It's not my page, I just write a script for importing their data onto Roll20 easily.  If you just google for "dungeondraft", it's the first link.  I can't post a link here because it would violate the CoC for the forum as it is an external sales site.
Hmm how do I go about doing this with two separate image of the same map? I can't upload a 69x50 map because its' png is too large (17.4mb) and way over the limit of the max upload of 10mb.
1601991140
The Aaron
Roll20 Production Team
API Scripter
If you are breaking up your map, you just need to have some graphic that is the right size for the original.  Fore example, let's say your original map was 25x50, and you broke it into two 25x25 maps.  You would upload one of them and set it to 25x50 (it will be stretched to twice as wide as it should be).  Import the UniverstalVTT data on that image.  Once it's finished, scale that image to 25x25 and upload and place the other 25x25.  That should get you all the lights and walls in the right place.
1601992880
The Aaron
Roll20 Production Team
API Scripter
Another way of handling a large image is to create a low resolution version of the map and setup the lights and lines using that image.  Then you can drop in the high res sections and line them up with their location on the low res version.  This has the added benefit that the page preview image is the physically largest image on the page, so your preview will use the low res but full map image, and on your page you'll have the high res images for the players to see.  (This is how modules set up their page previews, btw)
1603070470

Edited 1603070481
Everytime I try to use this tool my resulting walls and light sources are the wrong scale and in the wrong position.  Any suggestions on what might be causing this and how to correct?
1603122114
The Aaron
Roll20 Production Team
API Scripter
Are they spanning a single graphic, or multiple?  Can you post a screen shot of the resultant walks and lights?
It's only a single graphic I was using to test out the importer.  I used a more complicated cave before trying this one to simplify things.
1603383686
The Aaron
Roll20 Production Team
API Scripter
That's bizarre.  Do you want to PM me an invite to the game and GM me and I can take a look?
This tool is great, I just have one question.  I'm using dungeondraft, and I'm not sure if this is a setting with dungeondraft or with your universal vtt importer, but I would like to change the thickness of the walls to be just a little thinner so that my players can actually see the walls.  Is that possible?  Currently, all the walls default to extra-large.  I went in and manually changed them all to regular, but it would be nice if I didn't have to do that step, epecially for more complicated maps.   
1603887657
The Aaron
Roll20 Production Team
API Scripter
That's part of the script. I bet you're using UDL, where wall thickness actually has an effect. I need to fix that in this script, sorry about that. 
I am not doing this right.  I uploaded my image, made sure they were the same name.  Import Sanitized my dd2vtt file, copied pasted into the dm comment, saved.  Made sure that I had it selected on the map layer, then I tried typing  !uvtt  into the chat but nothing happens.  I know to roll dice you have to type /roll 1d4 or whatever, do I have put anything before that code?
1603901045

Edited 1603901102
The Aaron
Roll20 Production Team
API Scripter
Can you verify the version that is being output in the API Console Log for Universal VTT Importer?  Also, verify there isn't an error listed there. "-=> UniversalVTTImporter v0.1.2 <=-  [Thu Aug 20 2020 16:56:13 GMT+0000 (Coordinated Universal Time)]"
The Aaron said: Did you install the API script?  Verify that you have a "Help: UniversalVTTImporter" handout: How do we do that?
1604250514
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Help handout: It would be in your journal tab, in the game where the script is installed. If you don't see it immediately, check in your archived handouts (bottom of the list) to make sure it hasn't been inadvertently archived. Making sure the script is installed: Go to your games API page. Make sure you have chosen UniversalVTTImporter in the drop down and told it to install. Here is a video of the process if you have not done it before:  How to Install Roll20 API Scripts
First - I second the request to fix the width of the lines. The players see only the floor, not the wall. Second - I'm having troubles when trying to start from a clean slate and import. One thing I do is go to the lighting layer and cmd-a to select all objects. Then I hit delete to remove them all.  this leaves all the red lines for doors still in place. I can't delete them ever. :/ I don't know if this is a feature of Dungeon Draft or the uvtt importer.
1604704387
The Aaron
Roll20 Production Team
API Scripter
The red lines for doors (actually windows) are on the GM layer.  Doors and Windows are not distinguished by Dungeon Draft, their only difference in the data is that windows are "open".  Open doors/windows are placed on the GM layer so you can open and close them by shifting them to and from the Dynamic Lighting Layer. I'll look at that width issue.
Thanks! Stupid question - how do I shift them to the Dynamic Light layer? Right clicking on them and doing Layer only shows three options: Map layer, Token layer and GM Layer.
1604705318
The Aaron
Roll20 Production Team
API Scripter
Ah, not so dumb a question.  I think you can use Scott C.'s Door Knocker script.  Otherwise, here's a little script which will move them back and forth between the GM layer and DL layer, for each selected drawing: !toggle-door Code: on('ready',()=>{ on('chat:message',msg=>{ if('api'===msg.type && /^!toggle-door(\b\s|$)/i.test(msg.content) && playerIsGM(msg.playerid)){ (msg.selected || []) .map(o=>getObj('path',o._id)) .filter(p=>undefined !== p) .forEach(p=>p.set('layer', (("gmlayer"===p.get('layer')) ? "walls" : "gmlayer"))) ; } }); });
I found the answer myself. You have to enable "advanced shortcuts", then you can move things with the shortcut "l ,". You can't do it using the mouse.
oh! I like that script! Thanks!
1604712263
The Aaron
Roll20 Production Team
API Scripter
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 Should be on the 1-click soon, or you can grab it from:&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>
Ohhh! SOOO much better! Thanks!
Do not set door width to 1! You can't select the red lines then.
1604727561
The Aaron
Roll20 Production Team
API Scripter
You can drag select across the middle of them to select them if they're thin like that:
ah thanks. I just use 2. 2 works great.
1604861558
The Aaron
Roll20 Production Team
API Scripter
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 )
Is there a way to get the animated water to work in roll20, I thought this would do it but I guess not?
1605201906

Edited 1605201924
The Aaron
Roll20 Production Team
API Scripter
No, sorry.&nbsp; This just handles the lights and dynamic lighting walls as best it can.&nbsp; The animated water effect is only available inside DungeonDraw, so far as I know.&nbsp; Its only exported formats are PNG, JPG, and Universal VTT Format.&nbsp; All of those are static images with no animation.
I have followed all the steps but I just keep getting the following message when running the !uvtt command in chat "Error: Universal VTT Data is missing or corrupt." I have also checked and confirmed that I have the UVTT help handout. Do you have any idea what the issue might be?
I followed all the steps as noted above and even corrected some of the issues noted above. But I now get the following problem. I size my jpeg to fit the grid, then when I run the vtt script, the DL info is small and not aligned to the resized image. It appears to be the size and location where I originally dropped the image onto the new page.&nbsp;
1605984135
The Aaron
Roll20 Production Team
API Scripter
Hmm. Can you each post the contents of the GM notes from the selected token? &nbsp;I'll try it out on my side and see if I can duplicate the issue.&nbsp;
The Aaron said: Hmm. Can you each post the contents of the GM notes from the selected token? &nbsp;I'll try it out on my side and see if I can duplicate the issue.&nbsp; {"format":0.2,"resolution":{"map_origin":{"x":0,"y":0},"map_size":{"x":35,"y":20},"pixels_per_grid":70},"line_of_sight":[[{"x":11,"y":9},{"x":9,"y":9},{"x":9,"y":11},{"x":11,"y":11}],[{"x":13.179688,"y":6.898438},{"x":15.160156,"y":6.957031},{"x":17.09375,"y":7.058594},{"x":18.957031,"y":7.195313},{"x":20.746094,"y":7.363281},{"x":22.441406,"y":7.566406},{"x":24.03125,"y":7.804688},{"x":25.511719,"y":8.070313},{"x":26.859375,"y":8.363281},{"x":28.066406,"y":8.683594},{"x":29.117188,"y":9.03125},{"x":30.007813,"y":9.402344},{"x":30.714844,"y":9.792969},{"x":31,"y":10},{"x":30.664063,"y":10.203125},{"x":29.867188,"y":10.59375},{"x":28.898438,"y":10.964844},{"x":27.78125,"y":11.3125},{"x":26.523438,"y":11.632813},{"x":25.136719,"y":11.925781},{"x":23.632813,"y":12.191406},{"x":22.027344,"y":12.429688},{"x":20.332031,"y":12.632813},{"x":18.558594,"y":12.800781},{"x":16.71875,"y":12.9375},{"x":14.828125,"y":13.039063},{"x":12.894531,"y":13.097656},{"x":10.933594,"y":13.121094},{"x":8.960938,"y":13.105469},{"x":6.984375,"y":13.042969},{"x":6,"y":13},{"x":6,"y":7},{"x":7.035156,"y":6.953125},{"x":9.101563,"y":6.890625},{"x":11.152344,"y":6.875},{"x":13.179688,"y":6.898438}]],"portals":[],"environment":{"baked_lighting":true,"ambient_light":"ffffffff"},"lights":[]}
I also get the same error when using the !uvtt -config command but not the !uvvtt --help command.
1606015315
The Aaron
Roll20 Production Team
API Scripter
That's good info. I'll try to reproduce the issue tomorrow.
1606058643
The Aaron
Roll20 Production Team
API Scripter
Malik: That sample imported perfectly for me: Can you post screenshots of the Page settings where you're importing it?&nbsp; What other scripts do you have installed? What happens if you try it in a fresh game with no other scripts? (or if you disable all the existing scripts?)
1606058688
The Aaron
Roll20 Production Team
API Scripter
The Aaron said: 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 ) Due to a git issue on my end, this didn't get merged in yet, but it should get there Tuesday!
1606068826
The Aaron
Roll20 Production Team
API Scripter
There is some nice synergy between UniversalVTTImporter and the UDLWindows script I just dropped!
I had a few other scripts enabled. When I disabled them it worked! Thank you!
1606322903
The Aaron
Roll20 Production Team
API Scripter
Great!&nbsp; Do you know which other script was conflicting with it?&nbsp; I'd like to try and fix it, or at least know to warn people about it if they have a similar problem.&nbsp; Maybe Emily is having the same issue.
First, love&nbsp;UniversalVTTImporter, thank you. Just upgraded to Pro so I could use it.&nbsp; Got a map, got a .vtt run through the great&nbsp; sanitizer , !uvtt and&nbsp; voila! &nbsp; ... but I find that it seems to ignore config commands to change wall width, color of walls on Dynamic Lighting layer, etc. Is such behavior expected at this time?&nbsp;&nbsp;&nbsp;&nbsp;
1607037709
The Aaron
Roll20 Production Team
API Scripter
Hmm.&nbsp; It shouldn't be ignoring them...&nbsp; I'll test real quick.
1607037855
The Aaron
Roll20 Production Team
API Scripter
Hmm.&nbsp; I changed all the settings and imported again and got the new settings rather than the old.&nbsp; Are you clearing the existing walls with: !uvtt --clear :before recreating them?
The Aaron said: Hmm.&nbsp; I changed all the settings and imported again and got the new settings rather than the old.&nbsp; Are you clearing the existing walls with: !uvtt --clear :before recreating them? I was not. Trying now, it seems to be ignoring that along with other commands. The behavior continues to be that !uvtt-config will show the settings I expect, but the dynamic lighting layer will not show any changes, and moving a lit token around the explorable darkness (UDL) will not show the changes I expect.&nbsp; Is it a UDL issue? Should I be using legacy? In the meantime, lemme try starting this Page over and see what happens. I'd set the image and the vtt before I knew I needed a pro account, api activated, etc (this thread helped me figure those pre-reqs out).
1607039320

Edited 1607039425
The Aaron
Roll20 Production Team
API Scripter
If you want to PM me an invite to your game and GM me, I can drop in and get to the bottom of it. Do you have two copies of the script installed, or perhaps you hand installed an old version instead of the 1-click version?&nbsp; What is the version info that shows up in the API Console on the API Scripts page?&nbsp; It should say: "-=&gt; UniversalVTTImporter v0.1.4 &lt;=-&nbsp; [Sun Nov 08 2020 18:43:27 GMT+0000 (Coordinated Universal Time)]" UDL vs LDL shouldn't matter.
The Aaron said: What is the version info that shows up in the API Console on the API Scripts page?&nbsp; It should say: "-=&gt; UniversalVTTImporter v0.1.4 &lt;=-&nbsp; [Sun Nov 08 2020 18:43:27 GMT+0000 (Coordinated Universal Time)]" It is that version.&nbsp; That is an incredibly generous offer. Will invite and GM in a mo'. After recreating the page, the lighting isn't working at all! :(&nbsp;
Andan said: After recreating the page, the lighting isn't working at all! :(&nbsp; ...and of course, after onemore &nbsp;!uvtt, the new settings showed up.&nbsp; Heh, and now I can't change those. Same "shows different in -config but not in the Dynamic Lighting layer" behavior. --clear still not effecting change.