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 Paths and Rotation

1454103033

Edited 1454103144
I have a script I'm working on that links a path on the dynamic lighting layer to a token with the goal of making door tokens interact with the dynamic lighting layer in a simpler way. The nitty gritty of the script isn't too important, because it links and rotates objects together just fine. My problem is that when I rotate a path on the Dynamic Lighting Layer in accordance with it's parent token on the Token Layer, the game's Dynamic Lighting doesn't recognize the path's rotation (the mask moves to the right spot, but doesn't rotate to match the rotation of the path). I have a screenshot to help explain it. The red bar on the left is the path from the Dynamic Lighting Layer. It started in the 12'o'clock position (right below the token "S'ken", and was rotated along with the door to the 9'o'clock position. While the path looks correct on the Dynamic Lighting Layer, you can see that the Dynamic Lighting still treats it as if it was never rotated. Any ideas on a workaround? Is there a way to resolve a rotated path to non-rotated coordinates, or enable path rotations in the Dynamic Lighting engine? (Note: My current workaround is to 180 the door into the wall, but that isn't ideal (door should hide part of the room).
1454104404
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="https://app.roll20.net/forum/post/1746279/script-d" rel="nofollow">https://app.roll20.net/forum/post/1746279/script-d</a>... What you need is likely in that script.
1454104814
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Here is a gist to the important parts..... <a href="https://gist.github.com/BaldarSilveraxe/ed2228eb8ad237990e20" rel="nofollow">https://gist.github.com/BaldarSilveraxe/ed2228eb8ad237990e20</a>
1454105585

Edited 1454106749
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
path = rotated_flipPaths({ left: 175, top: 175, width: 280, height: 280, rotation: 35, fliph: false, flipv: true, path: [[140,0],[280,280],[0,280],[140,0]] }); You are going to pass it something like that... should be a rotated triangle. The real trick is you have delete the path and rewrite it... I have found the putting the graphic ID in the controlledby for the path object is the best way to go (the controlledby for path can only be changed by API.) But you can do a lot of cooll stuff with it.
1454105830
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
And its very smooth....&nbsp;
1454113331

Edited 1454113859
I'll do some digging through the code. Any chance there's a resource somewhere with notes on the functions etc? Takes considerably longer to fully understand a function without any //notes. Edit: It looks great, btw!
1454113560
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Sent you a PM
Can I use this script to simulate opeing a door on the map so that the players can see into the next room?
1454886879
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Yes. Some examples of that in use can be found in these scripts: Dungeon Connect Dungeon Ready Dungeon Draw Dungeon Mapper Each of these scripts have their good points and bad points and they all have an common draw back (I would say more, but can't ATM.) ANYHOW.... you can install them and play with the scripts (sample tiles are provided with the scripts) they each have doors script within them. Tear them apart... keep what you like. I actually have found a new approach to making tiles, working to complete the script, should support tiles in a way we haven't before.