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

PathToWindowOrDoor misses doors

1703278595

Edited 1703278677
I'm planning to run the module How the Lich Stole Christmas  next week. In preparing for it, I wanted to convert all the old style doors in the module to the new doors. I found this script and said, "hey, great! This will make the conversion easy". Well, not so. The script misses a good percentage of the doors, more than 50%. Here is a screen shot of one area after running the script using "!ptwod --convertDoors|page": All of the floors of the lich's tower are on one page. This is one of the floors. All of the doors use the same color regardless of whether the door is supposed to be locked, unlocked or secret. But, the script only replaced one of the doors with the new style doors and left 3 other doors untouched. All of the floors of the tower are pretty much the same - some of the doors got converted, but most didn't. I don't know if the script is still being maintained, and I don't know if changes to Roll20 made parts of it not work well, but I thought I would post this here so that someone can take a look at the problem, whatever or wherever it is. It's a good script otherwise - and is saving me a lot of work. But, it could have saved me a lot more...  Oh, and it might be useful to have a function to convert *this* door if a line representing a door is selected.
1703282951
The Aaron
Roll20 Production Team
API Scripter
My guess is that it only converts single segment lines.  The 3 in the screenshot look like they might be multi segment (certainly, the left one is L shaped).  Probably you'll have to convert some of them by hand.
There were several doors that weren't converted that were single segment lines. And, I'm not sure but I think some that were converted were multi-segment lines. 
1703364965
The Aaron
Roll20 Production Team
API Scripter
In the code it's looking for single segment length (2 points means a start and end only): if (JSON.parse(path.get('_path')).length === 2) { So the multi segments are not going to get converted. For the unconverted single segment lines, it's matching based on color, so if they are a slightly different shade, it won't find them.  It also only looks on the walls layer, or for invisible ones on the map layer.  It could be they are the wrong color or on the wrong layer.   Beyond that, I don't know what the issue could be.