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] Dungeon Draw! Map Making Breakthrough (or I figured out how to select the canvas and Aaron taught me to be a "Bit Wiser")

1428771745

Edited 1430243844
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Update v1.0 -- Major changes to the script "DungeonDraw.js" complete rewrite with image creation queue that prevents hanging (big thanks to Aaron for that.) Added flatten and raise tools. "DungeonDrawConnections.js" &lt;-Deprecated please remove if you have it installed. Only scripts needed as of update v1.0: "DungeonDraw.js" "DungeonDrawDoors.js" "DungeonDrawTiles.js" &lt;-no changes to this file if you have already updated your URLs (keep what you have DO NOT replace. Update v0.6 -- "DungeonDraw.js" script. Better multiple page handling. Update v0.5 --"DungeonDraw.js" script. Improved obj.toFront/Back() Prevent more than one request being sent the the chat handler. Fixed map maker from wrapping around images on the objects layer. Update v0.4 -- Added "Flatten Tool" This is an additional script ("DungeonDrawConnections.js"). Update v0.3 -- Improved interior wall mapping. <a href="http://i.imgur.com/XtZGa2s.gif" rel="nofollow">http://i.imgur.com/XtZGa2s.gif</a> Update v0.2 -- Removed the door and torch handling from the main script and created a separate DungeonDrawDoors.js file. Added an "On/Off" feature and other improvements to the DungeonDraw.js file. NOTE: No Changes to the DungeonDrawTiles.js file so if you have updated your images your edit file will work just fine. Dungeon Draw! API script that works with Dungeon Mapper map tiles. PREVIEW! API Script.You will need to have purchased this market pack (script provides free samples.) Additional texture tiles will be on the market soon. Additional free tokens needed can be found here along with a 14x13 PNG file can be found here. Reference material to help step up the array can be found here. Recommended Setup Getting the scripts installed: 1) Start a new campaign 2) Install the three scripts found here: Dungeon Draw Scripts (You should see "DungeonDraw: Resetting state" in the Output Console once you have saved all three.) 3) Now test your install (See: "Testing the script "as is.") Testing the script "as is." 1) Go to your new campaign. 2) For the map with the player's bookmark , set the map to 14 width and 13 height. 3) Upload the file TestMap14x13.png to your library (found here) 4) Place it on the GM layer and size it to 14 units width and 13 units height. 5) Enter the API command "!DungeonDrawMenu" (You will see the API button "Dungen Draw Menu") 6) Click the API button "Dungen Draw Menu." Menu Overview Menu Overview 1) Current Tiles: You can see the tile pack that is loaded. a) Each image is direct access to placing a tile. Tile will be placed in the center of the map. 2) Main Menu a) If you place a path on the map layer in the wrong spot, use the "Undo-Path" action b) Once you have placed your paths, click the "Dungeon-Draw" action. c) To clear the map layer use the "Clear-Map" action. d) To set the map color based on the loaded pack use the "Set-Map_color" action e) "Change-Texture" bring up a list of all installed textures. f) Toggle "Dungeon-Draw" off or on. 7) Go to the map layer and select the pathing tool and fill in the white areas on the map 8) If you make a mistake while place the paths, juts click "undo." 9) It doesn't matter if you overlay the paths, just full cover the white areas. 10) This shape test each tile for proper placement and orientation. 11) Check both packs. Example Change the URLs it the DungeonDrawTiles.js file. Its not fun sorry for that, just take your time. You will need the Dungeon Mapper token pack There are 28 for each set. Don't forget the four new ones found here. I do four at a time, save and refresh the main menu. Use this reference sheet to keep from going crazy. Found here . Last steps.. Check the map against the TestMap14x13.png image. The API never flips a token, it only spins them. So you if you see an issue you might have mirrored tiles reversed. Once done... I hope you enjoy this token pack. Notes: 1) Door and torch control example 2) Current script's door control will not survive the Transmogrifier..
This is ridiculously innovative... I mean wow, just amazing.
1428773600

Edited 1428773966
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
remove() Its so powerful if you are clever with it. Once I realized I could effectively select the map layer using the pathing tool everything changed. I then FINALLY understood bitwise with Aaron's help. Map making just got crazy good on Roll20. Edit: I also use .remove() to add an "undo" feature to let you correct any mistakes when placing a path quickly. Example
1428774297

Edited 1428775913
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Setting the map color: Example Using textures together. Example Large map with secret areas. Example
1428775640
Lorien Wright
Pro
Marketplace Creator
Are other artists allowed to create tile sets for this? BECAUSE THIS IS FREAKING AWESOME
1428775844
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Phillip W. said: Are other artists allowed to create tile sets for this? BECAUSE THIS IS FREAKING AWESOME Of course! Send me a PM and I will provide you some information.
1428776884
vÍnce
Pro
Sheet Author
This needs to be added into roll20's drawing toolbox! Great job Stephen.
Man if artists would make seamless texture packs for this thing, I could see it becoming the standard way of building the dungeon. I am guessing handling say diagonal corridors or octagonal rooms and such gets significantly more complex?
1428779815
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Kevin said: Man if artists would make seamless texture packs for this thing, I could see it becoming the standard way of building the dungeon. I am guessing handling say diagonal corridors or octagonal rooms and such gets significantly more complex? 1) Access to market content through API... that is coming. 2) This a "hack" to selecting the canvas.. so do we continue and improve the "hack" or is selecting the canvas coming? Don't know. 3) Encoding information about the tile. This made placement and lighting of the tiles easy.... we need a standard model or few reasonable number of standard models. For this one it was this:
1428781751
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Vince said: Great job Stephen. Positive reinforcement from Vince? This must be a trick.
1428784715
Wes
Sheet Author
Man that is seriously Impressive! Great Work!
Amazing, ok so what do I have to do to get the un-watermarked tiles? I bought it and downloaded them to my computer. I uploaded them to my library they have strange names like: 36105-TP1 Door Single 10x10 901.png I see the URLs, but what do I have to change them to? <a href="https://marketplace.roll20.net/library/" rel="nofollow">https://marketplace.roll20.net/library/</a>...? I try adding that to the end and its telling me not found. What am I doing wrong?
Super awesome!
for those having trouble like me, I found this in Stephen's other post about DungeonMapper <a href="https://app.roll20.net/forum/post/1746279/script-dungeon-mapper-auto-dynamic-lighting-that-move-with-the-tiles-texture-pack-approach-user-interface#post-1819922" rel="nofollow">https://app.roll20.net/forum/post/1746279/script-dungeon-mapper-auto-dynamic-lighting-that-move-with-the-tiles-texture-pack-approach-user-interface#post-1819922</a>
1428792929

