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

[HELP, SCRIPT] It's a trap, trigger area paths showing on object layer when trap is activated

I am setting up a Giant Spider as a trap in a cave system.  I have drawn 2 lines/paths at the entrances to the room.  When the trap is triggered, the 2 paths I drew also moved to the same layer as the spider token (object layer in this case).  Is there a way to NOT have them appear, or to have them change to transparent?  I know I can draw them with a transparent "color", but then even I can't see them :)
1641727533

Edited 1641730789
Finds
API Scripter
I suspect this is on purpose so that a path doesn't remain on the GM layer and continue to trigger an already triggered trap, at line 556 you see a function for this purpose in the script. The trick I always used was to change them to black and hide them in the grid lines of the map. That being said you can achieve turning your trigger path transparent by adding this line "path.set('stroke', 'transparent');" into the below function. Original Function @ Line 556 function _revealTriggers(trap) { let effect = new TrapEffect(trap); let layer = 'map'; let toOrder = toFront; if(effect.revealLayer === 'objects') { toOrder = toBack; layer = 'objects'; } if(effect.triggerPaths) { _.each(effect.triggerPaths, pathId => { let path = getObj('path', pathId); path.set('layer', layer); toOrder(path); }); } } Modified Function function _revealTriggers(trap) { let effect = new TrapEffect(trap); let layer = 'map'; let toOrder = toFront; if(effect.revealLayer === 'objects') { toOrder = toBack; layer = 'objects'; } if(effect.triggerPaths) { _.each(effect.triggerPaths, pathId => { let path = getObj('path', pathId); path.set('stroke', 'transparent'); path.set('layer', layer); toOrder(path); }); } }
Darryn said: I am setting up a Giant Spider as a trap in a cave system.  I have drawn 2 lines/paths at the entrances to the room.  When the trap is triggered, the 2 paths I drew also moved to the same layer as the spider token (object layer in this case).  Is there a way to NOT have them appear, or to have them change to transparent?  I know I can draw them with a transparent "color", but then even I can't see them :) I made them transparent back when I used the trigger system in its a trap but I found that this script does not work right for RAW dnd.  You are purposely screwing over people with devilsight and people with advantage perceptions as the 5e OGL sheet does not account for this nor does it properly account for the trap being in darkness or dim light.  I found it far more fair and right to just have a key with a snap check of their passives and doing the calculations in the moment and triggering the traps manually with a key like: ?{Say What Now?|Setup,!ItsATrap_trapCreationWizard_showMenu|Activate,!itsATrapRemoteActivate @{selected|token_id}} Its a great script on paper, but in practice you are severely perverting the passive system by using the auto trigger system in it.  I just use it to store prefab traps to fire manually nowadays.  
That may be true and something I had not thought of, but the groups I play in pretty much ignore the "Darkvision = Dim Light = Lightly Obscured" anyway so it is not that big of a deal.  And if they have something that would give them advantage on Passive Perception, I just update the character sheet to reflect that.  We use DND Beyond as our character sheets anyway, so I only pull small details into the Roll20 sheets for my reference. I like the idea of Transparent lines, or black lines that align with the grid.  I'll give those a try.  Thanks everyone DM Eddie said: Darryn said: I am setting up a Giant Spider as a trap in a cave system.  I have drawn 2 lines/paths at the entrances to the room.  When the trap is triggered, the 2 paths I drew also moved to the same layer as the spider token (object layer in this case).  Is there a way to NOT have them appear, or to have them change to transparent?  I know I can draw them with a transparent "color", but then even I can't see them :) I made them transparent back when I used the trigger system in its a trap but I found that this script does not work right for RAW dnd.  You are purposely screwing over people with devilsight and people with advantage perceptions as the 5e OGL sheet does not account for this nor does it properly account for the trap being in darkness or dim light.  I found it far more fair and right to just have a key with a snap check of their passives and doing the calculations in the moment and triggering the traps manually with a key like: ?{Say What Now?|Setup,!ItsATrap_trapCreationWizard_showMenu|Activate,!itsATrapRemoteActivate @{selected|token_id}} Its a great script on paper, but in practice you are severely perverting the passive system by using the auto trigger system in it.  I just use it to store prefab traps to fire manually nowadays.