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

Issues with dynamic lighting

Hello Guys, i have some problems to set up my map with dynamic lighting in the way i wish to. Perhaps someone has an idea what's wrong: My Page Settings look like this: My GM Map shows this (lighting layer, yellow=doors, white=walls): The player has this sight-settings: And he see this (selected token=player): Why the hell is the player seeing those areas in the upper left corner and down there? He shouldn't see anything there, like the room in the upper right corner (has a light source too) or the rest of the map. Anyone an idea what's wrong? (Turning on "fog-of-war" solves the problem, but brings new problems, like seeing nothing until i draw every room to sight like an idiot on a scratch a doodle... :) THX and regards
1498743374
The Aaron
Pro
API Scripter
Can you provide a screenshot of the final image with the dynamic lighting layer active?  Did you rotate or resize any of the lines on the DL layer?  That doesn't actually work, it will retain its former orientation for how it blocks light.  You can run this script and it will fix that if it is the problem: on('ready',function(){     "use strict";     var bounds = function(p){         return _.reduce(p,function(m,p){             m.minX=Math.min(p[1],m.minX);             m.minY=Math.min(p[2],m.minY);             m.maxX=Math.max(p[1],m.maxX);             m.maxY=Math.max(p[2],m.maxY);             return m;         },{minX:Infinity,maxX:0,minY:Infinity,maxY:0});     },     center = function(bounds){         return {             x: bounds.minX + ((bounds.maxX-bounds.minX)/2),             y: bounds.minY + ((bounds.maxY-bounds.minY)/2)         };     },     rotate = function(p,theta){         var b=bounds(p),             c=center(b),             sinT=Math.sin( theta*Math.PI/180.0),             cosT=Math.cos( theta*Math.PI/180.0),             newBounds={                 minX:Infinity,                 minY:Infinity,                 maxX:0,                 maxY:0             },             points =_.chain(p)                 .map(function(point){                     var pointPrime=_.clone(point);                     pointPrime[1]=cosT*(point[1]-c.x) - sinT*(point[2]-c.y) + c.x;                     pointPrime[2]=sinT*(point[1]-c.x) + cosT*(point[2]-c.y) + c.y;                     newBounds.minX=Math.min(pointPrime[1],newBounds.minX);                     newBounds.minY=Math.min(pointPrime[2],newBounds.minY);                     newBounds.maxX=Math.max(pointPrime[1],newBounds.maxX);                     newBounds.maxY=Math.max(pointPrime[2],newBounds.maxY);                     return pointPrime;                 })                 .map(function(p){                     p[1]-=newBounds.minX;                     p[2]-=newBounds.minY;                     return p;                 })                 .value(),             newCenter=center(newBounds);         return {             path: points,             bounds: newBounds,             center: newCenter,             offset: {                 x: newCenter.x-c.x,                 y: newCenter.y-c.y             }         };     };     _.chain(findObjs({ type: 'path',         layer: 'walls'     }))     .filter((o)=>o.get('rotation')!==0)     .each((path)=>{         let details=rotate(JSON.parse(path.get('path')),path.get('rotation'));         let newpath = createObj('path', {             pageid: path.get('pageid'),             fill: path.get('fill'),             stroke: path.get('stroke'),             rotation: 0,             layer: path.get('layer'),             stroke_width: path.get('stroke_width'),             width: details.bounds.maxX-details.bounds.minX,             height: details.bounds.maxY-details.bounds.minY,             path: JSON.stringify(details.path),             top: path.get('top')+details.offset.y,             left: path.get('left')+details.offset.x,             scaleX: 1,             scaleY: 1         });         if(newpath){             path.remove();         }     }) .tap((o)=>sendChat('',`/w gm Fixed ${o.length} Dynamic Lighting paths with rotation.`));          });
1498743386

