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

Is there a way to add wall/barrier dynamic lighting to tokens?

The dynamic lighting layer seems to be it's own layer, not tied to any map or token. This means if I want to incorporate multiple images on a given map, they all share the same dynamic lighting layer. There are a lot of maps with multiple layers that aren't easily implemented. You can always make a new map, but for corkscrew maps , that isn't a great solution. Probably the simplest example of this is a roof. If you have a building with walls and you have a roof token that you move "To Front", you only see the roof outside the walls, or after the interior has been explored. 
1701719217

Edited 1701719285
Gauss
Forum Champion
Hi Wyrmwood,  If I understand you correctly you have a map image that includes the exterior of buildings, and a map image that includes the interior of buildings. You want to switch between them?  Usually I would set this up side-by-side so that you can switch over to the interior.  Since you have a pro account I would use a teleporter script for the external-internal doorways and windows so that when someone moves from outside to inside their token moves over to the interior map. 
1701719741
The Aaron
Roll20 Production Team
API Scripter
Here's a simple script I created for this purpose: Select the graphic and run: !dl-link Then go to the lighting layer and select the lines and run: !dl-link Then when you move the graphic, it will move the DL with it.  Supports rotation as well. Code: on('ready',()=>{ const scriptName = 'DLLink'; const version = '0.1.0'; const schemaVersion = 0.1; const lastUpdate = 1662075424; let pendingToken; const checkInstall = () => { log(`-=> ${scriptName} v${version} <=- [${lastUpdate}]`); if ( !state.hasOwnProperty(scriptName) || state[scriptName].version !== schemaVersion ) { log(` > Updating Schema to v${schemaVersion} <`); switch (state[scriptName] && state[scriptName].version) { case 0.1: /* break; // intentional dropthrough */ /* falls through */ case "UpdateSchemaVersion": state[scriptName].version = schemaVersion; break; default: state[scriptName] = { version: schemaVersion, options: {}, links: {} }; break; } } }; checkInstall(); on('chat:message',msg=>{ if('api'===msg.type && /^!dl-link(\b\s|$)/i.test(msg.content) && playerIsGM(msg.playerid)){ let who = (getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname'); let objs = (msg.selected || []) .map(o=>getObj(o._type,o._id)) .filter(g=>undefined !== g) ; objs.forEach(o=>{ if('graphic' === o.get('type')){ pendingToken = o; } else if('path'=== o.get('type')){ if(pendingToken){ state[scriptName].links[pendingToken.id] = [...(state[scriptName].links[pendingToken.id]||[]), o.id]; } } }); } }); on('change:graphic', (obj,prev)=>{ let s=state[scriptName].links[obj.id]; if(s){ let dR = obj.get('rotation')-prev.rotation; let dX = obj.get('left')-prev.left; let dY = obj.get('top')-prev.top; s.map(id=>getObj('path',id)) .filter(g=>undefined !== g) .forEach(p=>p.set({ rotation: p.get('rotation')+dR, left: p.get('left')+dX, top: p.get('top')+dY })); } }); });
1701721461
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
There also used to be a roofs script, where you could an image lines to a trigger square, and if the token moved to that square, it would move that image to the DL layer. So you could go to a "door" and the roof would disappear.
Great suggestions, thank you all!
Gauss said: Hi Wyrmwood,  If I understand you correctly you have a map image that includes the exterior of buildings, and a map image that includes the interior of buildings. You want to switch between them?  Usually I would set this up side-by-side so that you can switch over to the interior.  Since you have a pro account I would use a teleporter script for the external-internal doorways and windows so that when someone moves from outside to inside their token moves over to the interior map.  Thanks! This is an excellent solution for the corkscrew maps! Also handy for stairs between maps, although, strictly speaking, I think it may be slower than just copy/ pasting the tokens, but I'll check it out in gameplay. 
The Aaron said: Here's a simple script I created for this purpose: This works when the token is on the token layer, but not for a map token - well, it kind of works, but the wall moves further than the map token. Anyway, still seems useful. I'll keep playing with it. 
1701966363
The Aaron
Roll20 Production Team
API Scripter
It's a pretty simple one-off script I threw together for one of my games, so there may be some strange behavior.  If you get a reproducible case let me know.  It doesn't know how to deal with resizing graphics, so if you're doing that it might behave strangely.  I'm working on a much more comprehensive version of this now...
All hail The Aaron, I have wanted something like this for a long time. A huge creature should block the light. I am looking forward to this week, when the big bad's pet steps aside to reveal it's much more lethal owner. I think for a really big monster this is great. I did an oval of one way DL line in the center mass of a huge token and linked them. the effect is amazing.