Edited 1428792942
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Greg B. said: for those having trouble like me, I found this in Stephen's other post about DungeonMapper <a href="https://app.roll20.net/forum/post/1746279/script-dungeon-mapper-auto-dynamic-lighting-that-move-with-the-tiles-texture-pack-approach-user-interface#post-1819922" rel="nofollow">https://app.roll20.net/forum/post/1746279/script-dungeon-mapper-auto-dynamic-lighting-that-move-with-the-tiles-texture-pack-approach-user-interface#post-1819922</a> Yes... its the same painful process.. Once you have upload the images to your library you need to replace the URLs in the script with the URLs from your library.
Really cool!
Just added this to my stuff. Gotta say, this is great. I started with the dungeon mapper pack and installed those scripts. The process took a while, but it is worth it. Adding this to the mix wasn't as long, as there are only 56 items to add, compared to the original. Using the spread sheet as reference was certainly helpful, and I used the original script to get the file path info, so it was easy.. er.. easier.. lol. Here's to tag access.. Thanks again for the great tool. I hope you sell a million of your sets.
Hi, I've tried the script and it's amazing. I copied it from this thread without modifying anything. I've got one problem : when i add a door, i click on the ready doors/torches button : it works : it add a toggle-feature button to the door. OK But when i press the toggle-feature button the door doesn't change and there is an error in the API output console: For reference, the error message generated was: /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ TypeError: Cannot call method 'substring' of undefined at TrackedObj._validateAttrs ( When i use a DungeonMapper door and activate it with dungeonmapper menu, it works correctly.
1428856373
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Laurent said: Hi, I've tried the script and it's amazing. I copied it from this thread without modifying anything. I've got one problem : when i add a door, i click on the ready doors/torches button : it works : it add a toggle-feature button to the door. OK But when i press the toggle-feature button the door doesn't change and there is an error in the API output console: For reference, the error message generated was: /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ TypeError: Cannot call method 'substring' of undefined at TrackedObj._validateAttrs ( When i use a DungeonMapper door and activate it with dungeonmapper menu, it works correctly. I am currently working to get both script to play nice with each other when comes to the door. Sorry for that, I hope to have it fixed today.
No problem, i can use the DungeonMapper script for doors and light and use dungeonDraw to create Dungeons so i'm totally happy.
We need to do anything when moving when moving a DungeonDraw map to our campaign after clicking the "ReadyDoors" I transferred over the Door and Torch control character but the toggling isn't working. I didn't want to have to copy the entire DungeonDraw script over to my live campaigns as i'm not sure how well it will behave with the other scripts i have running etc.
1428865495
The Aaron
Pro
API Scripter
You shouldn't have to copy the creation script over.
Well it works in the DungeonDraw campaign but when I move it over to my active campaign it doesn't do anything when I click the toggle-feature
1428866898
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Greg B. said: Well it works in the DungeonDraw campaign but when I move it over to my active campaign it doesn't do anything when I click the toggle-feature Greg, I sent you a PM.
1428922415

Edited 1428923185
An impressive script to complement an already impressive system. Nice work Stephen! I can safely say that if / when you publish other tilesets that work with this system, they'll be purchased in a hurry. :) I'm interested in creating custom tilesets for my own use, and I have already purchased the tileset is utilized by this script. Can you send me some information to get started (Likely the gimp/photoshop files you used to create your tiles)?
1428936455
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
UPDATE: See lead post.
Awesome! Thanks for the update Stephen, found a slight issue in testing this out. If I select a Torch and do a copy/paste I receive this error in console when I attempt to use the trigger feature. /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ TypeError: Cannot read property 'pack' of undefined at dungeonMapperDoorsToggle (evalmachine.&lt;anonymous&gt;:52:27) at handleInput (evalmachine.&lt;anonymous&gt;:468:17) at eval ( Restarting sandbox due to script changes... If I save script and then DungeonDraw comes back but if I use the menu from DungeonDraw then it works as it should, not a huge deal but wanted you to be aware. Greg
1428942296
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
API really likes to create the token. I need to work on fixing that however.
Ok one more thing then i'm back to my day job :) I tranmod move the created map with updated torches / doors etc. Lighting is working good. I click on the door, and the Dynamic lighting goes away, But when I close the door it doesn't come back.
1428943147
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Stephen S. said: Notes: 1) Door and torch control example 2) If you are going to use the Transmogrifier to send finished maps to another campaign; the API for that campaign will need both the DungeonDrawDoors.js file and your current copy of the DungeonDrawTiles.js file. You have both "DungeonDrawDoors.js" and your current copy of the "DungeonDrawTiles.js" file in your transmod campaign? You need both.
I've been wondering; "Is it possible for creating and using own or friend's made art/tokens/etc.?"
Stephen S. said: Stephen S. said: Notes: 1) Door and torch control example 2) If you are going to use the Transmogrifier to send finished maps to another campaign; the API for that campaign will need both the DungeonDrawDoors.js file and your current copy of the DungeonDrawTiles.js file. You have both "DungeonDrawDoors.js" and your current copy of the "DungeonDrawTiles.js" file in your transmod campaign? You need both. Yes, I have both. Sorry had another SS, but it didn't paste.
1428950290