Edited 1498744167
Using a negative value for the "Start of Dim" can cause problems, so you may want to change that. I do not think that is causing your problem here, though . Nevermind, nothing to see here. Check the light sources and any other tokens in the other rooms the player is not supposed to see. If the player has control of those tokens (in the Controlled By field of the token), they will see what those tokens can see.
1498743452
The Aaron
Pro
API Scripter
Rabulias said: Using a negative value for the "Start of Dim" can cause problems, so you may want to change that.  I've never had an issue with a negative dim number (that I know of...), what kind of problems?
Sorry, I thought I remembered seeing discussion on the forums about folks having some problems with negative values in the vision settings, but I cannot find the posts now. I must have failed my disbelief save. Sorry for any confusion.
Hey, - i tried out the script, but it doesn't change anything (i can see) - i also set start of dim to zero, to be sure, but this doesn't help - i checked the control of light sources and other light emitting tokens, but there is nothing to find - i have seen, if i simulate the players sight as an GM with ctrl/cmd L, anything is fine, no issue Can you provide a screenshot of the final image with the dynamic lighting layer active? I'm afraid im didn't really understand what you are asking (my english isn't that good). the image i posted shows my dynamic lighting layer (yellow doors, white walls) Did you rotate or resize any of the lines on the DL layer Yes, i rotate and resize the dynamic layer lines of the doors, but i did this on all doors and the issue in the upper left corner shows up, but there is no door (so i think that couldn't be the reason)
1498745013
The Aaron
Pro
API Scripter
=D  Still possible there's something I don't know about.  I do have some really slow DL pages... that could be a factor. This is probably either rotated DL lines or tokens with with all player control and has sight.
1498745055
The Aaron
Pro
API Scripter
No worries.  If you want to PM me a join link and GM me, I can take a quick look at it.
1498745518

Edited 1498745559
Hey, thank you but your right at the end: I got it, the source of the issue are the dl-lines of the doors after all. I erased all dl lines of the doors and it works. Now just to have figure out why it sometimes works and sometimes not (i use matt's door script, with your tweeks and i resized all of the lines) Thank you for your help : ) Edit: Lena L. = pale81 (logged in as player)
I tried some things and it seems not to bee an issue of the dynamic lighting line of the door, it seems to have something to do with the door switch. If i move the switch and the switch moves back automatically the lighting issue is gone, until i reload the game.
1498748588
The Aaron
Pro
API Scripter
Hmm.. possibly the door line you setup was rotated, so the script is creating the rotated line?
I don't really know, that could be. Setting up new doors deosn't show any issues...rotating the line like a helicopter, but i can't reproduce the error... I have an eye on that, perhaps i figure it out, what the problem was.
1498750023
The Aaron
Pro
API Scripter
Well, so long as you have it working, great!  Happy Rolling!
Thank you! I figured out that i has an built in laziness protection :) The issue only appears, if you copy a switch and rotate it. If you make a new one from the scratch, you can rotate like a pro and it works anyway. So everything is fine, if you are a hardworking roll20 member : p
1498761801
The Aaron
Pro
API Scripter
Rabulias said: Sorry, I thought I remembered seeing discussion on the forums about folks having some problems with negative values in the vision settings, but I cannot find the posts now. I must have failed my disbelief save. Sorry for any confusion. Hey, it's not just you! &nbsp;Ran across this and it seems there are some issues that have cropped up with negative light sources:&nbsp; <a href="https://app.roll20.net/forum/permalink/5225748/" rel="nofollow">https://app.roll20.net/forum/permalink/5225748/</a>
Hey again,&nbsp; played around a while and figured out, that it has nothing to do with the door script. It must be an issue of roll20 itself.&nbsp; I've set up a new map without any doors, set up the dynamic lightning lines an some light sources on the map layer. I have some rooms the player see from far away and some they don't see. I have no idea what makes the difference.
Very large maps can have issues with dynamic lighting, where players can see areas they shouldn't. At least, I think I've seen that kind of behaviour posted here on the forums before.
1499502923

Edited 1499503033
Thanks for the reply,&nbsp; my fault, I had a treasure in this room, with the door script as open/close api... so it is the damn-door-script-issue not roll20 itself (deleted the switch and everything is fine).