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 - Canvas Drawing Mapping API with Dynamic Lighting (Supports 45 Degree Mapping.)

1430178443

Edited 1430650395
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="https://www.youtube.com/watch?v=8lNXPsDs4UE" rel="nofollow">https://www.youtube.com/watch?v=8lNXPsDs4UE</a> Update v2.0 -- Major changes to the script Now supports 45 degree mapping, "Raise" (along with "Flatten") and more tile features! Also includes four new sample texutures. 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. Rectangle and Polygon/Line Tools This script leverages the Rectangle and Polygon/Line Tools to create dungeon maps based on a selected set of tiles in the API. The WIKI provides more information on the Drawing Tools and can be found here: Drawing_Tools Rectangle are supported. Polygon/Line are supported Circles and freehand not supported. Using shift helps Also use transparent fill, this will help when closing a polygon path and gives a visual confirmation the path has be accepted by the API. Recommendations: Hold the Shift key while using the Shapes tool and have the grid enabled. This will cause your shape to snap to the grid. Use transparent fill, this will help when close a polygon path and give a visual confirmation the path hass be accepted by the API. Player's Bookmark The API uses the Player's Bookmark as the active page. All changes by the API will be applied to that page. Caution... Loading the Script Getting the scripts installed: 1) Start a new campaign 2) Install the three scripts found here: Dungeon Draw Scripts 3) Enter the API command "!DungeonDrawMenu" For more information see the API:Use_Guide on the WIKI. Updating URLs in the Code 1) Download Complete Set the pack from the market. 2) Use the Market bulk uploaded 3) Open the API editor in one tab 4) Open the campaign in another tab. 5) Use the in game image tool to get to your library. 6) Search for the "key" you want. 6) Right click the one you want and copy the URL. 7) Edit the script. 8) Save... script 9) In the game reload that texture pack and see if it looks right. 10) Repeat for each key Its painful and I am sorry for that hopefully we can get access to image tags (be sure to VOTE ) HINT: Take your time. Do one or two, save and refresh the script. Check as you go. Important Note: Tile DD_016 (the diagonal tile) repeats three times in the array. This tile is not water marked, however if you choose to replace it you will need to place the same URL in each case. Code and URL shorted in this example .... {url: 'https.../thumb.jpg?1430172145', key: 'DD_015', value: 85, mask: 255, dlBits: 85, diag: false}, {url: 'https.../thumb.png?1430172900', key: ' DD_016 ', value: 248, mask: 255, dlBits: 248, diag: true }, {url: 'https.../thumb.png?1430172900', key: ' DD_016 ', value: 240, mask: 255, dlBits: 240, diag: true }, {url: 'https.../thumb.png?1430172900', key: ' DD_016 ', value: 120, mask: 255, dlBits: 120, diag: true }, {url: 'https.../thumb.jpg?1426895538', key: 'DD_017', value: 255, mask: 0, dlBits: 255, diag: false}, .... Overview Menu Overview Flatten and Raise tools: Add tokens to the Map layer with token action to raise or flatten a section of the map. Current Tiles: You can see the tile pack that is loaded. Each image is direct access to placing a tile. Tile will be placed in the center of the map. Utility Tiles: Each image is direct access to placing a tile. Tile will be placed in the center of the map. Doors: Single and Double. Each image is direct access to placing a tile. Tile will be placed in the center of the map. These tiles block light. Light Sources: Large light source and wall mounted light source. Each image is direct access to placing a tile. Bares or Gate: Each image is direct access to placing a tile. Tile will be placed in the center of the map. These tiles do not block light. Stairs Each image is direct access to placing a tile a. If you place a path on the map layer in the wrong spot, use the "Undo-Path" action. b. To clear the map layer use the "Clear-Map" action. c. Once you have placed your paths, click the "Dungeon-Draw" 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. This will allow you to draw paths on the map layer that are not converted by the API. Water Mark tile replacements found here: <a href="https://marketplace.roll20.net/browse/set/522/dung" rel="nofollow">https://marketplace.roll20.net/browse/set/522/dung</a>... <a href="https://marketplace.roll20.net/browse/set/537/dung" rel="nofollow">https://marketplace.roll20.net/browse/set/537/dung</a>... <a href="https://marketplace.roll20.net/browse/set/544/dung" rel="nofollow">https://marketplace.roll20.net/browse/set/544/dung</a>...
1430211772
Ziechael
Forum Champion
Sheet Author
API Scripter
Simply amazing work, those textures look great, can't wait to get my players somewhere they'll benefit from this!
Awesome! I can't wait.
1430233352