Edited 1428950556
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Working on making the constructing of interior walls easier. <a href="http://i.imgur.com/tgchK2q.gif" rel="nofollow">http://i.imgur.com/tgchK2q.gif</a>
Greg B. said: Awesome! Thanks for the update Stephen, found a slight issue in testing this out. If I select a Torch and do a copy/paste I receive this error in console when I attempt to use the trigger feature. /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ TypeError: Cannot read property 'pack' of undefined at dungeonMapperDoorsToggle (evalmachine.&lt;anonymous&gt;:52:27) at handleInput (evalmachine.&lt;anonymous&gt;:468:17) at eval ( Restarting sandbox due to script changes... If I save script and then DungeonDraw comes back but if I use the menu from DungeonDraw then it works as it should, not a huge deal but wanted you to be aware. Greg Encountered the same issue - It's due to you having the "Dungeon Mapper Doors" script present simultaneously. It is also handling the toggle doors command, and is causing the error. Disable it to fix. Had a chance to play with this a bit. Your other script was fantastic, and this is a colossal improvement over that. Great work! As far as interior walls goes, perhaps a "Blend" mode could be created, utilizing a different path color or some such? Might write that up myself next weekend, if you don't get around to it before then. ;)
I'm loving this. In fact, I just subbed up to mentor because I saw this. One small bug to report, which confused me quite a bit at first: most actions only occur on the page the players are currently on. So if you use this on a page that isn't the one with the players on, the dynamic lighting, the background colour, and any tiles you place end up on a different page. And you will likely be confused.
Chris S. said: Greg B. said: Awesome! Thanks for the update Stephen, found a slight issue in testing this out. If I select a Torch and do a copy/paste I receive this error in console when I attempt to use the trigger feature. /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ TypeError: Cannot read property 'pack' of undefined at dungeonMapperDoorsToggle (evalmachine.&lt;anonymous&gt;:52:27) at handleInput (evalmachine.&lt;anonymous&gt;:468:17) at eval ( Restarting sandbox due to script changes... If I save script and then DungeonDraw comes back but if I use the menu from DungeonDraw then it works as it should, not a huge deal but wanted you to be aware. Greg Encountered the same issue - It's due to you having the "Dungeon Mapper Doors" script present simultaneously. It is also handling the toggle doors command, and is causing the error. Disable it to fix. Had a chance to play with this a bit. Your other script was fantastic, and this is a colossal improvement over that. Great work! As far as interior walls goes, perhaps a "Blend" mode could be created, utilizing a different path color or some such? Might write that up myself next weekend, if you don't get around to it before then. ;) @Chris, I had deleted the Door-And-Torch-Control character from the active campaign, I moved the DungeonDraw Map over. No other Dungeon Mapper Doors script is/was present. I then copied the Door-And-Torch-Control character from DungeonDraw to the active campaign. @Stephen I spun up a brand new campaign with your most updated scripts copied the map over, redid the torches and light tokens. All work great inside the DungeonDraw Campaign, it reapplies the correct Dynamic lighting when opening/closing the doors but when I copy it to my active campaign the torches and door work but the dynamic lighting isn't reapplied when the door is shut. Here is the SS that I meant to post earlier.
1428969783
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Oh...... Greg B. said: Chris S. said: Greg B. said: Awesome! Thanks for the update Stephen, found a slight issue in testing this out. If I select a Torch and do a copy/paste I receive this error in console when I attempt to use the trigger feature. /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ TypeError: Cannot read property 'pack' of undefined at dungeonMapperDoorsToggle (evalmachine.&lt;anonymous&gt;:52:27) at handleInput (evalmachine.&lt;anonymous&gt;:468:17) at eval ( Restarting sandbox due to script changes... If I save script and then DungeonDraw comes back but if I use the menu from DungeonDraw then it works as it should, not a huge deal but wanted you to be aware. Greg Encountered the same issue - It's due to you having the "Dungeon Mapper Doors" script present simultaneously. It is also handling the toggle doors command, and is causing the error. Disable it to fix. Had a chance to play with this a bit. Your other script was fantastic, and this is a colossal improvement over that. Great work! As far as interior walls goes, perhaps a "Blend" mode could be created, utilizing a different path color or some such? Might write that up myself next weekend, if you don't get around to it before then. ;) @Chris, I had deleted the Door-And-Torch-Control character from the active campaign, I moved the DungeonDraw Map over. No other Dungeon Mapper Doors script is/was present. I then copied the Door-And-Torch-Control character from DungeonDraw to the active campaign. @Stephen I spun up a brand new campaign with your most updated scripts copied the map over, redid the torches and light tokens. All work great inside the DungeonDraw Campaign, it reapplies the correct Dynamic lighting when opening/closing the doors but when I copy it to my active campaign the torches and door work but the dynamic lighting isn't reapplied when the door is shut. Here is the SS that I meant to post earlier. Damn.... I recall why I had the "ready doors" in Dungeon Mapper now. This script as it is, wont survive the the Transmogrifier. Transmogrifier results in all new object "id"s... breaking the link. I will have to fix that. Sorry for all the frustration I cause you today :|
1428970096
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Update v0.3 -- Improved interior wall mapping. <a href="http://i.imgur.com/XtZGa2s.gif" rel="nofollow">http://i.imgur.com/XtZGa2s.gif</a>
No worries, I'm trying to help. My game is this Saturday so long as the kinks are worked out by then I can test out the dungeon that I made using DungeonDraw then.. :) Even with this small issue (the door lighting) its still has saved me a ton of time.
1429017161

