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] Problem with It's a trap script

Hi, I found an issue with "It's a trap" script (5e ogl generic). When I set up a trap on a map if I put a new token (monsters, objects, player heroes etc) on the tabletop the trap triggers and the token is pulled to his center. Yesterday i had my traps discovered by my players this way, and it was bad :D
1507508875
The Aaron
Pro
API Scripter
This probably is more of “an unfortunate side-effect” than an error. The API has no way of identifying who manipulates a token, so it doesn’t know to not activate when you create/move a token as the GM. Hopefully Stephen L. has a solution for you. 
I think I've understood the reason beyond the strange traps behaviour. Probably it was due to the big cage token upon traps. I don't know how the program manage the new tokens you put on the tabletop in real-time, but I'm sure the problem was there. It's like the cage token is detected just when I put new tokens on the map. I moved the cage (highlighted in yellow) on the tokens layer and flag the "wings" symbol on it to not trigger the traps (marked in red). Now everything seems fine. 
1507657219

Edited 1507657245
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I'm not sure what you're saying the issue is here. Are you saying that any time you place a token anywhere on the map the trap triggers? I can't really tell what's going on in that screenshot there.
I've seen this happen when I'm dragging tokens onto the map with set traps but I can't duplicate it now; I thought  it only occurred if I dragged the tokens across the trap area so I've been careful to not do that, but like I said; I can't duplicate this right now.
Stephen L. said: I'm not sure what you're saying the issue is here. Are you saying that any time you place a token anywhere on the map the trap triggers? I can't really tell what's going on in that screenshot there. If you look at the screenshot down here you can notice some traps I previously set up and a big cage (I draw a dotted red line to make it easy to see) token. I put the cage and the traps both on GM layer with the idea of imprison the players under the cage (switching it to the map layer to make it visible). One of my player launched light spell and put a token to represent the spell on the board (with light radius etc). The light token automatically triggered one of the trap. I'm quite sure that this is due because the cage token was on the same layer (GM layer) as traps overlapping with them. I did some experiments putting alernatively traps and cage token "to back" and "on top". Traps activate in an unpredicatable way. Hope my explanation is more clear now.   
1507667546
Ada L.
Marketplace Creator
Sheet Author
API Scripter
So effectively when your player creates a light spell overlapping the cage trap, it triggers all of the traps?
No, it triggers a random one.  
Ok I've done some experiments and I discovered that sometimes traps trigger even if I totally remove the cage token. I've noticed even that this happens only if I put the new tokens on the board directly on token layer. If I put new tokens on GM layer and then switch to token layer traps don't activate in that strange way.
1507755146

Edited 1507755684
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I've been trying to replicate your issue for the last few days using the information you've given me about the problem. Dropping tokens onto a map with some traps works fine for me. At this point, I don't know why it's not working for you. Could you provide the GM Notes for the trap tokens? Do the traps trigger normally if you move existing tokens over them?
Stephen L. said: Could you provide the GM Notes for the trap tokens? {"message":"Una scossa elettrica attraversa il tuo corpo","notes":"Danno doppio per chi indossa armature di ferro o acciaio","sound":"Electric Shock","damage":"3d8","missHalf":true,"hideSave":true,"save":"dex","saveDC":12,"revealLayer":"objects"} Traps trigger normally when I move existing tokens over them. 
1507813454

Edited 1507823800
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I tried using the GM Notes data to test it out. Unfortunately, I still couldn't replicate your issue. I've tried setting the traps up in all sort of different places, but each time I try and drop a random token onto the map, it doesn't trigger any traps. Sorry, but if I can't find a way to reliably reproduce your issue, then I won't be able to track it down and fix it. I would be curious to know if anyone else has had this issue and knows a reliable way to reproduce it. For now I'll log this thread as a known issue in the main script thread for future reference.
I had this issue happen to me last night, but I haven't had a chance to fully test it.  It only happened once - the first time I dragged a character into the playfield from my journal.  It triggered the last trap that I had placed, which was on the GM layer and ready for players to run into.
1512583187
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Got some good news. I've found a way to consistently reproduce this issue in my test campaign. So, I'll be able to look into fixing it sometime soonish.
1512746579

Edited 1512746647
Ada L.
Marketplace Creator
Sheet Author
API Scripter
This issue is now fixed in beta. It will take a few days before it gets merged into the One Click library, but you can get the latest script manually from here: <a href="https://raw.githubusercontent.com/Cazra/roll20-api" rel="nofollow">https://raw.githubusercontent.com/Cazra/roll20-api</a>...