Edited 1430233529
Very useful post Stephen! Thanks again for this awesome script. I bought the original dungeon mapper pack (and will likely buy the new ones as well). Will it be updated to include the diagonal tiles?
1430234229
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Funkbuqet said: Very useful post Stephen! Thanks again for this awesome script. I bought the original dungeon mapper pack (and will likely buy the new ones as well). Will it be updated to include the diagonal tiles? So.... to avoid torturing people.... I updated the "Old School" tiles and just removed the watermarks. Fixed the doors a bit and added three new tiles (pit, pit covered with cover almost off and covered pit.) For the "Basic Dungeon" I fixed the doors a bit, added same tiles and only left water marks on four of them.
1430244075
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Gist has been updated to v2.0 Sample tiles added for the new packs (expected on the Market in the next few days.)
1430247440

Edited 1430247531
Should they update in our library, or do we need to download them from somewhere? I don't see them on git-hub or dropbox. Also, the new sets look bitchin'!
1430248147
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Dungeon Mapper are the only ones fully on the market. The entire pack can be down loaded here. For this API the only ones needed for watermark removal are: <a href="https://marketplace.roll20.net/browse/item/36108/t" rel="nofollow">https://marketplace.roll20.net/browse/item/36108/t</a>... Used as DD_006 <a href="https://marketplace.roll20.net/browse/item/36111/t" rel="nofollow">https://marketplace.roll20.net/browse/item/36111/t</a>... Used as DD_017 <a href="https://marketplace.roll20.net/browse/item/36112/t" rel="nofollow">https://marketplace.roll20.net/browse/item/36112/t</a>... Used as DD_031 <a href="https://marketplace.roll20.net/browse/item/36113/t" rel="nofollow">https://marketplace.roll20.net/browse/item/36113/t</a>... Used as DD_032 You need to download them and upload them to your library. Get the URL and update the script. Example code below, "key" to match the URL to is italic. URL part to change is underlined. textures['Basic Dungeon|#000000'] = [ ..... {url: ' <a href="https://s3.amazonaws.com/files.d20.io/images/8399395/hq6ryhmr3eVSboQry-VA8g/thumb.jpg?1427051987" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/8399395/hq6ryhmr3eVSboQry-VA8g/thumb.jpg?1427051987</a> ', key: ' DD_017 ', value: 255, mask: 0, dlBits: 255, diag: false}, ..... ],
1430249294

