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] UDLWindows -- Dynamic Lighting Paths that block movement but not vision or light. [WARNING: Updated Dynamic Lighting only]

1606067451

Edited 1606068211
The Aaron
Roll20 Production Team
API Scripter
Windows v0.1.0 Thanks to&nbsp; ᐰndreas J. &nbsp;for discovering that Freehand drawings (quadratic Bézier curves) don't block vision but do block movement.&nbsp; This script uses that information to recreate other drawings as optimal Freehand drawings with the same shape, but no light or sight blocking! UDLWindows converts path objects to paths that don't block vision but do block movement. Commands !to-window [--help] --help &nbsp;-- Displays this help Usage Select path objects on the Dynamic Lighting Layer and run the&nbsp; !to-window &nbsp;command. Each of the path objects will get replaced with a version that won't block vision or light, but will block movement. The original objects are removed in the process. This works with poly lines, boxes, and circles. This should be in the 1-click on Tuesday. Github:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/UDLWindows/UDLWindows.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/UDLWindows/UDLWindows.js</a> Support my work on If you use my scripts, want to contribute, and have the spare bucks to do so , go right ahead. However, please don't feel like you must contribute just to use them! I'd much rather have happy Roll20 users armed with my scripts than people not using them out of some sense of shame. Use them and be happy, completely guilt-free! Disclaimer: This Patreon campaign is not affiliated with Roll20; as such, contributions are voluntary and Roll20 cannot provide support or refunds for contributions.
1606068679

Edited 1606069222
Andreas J.
Forum Champion
Sheet Author
Translator
It's fantastic how quickly you created this from to moment I brought it up alongside API interaction. This have probably nice synergy with DoorKnocker, as now it would be easy to create windows, and then just with DoorKnocker open/close the window to let people move through them. Using UDLWindow can also be used to convert larger maps with height differences, and enable to easily block movement between height differences such as between the street and the rooftop of a house. Performance-wise, I wonder if these window-segments impacts Roll20 or UDL performance, if used on a larger scale(compared to regular normal lines).
1606075300
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Almost makes we want to adopt UDL. Almost... I want UDL finished.
I'm pretty sure this is a bug, not a feature.&nbsp; Hopefully token vision and movement will be separated somehow in future design of dynamic lighting page elements.&nbsp; I would love it if there was a way to set a specific color on the dynamic lighting tab to only block light &amp; vision, another to only block movement, and another to block both.&nbsp; Then getting crazy there could be drawn elements that basically have two lines together to create one-way dynamic lighting.
1606077271
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Jarren K. said: I'm pretty sure this is a bug, not a feature. I'd call it an emergent feature, since it fills a useful purpose. That doesn't mean it won't be removed if it gets in the way of something else. :)
1606080346
The Aaron
Roll20 Production Team
API Scripter
Yeah, I'd say it's an emergent feature based on the implementation choices in both the collision system (seems to be based on 2d physics against pixel rendered lines) and vision/light (seems to be based on vector line intersections which ignore Cubic Bézier Curves (circles) and Quadratic Bézier Curves (freehand drawings)).&nbsp; My guess is that it will be here to stay, though we may get a more purpose built replacement in the future.&nbsp; Given my druthers, I'd prefer a means to take individual line segments with blocks sight and blocks movement, and which directions those individually affect.
1606080671
vÍnce
Pro
Sheet Author
All in favor of an "un-mentioned" company hiring Aaron?&nbsp; Salary is unnegotiable. Whatever Aaron asks. ;-P
1606081269

Edited 1606081311
The Aaron
Roll20 Production Team
API Scripter
Hahahahaha!&nbsp; =D For your suggestions, we offer the Suggestions and Ideas Forum... =D
1606083764
vÍnce
Pro
Sheet Author
The Aaron said: Hahahahaha!&nbsp; =D For your suggestions, we offer the Suggestions and Ideas Forum... =D <a href="https://app.roll20.net/forum/post/9522317/please-hire-the-aaron/?pageforid=9522317#post-9522317" rel="nofollow">https://app.roll20.net/forum/post/9522317/please-hire-the-aaron/?pageforid=9522317#post-9522317</a> ;-P
1606085604
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I know it's a joke, but I had a vote lying around...
1606091305

