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

Dynamic Lighting API?

1714486786
Essen
Pro
Marketplace Creator
Any API that give Dynamic Lightning more options? I would love to have transparent, one-way movement lines for cliffs. That way I can wall off the cliffs for one-way movement, locking players in, but people can still see past the drop on the other side.
1714496868
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Isn't that just a one way wall? It blocks movement from either side, but allows you to see through it in one direction. Or do you mean that a player could move their token from top to bottom of cliff, but not bottom to top? I don't think the latter is possible manually, or that there is a script that does this. If I am still not getting it, can you provide a visual example? To answer your larger question, there are a couple of Mod Scripts that allow you to automate or simulate other DL features, but nothing that adds anything that could not be done manually. The Darkness script for instance provides a movable field of darkness centered on a token. There were some older scripts that allowed for windows and one way walls, but those were obsolete once those features materialized in the modern DL system.
1714506549
Essen
Pro
Marketplace Creator
I would like a wall that can be seen through both ways, but only moved through one way. What I would really love is for movement and vision to both have "solid/one-way/empty" drop downs, which seems like an elegant solution to all the different DL combinations people could be using. I haven't found any API that give me sort of flexibility I've been looking for.
1714539863
Lithl
Pro
Sheet Author
API Scripter
There is no API that I'm aware of to achieve what you're looking for, but it is possible to have the API handle DL collisions instead of using the standard page setting to have DL lines block movement. You might get a brief glimpse at the far side of a wall before the script corrects the token's position, and if the script crashes everyone can just noclip through the map, and it'll probably be much more inefficient. But it's possible . With a little bit of vector math, you can determine which side of a line that a point lies on, which will allow you to determine whether the token is on the sight-blocked side of a one-way wall or not, and thereby in your script allow it to pass through the wall or collide with it. Creating such a script is left as an exercise for the reader (ha!), however I will point to the very old script  Collision Detection  which performs token-wall collisions as a starting point. It creates an imaginary line between a token's previous position and its new position, and finds the point at which that line intersects with the imaginary line created by two adjacent points along the DL wall polyline. If the intersections of those two infinite lines is both between the two polyline points and also between the two token points, then the token has collided with the wall.
1714571311
Essen
Pro
Marketplace Creator
Thanks for the intel. I want to learn how to make things like this at some point, but significantly above my level of expertise right now.