Edited 1430249353
Looking great Stephen, do you have a new cheat sheet for those that purchased the previous DungeonDraw tile pack for the Classic Tiles on which lines to replace in the tiles to get ride of the watermarks? Do you know how much the tile packs will cost when released? Thanks, Greg EDIT: LOL literally as soon as I click post, this message came up with my request, you can't beat that on response time.
1430249609
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Greg B. said: Looking great Stephen, do you have a new cheat sheet for those that purchased the previous DungeonDraw tile pack for the Classic Tiles on which lines to replace in the tiles to get ride of the watermarks? Do you know how much the tile packs will cost when released? Thanks, Greg EDIT: LOL literally as soon as I click post, this message came up with my request, you can't beat that on response time. I expect the packs to be live on the market in the next 24-48 hours (you never really know.) As to the cost its, two new packs, both priced at $3.99 (that is the minimum Market price) for a total of two new textures (124 tiles in total.)
Stephen S. said: Greg B. said: Looking great Stephen, do you have a new cheat sheet for those that purchased the previous DungeonDraw tile pack for the Classic Tiles on which lines to replace in the tiles to get ride of the watermarks? Do you know how much the tile packs will cost when released? Thanks, Greg EDIT: LOL literally as soon as I click post, this message came up with my request, you can't beat that on response time. I expect the packs to be live on the market in the next 24-48 hours (you never really know.) As to the cost its, two new packs, both priced at $3.99 (that is the minimum Market price) for a total of two new textures (124 tiles in total.) Great bargain, thanks Stephen.
So do the doors/torches/trap doors, survive the transmog process? I haven't had a chance to try it yet.
The trap doors have a toggle feature? Once again, this is phenomenal! I am going to buy the lot for sure Stephen. The work you are putting into this is amazing. Here's to hoping that they add tag support soon.
1430259088
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Greg B. said: So do the doors/torches/trap doors, survive the transmog process? I haven't had a chance to try it yet. Working on that. Wanted to get this 45 dergee feature working.
1430259154
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Kimli said: The trap doors have a toggle feature? Once again, this is phenomenal! I am going to buy the lot for sure Stephen. The work you are putting into this is amazing. Here's to hoping that they add tag support soon. I want to those to have a 1, 2 or 3 state options (step through or direct access.)
Actually, looks like if you copy the Tiles/Doors script over and the Door/Torch control character they do in fact work. No on the trap doors, but that would be cool, i'd be surprised if Stephen hasn't already thought of it though.
Is there an updated cheat sheet for associating the image file names with the DD_#?
For this API the only ones needed for watermark removal are: <a href="https://marketplace.roll20.net/browse/item/36108/t" rel="nofollow">https://marketplace.roll20.net/browse/item/36108/t</a>... Used as DD_006 <a href="https://marketplace.roll20.net/browse/item/36111/t" rel="nofollow">https://marketplace.roll20.net/browse/item/36111/t</a>... Used as DD_017 <a href="https://marketplace.roll20.net/browse/item/36112/t" rel="nofollow">https://marketplace.roll20.net/browse/item/36112/t</a>... Used as DD_031 <a href="https://marketplace.roll20.net/browse/item/36113/t" rel="nofollow">https://marketplace.roll20.net/browse/item/36113/t</a>... Used as DD_032 These should be what you're looking for.
I was referring the the spreadsheet that associates the tiles with the correct DD_# from the old thread here . on the old sheet the stairs were DD_025 & DD_026 and above they are 031 & 032. I want to make sure that I am associating the right tiles.
Funkbuqet said: I was referring the the spreadsheet that associates the tiles with the correct DD_# from the old thread here . on the old sheet the stairs were DD_025 & DD_026 and above they are 031 & 032. I want to make sure that I am associating the right tiles. I gotcha, since the other tiles were now freebies I just left those alone and only swapped out the tiles that had watermarks, the four above.
1430447498

Edited 1430448703
Is anyone else having issues with the "remove/replace" macro button not working? Update: I was able to get it working on new maps by removing the old "characters" and reloading the scripts. But it still does not work on any of the maps I made before the update. Thankfully Stephen has made it super easy for me to remake them!
1430482119
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Funkbuqet said: Is anyone else having issues with the "remove/replace" macro button not working? Update: I was able to get it working on new maps by removing the old "characters" and reloading the scripts. But it still does not work on any of the maps I made before the update. Thankfully Stephen has made it super easy for me to remake them! Sorry for that. I had to remake the tiles to a better default rotation; that is why it wasn't working well with maps from the eailier scripts.
1430485941

Edited 1430486392
Are the new textures on the market yet? Edit: Seems that they are. :) I don't see any way to download the complete set like the others. Do I have to download them one at a time to upload them?
1430487075
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Let's me asked to have them download able. .
Stephen S. said: Let's me asked to have them download able. . Thanks.
1430487840
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Let me know how they worked out. Interested in what you thought of the curtains for "bar/gate": <a href="https://marketplace.roll20.net/browse/item/37446/s" rel="nofollow">https://marketplace.roll20.net/browse/item/37446/s</a>... And the windows for "small lights": <a href="https://marketplace.roll20.net/browse/item/37444/s" rel="nofollow">https://marketplace.roll20.net/browse/item/37444/s</a>...
1430490061
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Greg B. said: Stephen S. said: Let's me asked to have them download able. . Thanks. It looks to be corrected!
Stephen S. said: Greg B. said: Stephen S. said: Let's me asked to have them download able. . Thanks. It looks to be corrected! Nice, I shall go collect and will report feedback this afternoon. Hopefully my afternoon meeting will give me the brain power to setup the new tiles :)
Great script, very useful. Wouldn't it be neat though...if there was a door that looked like a wall? In other words, a door tile that had 2 sections of wall, instead of 1 wall and 1 door. Could be used for secret doors - looks just like a section of wall until it's detected, then toggle it open!
1430586348
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Actually been thinking about something like this.... <a href="http://i.imgur.com/5QqMtAD.gif" rel="nofollow">http://i.imgur.com/5QqMtAD.gif</a> The idea would be to "token" lock the wall/secret door... but provide token controll to the players that detect it. Then you can can turn on the aura and make it visible only to those with token control (those that can see it.) That way I can see a secret door and ot tell Aaron about it (not that I would ever actually do that... you can trust me Aaron.)
1430586372
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Either way secret door need added.
All the tiles updated! And looking awesome, putting the sewer/cave tiles to use for tonight's little side adventure. I have t messed with the curtains yet, but do they block LoS when used? Definately a secret door tile set needed, cool traps would be a nice addition too.
1430606200