Edited 1429017554
The new version isn't working for me. When I use the "Dungeon-Draw" button with this input: The following is produced instead (Complete with lighting paths on the bad wall boundaries, as expected). I rolled back to commit b4fb4f3f4be1c15204bff30abea1cdb650bb3859, and verified that version works as expected. I have no other scripts running in the campaign that I am testing this on. There is nothing else on the page that is being tested, and it is set to be the "Players" page. This occurs on both large selections, and smaller ones. The tiles which are omitted seem to be consistently omitted between calls to "Dungeon-Draw".
1429019245
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I will check it.
1429021926
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
So.... I placed in Gist what i have as V3. <a href="http://i.imgur.com/UKZB70V.gif" rel="nofollow">http://i.imgur.com/UKZB70V.gif</a> I can't reproduce what you are seeing. If you have Dungeon Mapper in there.... I am not sure how the events between the scripts will interact. I would have to make each script turn off when the other one is active...
1429022235
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
It might be picking up images on other pages... I might not be checking just on that page!
1429022355
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Stephen S. said: It might be picking up images on other pages... I might not be checking just on that page! That is what it is.
Dungeonmapper isn't loaded at the moment. Though, this campaign (Which is my "Assets Creation" sandbox) used to host it. Hence the macro. The scripts aren't loaded. Thanks for the quick fix!
1429022670

Edited 1429022695
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Fixed!!! Gist v3 should work.
1429033326
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
You know this book really helped me: JavaScript: The Good Parts Paperback – May, 2008 by Douglas Crockford Don't know if that has been mentioned here before.
1429035291
The Aaron
Pro
API Scripter
HAHAHAHAHAHA... I'll have to check that one out... =D
1429043518
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="http://i.imgur.com/Etat75D.gif" rel="nofollow">http://i.imgur.com/Etat75D.gif</a> This still needs some work.... but so far, looks promissing.
Looking awesome thanks for the update Stephen.
1429050941
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Updated! New tool added: <a href="http://i.imgur.com/hDUBlN0.gif" rel="nofollow">http://i.imgur.com/hDUBlN0.gif</a> Additional script file for this latest update.