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

Importing from a Dungeon Generator

1552400110

Edited 1552400207
Nick S.
Pro
Marketplace Creator
Translator
Hello! Not long ago I released a free dungeon generator that uses my Dungeon Tiles: DM Essentials with some new additions to generate high resolution images you can import into Roll20. Using it is super easy, but I thought it might be better to also create an API script that would do everything for you directly in the platform. I'm not at all experienced with javascript and Roll20's API implementation to know if this is possible; I was wondering if there would be a way of having my server generate an image and a script on roll20 create a page large enough to fit the image and import and put it in place, or if there are any API limitations that would make this impossible. An example ( link ) of a generated dungeon below (82 x 82 tiles at 70px per tile) Thank you!
1552404089

Edited 1552404154
DXWarlock
Sheet Author
API Scripter
I dont believe the API has anyway to pull in images from remote sources or get properties of them such as size or attributes. (Or at least that I know of, I tried to do the same for generating a mob bio with creature images in it, and setting token images). It could build the dungeon in Roll20 itself if they owned the tileset from the marketplace, that much I know it can do with a rollable table of the tile images setup. Its beyond my JS skill but I've seen it done to some degree before.
1552409177
GiGs
Pro
Sheet Author
API Scripter
DXWarlock said: It could build the dungeon in Roll20 itself if they owned the tileset from the marketplace, that much I know it can do with a rollable table of the tile images setup. Its beyond my JS skill but I've seen it done to some degree before. I dont believe the API can access marketplace images. You need to have them uploaded into your your library.
1552409318

Edited 1552409346
DXWarlock
Sheet Author
API Scripter
AH that's right, you're correct. forgot that step :)
1552419235
Nick S.
Pro
Marketplace Creator
Translator
Thank you both for the answers! From the looks of it, it won't be easy to port the whole code over to javascript and the Roll20 platform and have the users upload each file to their library for it to function. It's a shame, but I think the best thing would be to concentrate on the current generator and improve it hoping people will eventually find it and use it with Roll20. It's just an extra step to import and change the map size after all. That, or hope such functionality is added to the API and make it easier to port :) Thanks again!
1552436799
DXWarlock
Sheet Author
API Scripter
Well if they own it on marketplace you can mass 'add' to library bought folders of art with a rightclick.  But as you said that's the easy part. The actual part that does what you want is the time consuming coding part.
Nick, If you want to drive traffic and make it easier, you could also create a script that just helps people use the online generator.  The script would just show a link to your dungeon generator, then tell you to copy and paste the image, etc.   Then the script would find the largest graphic on the current page, align it to the page, and set the page size correctly based on the image. This script could be added to the Roll20 script library to help people find your stuff.