Edited 1430606530
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
No. It's just decorative but somewhat interactive at this time. I need to work on this: <a href="https://app.roll20.net/forum/post/1796679/slug%7D#" rel="nofollow">https://app.roll20.net/forum/post/1796679/slug%7D#</a>... The idea is graphics define themselves and any script can interact with them. Open a chest, break a table, peek through a door cracked door (key hole peek would be fun)... whatever, you just drop them in and the API knows how to manage them. (By work on it....I mean get it far enough along that Aaron starts to tell me the right way to do it.)
Stephen S. said: No. It's just decorative but somewhat interactive at this time. I need to work on this: <a href="https://app.roll20.net/forum/post/1796679/slug%7D#" rel="nofollow">https://app.roll20.net/forum/post/1796679/slug%7D#</a>... The idea is graphics define themselves and any script can interact with them. Open a chest, break a table, peek through a door cracked door (key hole peek would be fun)... whatever, you just drop them in and the API knows how to manage them. (By work on it....I mean get it far enough along that Aaron starts to tell me the right way to do it.) Nice! Ill be looking forward to it.
1430870524

Edited 1430872137
First, I want to say I am very impressed with your work, the Dungeon Mapper tiles, the Dungeon Mapper API script, and Dungeon Draw. I seem to have run into an issue, and I'm not sure if this was intended or a bug: it appears your two scripts are not wholly compatible. After getting both Dungeon Mapper and Dungeon Draw installed, I found that the chat commands were no longer being recognized. Disabling Dungeon Draw resolved the issue for Dungeon Mapper, and vice versa. I'm not terribly familiar with the Roll20 API yet, but it appears both of your scripts use a chat message event handler, and pass this to a function called handleInput (the same name in each script, but not the same function, obviously). I'm also not terribly familiar with JavaScript yet, so i don't know if the duplicate function name is the issue itself. As it stands, what I'll likely do as a workaround is disable Dungeon Mapper first, get the rough sketch of the dungeon done with Dungeon Draw, then disable Dungeon Draw, restore Dungeon Mapper, and do the fine work with that. EDIT: The issue is somewhat larger with your dynamic door controls. Installing both of these scripts apparently makes controlling doors a pain. I thought I would bring this to your attention (in case you intended for these two to work together), and to the attention of others (in case the workaround helps anyone).
I've been wanting to use this for a while now, but hesitant to spend money when I just purchased the old Dungeon Generator pack you made, Stephen. I finally bought them all tonight and I love it. Excellent work.
1431226773
Dylan G.
Pro
Marketplace Creator
Sheet Author
Is there a way to get this to send as a private GM whisper? I love this, but I'd like to use it without spamming the player chat, and without making a secondary campaign.
1431254577
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I have a few updates I need to do with this. In no particular order: Improve the clear map tool. Add saving and loading maps. Making this transparent to the players in chat. Adding GMlayer tools/features. Stair teleport (going up down stairs moves player to another area.) Hopefully some of this I can get to next week.
Don't forget secret doors! :)
1431262595
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
No. That is a good one. Have something I want to test for that.
1431262658
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I may post a demo of that out today to see if it's workable.
So I seem to be running into issues where the Dungeon Draw script seems to just stop working while I am in the campaign. All the buttons in the menu stop functioning as well as all the macros for torches/doors. It sometimes fixes when I go into the API scripts page and "save" the pages again without changing anything then jump back into the campaign, but not always. Only edits I did were to put in the non-watermarked images from the packs on the Marketplace. I have double checked to make sure nothing got messed up when pasting the new links and I dont see anything. Do you happen to know what might be causing this issue? I am using Chrome if that matters at all.
1431292296
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Do other scripts stop?
Stephen, I had a question, is it possible to switch the position of the doors from always being on the "front", to always being in the "back"? Basically if I ever get tokens that I need to control on the object layer the doors and other items can get in the way a bit. Thanks in advance!
1431813004
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Line 436 in the door script.... " toFront(obj);" Change that to "toBack(obj);"
Thank you sir for the quick reply!
1431854749