Edited 1606091423
Oosh
Sheet Author
API Scripter
That sounds upside down to me. Can't they just hand him the keys instead? I mean, what if they employ him, then suddenly we've got "Updated Dynamic Aaron" posting busted scripts everywhere? With all that knowledge, if he becomes corrupted... it would be like giving the One Ring to Gandalf.
Is it possible to flip this script to do the inverse: create a light/sight barrier that can be moved through by players?&nbsp;
1606182229
The Aaron
Roll20 Production Team
API Scripter
It isn't. This script exploits a discrepancy between the collision and lighting systems that allows only the collision system to "see" the wall. I've not found a way to do the inverse.&nbsp; That said, you could use one of the teleport scripts to move a token through a dynamic lighting wall, giving you the same effect.&nbsp;
This is great, and I'm almost certainly going to use it. I presume this makes two-way windows?&nbsp;
1607800661
The Aaron
Roll20 Production Team
API Scripter
Correct. It makes lines that can be seen through, but block movement.&nbsp;
help! I converted some paths to windows with this script and now I cannot select or delete it anymore! how do I delete a converted path?
1612803221
The Aaron
Roll20 Production Team
API Scripter
You may need to drag to select the line.&nbsp; If you can't click it, try zooming in all the way, or drag selecting them.&nbsp; You might need to drag select across more than just the window, and then deselect the walls with shift-click.
Zooming in works thanks! I was not able to click it.
This is a fantastic script - thank you! I have spent a good few days evaluating Foundry, since many people rave about how it is so much better than Roll20. But I have come back to Roll20 as, despite some functionality limitations (please stand up, Transmogrifier!) and bugs (I'm looking at you, UDL!), the ease of use is so much better - often thanks to these kind of API scripts (which I find easier to use than Foundry modules), and the ability to find a method of doing what you want to do via these forums. It is thanks to API scripters like Keith, Aaron and many others who keep many people, myself included, from moving away from Roll20. One suggestion for this script, assuming I am not the only one wanting it - if you could set a "destination colour" for the windows to become when they have been converted, then I could draw all my windows in a different colour, and they would automatically change colour when converted, so I could easily know which ones were still to be converted. Maybe as an optional parameter, so people who don't care can just ignore the functionality?
1615306013
The Aaron
Roll20 Production Team
API Scripter
That's a great suggestion and ties in well to some work I was doing to set them as a "glass" color. =D
They mentioned in the community roundtable on the 11th that they're testing a solution for circles to start blocking vision and will push that out at some point soonish.&nbsp; I asked if that rollout would break existing maps currently using circles for windows and they said yes. It was unclear whether that will extend to freehand drawings as well.&nbsp; But worth keeping an eye on.
1615763967
The Aaron
Roll20 Production Team
API Scripter
Yup.&nbsp; I had a chat with Nathanael Winget about it.&nbsp; It shouldn't be a problem for UDLWindows.&nbsp; Circles use the 'C' SVG command for cubic Bézier curves to make a circle.&nbsp; UDLWindows uses the 'Q' SVG command for quadratic Bézier curves, which is what the freehand tool uses and should still show as transparent.&nbsp; I have a version I'll release soon that uses the 'M' SVG command (move-to) which is transparent but is still counted as a wall, which should hopefully future proof against any lines that should start working for DL walls.
1616862603

Edited 1616862810
The Aaron
Roll20 Production Team
API Scripter
&nbsp; Update v0.1.2 -- Changed representation to Multi-Move from Quadratic Bézier Curves.&nbsp; Added --glass option. Changing to the Multi-Move encoding will future proof against the upcoming availability of the Freehand Drawing Tool on the Dynamic Lighting Layer.&nbsp; The script will find all your existing windows and update them to the new format. Added the --glass option which will draw a 5px wide, transparent, blue line on the map layer that shows the window. !to-window --glass If you want to add glass to an existing window, you can just run the command on the existing DL window line and it will add it.&nbsp; If you delete the DL line, it will delete the Glass line as well. UDLWindows v0.1.2 UDLWindows converts path objects to paths that don't block vision but do block movement. Commands !to-window [--help | --glass] --help &nbsp;-- Displays this help --glass &nbsp;-- Draw a transparent blue window line on the map layer Usage Select path objects on the Dynamic Lighting Layer and run the&nbsp; !to-window &nbsp;command. Each of the path objects will get replaced with a version that won't block vision or light, but will block movement. The original objects are removed in the process. This works with poly lines, boxes, and circles. Specifying the&nbsp; --glass &nbsp;argument will create a 5px thick, blue transparent line on the map layer to simulate window glass. The glass line will automatically be removed if the window line on the dynamic lighting layer is removed.
1616875814
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Sorcery!
1616877203
The Aaron
Roll20 Production Team
API Scripter
Just you wait...&nbsp; =D
1616880307
The Aaron
Roll20 Production Team
API Scripter
keithcurtis said: Sorcery! Some real sorcery:&nbsp; <a href="https://app.roll20.net/forum/permalink/9939691/" rel="nofollow">https://app.roll20.net/forum/permalink/9939691/</a> &nbsp; =D
1617204718
The Aaron
Roll20 Production Team
API Scripter
v0.1.2 is now in the 1-click!
1617205002
The Aaron
Roll20 Production Team
API Scripter
Also, it appears the UDL updates from yesterday prevent the exploit we were using from working.&nbsp; That's unexpected and unfortunate. =(
1617801371
The Aaron
Roll20 Production Team
API Scripter
Woot!&nbsp; Windows are working again!&nbsp; Hurray!!!&nbsp; (Thanks Persephone for noticing and thanks to the Devs for making it work!)
Just wanted to say thanks to The Aaron for this! I just added the script to my game and it has been revolutionary to my maps and mapping process. I'm using it for everything from windows, to no go areas of maps, to locking invisible tokens in little boxes for cameras/views of map legends, to simply blocking movement whilst showing off the art that would be hidden by normal DL walls. It's made my maps look and feel more professional and, most importantly, fun to play! You rock!
1620131144
The Aaron
Roll20 Production Team
API Scripter
Sweet!!! &nbsp;Glad to hear it!
I am looking for the torch Api update for UDL is it somewhere?
1623698566
The Aaron
Roll20 Production Team
API Scripter
I haven't released it yet.&nbsp; Last time I was testing with it, it was having issues with UDL that I'm still trying to track down.&nbsp; I'm going to get a bare-bones version of it working for historical reasons, but will then look more into a more comprehensive vision script, as the interface to Torch is pretty narrow when compared to all the options that UDL has.