Edited 1431865686
Testing the script a little bit i got the following error: /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 'get' of undefined at getBoxBoundPath (evalmachine.&lt;anonymous&gt;:6332:43) at evalmachine.&lt;anonymous&gt;:6423:24 at Array.forEach (native) at Function._.each._.forEach (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:78:11) at drawMap (evalmachine.&lt;anonymous&gt;:6422:11) at handleInput (evalmachine.&lt;anonymous&gt;:6577:37) at eval Edit: I am getting this so often it is really difficult working with the script, altough I would love to use it much more! I'd appreciate any fixes/help. And some more stuff i have noticed: Scaling Is there a way to scale the tools? I am making usually rather large maps with fine grained scaling (shadowrun, ranges with 100-200m are not unusual). It looks like everything has a fixed size in pixels, which makes it rather difficult to rebuild maps with for example importing a map and using the align to grid tools. Doors e.g. seem to always be 140px by 140px instead of for example 2 by 2 and quite often i try to make a 1 grid unit cell long drawing and it looks like it is simply not possible. I am not sure how this would/should work exactly but I don't feel like I am really able to draw the maps i import as image because of the scaling issues. Either the doors are too large, or the scaling to grid units do not fit the tile size. Also very often I have the feeling I am only able to draw a room over multiple grid cells. Like when 2 by 2 for a 0.5m grid with grids every 0.5 units. This makes it quite difficult to map some maps. Transparency Would it be possible to use transparent tiles? Walls and Shadow only, such that it would be possible to draw the tiles on top of another map which maybe maps out the interior. Edit: Ok i can simply map the map transparent and overlay it... Was easier than thought. Select Player Token when at door When a player character is at the door token, it is not possible to select it anymore as the door is above the player token, this is quite annoying. Still - an amazing script!
1431870899

Edited 1431876252
@Wandler - read Stephens last reply, it will fix the problem with selecting characters at doors: Line 436 in the door script.... " toFront(obj);" Change that to "toBack(obj);"
1431874185

Edited 1431876234
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Wandler said: Scaling Is there a way to scale the tools? I am making usually rather large maps with fine grained scaling (shadowrun, ranges with 100-200m are not unusual). It looks like everything has a fixed size in pixels, which makes it rather difficult to rebuild maps with for example importing a map and using the align to grid tools. Doors e.g. seem to always be 140px by 140px instead of for example 2 by 2 and quite often i try to make a 1 grid unit cell long drawing and it looks like it is simply not possible. I am not sure how this would/should work exactly but I don't feel like I am really able to draw the maps i import as image because of the scaling issues. Either the doors are too large, or the scaling to grid units do not fit the tile size. Also very often I have the feeling I am only able to draw a room over multiple grid cells. Like when 2 by 2 for a 0.5m grid with grids every 0.5 units. This makes it quite difficult to map some maps. Send me a map you often use. Would like to look at it.
<a href="https://drive.google.com/folderview?id=0BydyttBwxV" rel="nofollow">https://drive.google.com/folderview?id=0BydyttBwxV</a>... This is the style of maps I would like to use for shadowrun. It is already difficult to get the scalings correct manually playing with different distance to grid size ratios while maintaining a number of hexfields which do not bring the application to stutter. All of this would be just "nice" but the script crashing with above error would be much more important because this is the differenc between "unable to use" and "using it with workarounds"
1431876274
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I think you want something more like geomorphic.... but not quite. <a href="https://app.roll20.net/forum/post/1408589/slug%7D#" rel="nofollow">https://app.roll20.net/forum/post/1408589/slug%7D#</a>... Looking at these you see a lot of repeating room patterns. What I would do, would make rooms with connections... make the tile smart enough to make its connection a wall, window or door automatically... if the tile connection has nothing next to the connect then become a window. If the tile connection is to a hall make it a door. if the tile connection is to another room make the connection a wall. Then you could build really large blueprint maps very fast... complete with furnishings Each tile would get DL paths the move with it and connections that update based on adjacent tiles.