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

[Script] It's A Trap! v2.3

1463047549

Edited 1463048669
Ziechael
Forum Champion
Sheet Author
API Scripter
Finally had time to test this (using the 3.5e theme) and you sir, are a legend. The passive searching is amazing (I now wonder if there is a way to have it check tokens for a specific status icon and use their search skill instead if they are actively searching?) and the trap json is brilliant :) One thing I've noticed from my testing though is that the fx have stopped working with the 3.5e theme? Also, could i get an example of a trap json that includes use of the trap id and victim id for traps with beam effects?
1463059724

Edited 1463060288
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Scott, TokenCollisions.getCollisions expects a list of other tokens, not just one token. In getDestinations, remove the [0] and it should be fine. Ziechael said: Finally had time to test this (using the 3.5e theme) and you sir, are a legend. The passive searching is amazing (I now wonder if there is a way to have it check tokens for a specific status icon and use their search skill instead if they are actively searching?) and the trap json is brilliant :) One thing I've noticed from my testing though is that the fx have stopped working with the 3.5e theme? Also, could i get an example of a trap json that includes use of the trap id and victim id for traps with beam effects? There isn't currently a way built in to handle taking 20 on a search check. I'll put that on the roadmap for the next version of the 3.5 theme. As for the FX support, version 1.0 (currently available in One-Click) doesn't support FX. Version 1.1 will whenever that gets merged in. You can get it early from here:&nbsp; <a href="https://github.com/Cazra/roll20-api-scripts/blob/3" rel="nofollow">https://github.com/Cazra/roll20-api-scripts/blob/3</a>... There also isn't currently a way to handle beam effects for traps. Since tokens are moved back to the trap's location when they activate it, this would mean that the vector between the victim and the trap would be [0,0,0]. In a future update to ItsATrap, I might support properties for defining an FX offset and a direction vector for beam-like FX.
1463060929
Ziechael
Forum Champion
Sheet Author
API Scripter
That makes sense re: the beam thanks... also figured it might be the version of the theme for the fx too :) As for the search skill use it isn't that much of an issue, I can always fudge their skill accordingly on a case by base basis, the passive spot is a huge help all by itself :)
1463175801

Edited 1463175828
Hello Stephen! First of all thank you so much for your great work. So I just installed its a trap with all its components from the one click API. After i trigger 1 trap, the game automatically says it detected a potential infinite loop and shuts down. I tried everything going as far as making a new game with 100% fresh tokens just to try this out, and always after 1 use it tells me that it is detected an infinite loop. I only have the blood and honor Script installed, and even after completely removing it and not even installing it on my fresh game, it still sends me the same error. I have no other scripts installed.
1463176811
Ziechael
Forum Champion
Sheet Author
API Scripter
Just thought of a change i made to the original script which i can't make with 1-click without losing the auto update function... instead of moving the traps to the token layer i found moving them to the map layer at the front made it easier for GM's, if it was just me then ignore me but thought i'd put it out there :)
1463178944

Edited 1463181036
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Cthulhu said: Hello Stephen! First of all thank you so much for your great work. So I just installed its a trap with all its components from the one click API. After i trigger 1 trap, the game automatically says it detected a potential infinite loop and shuts down. I tried everything going as far as making a new game with 100% fresh tokens just to try this out, and always after 1 use it tells me that it is detected an infinite loop. I only have the blood and honor Script installed, and even after completely removing it and not even installing it on my fresh game, it still sends me the same error. I have no other scripts installed. This script has known conflicts with Blood and Honor. I'd have to take a closer look at Blood and Honor sometime to have any idea why they don't play well together. It could also help to know which trap theme you're using. Ziechael said: Just thought of a change i made to the original script which i can't make with 1-click without losing the auto update function... instead of moving the traps to the token layer i found moving them to the map layer at the front made it easier for GM's, if it was just me then ignore me but thought i'd put it out there :) That sounds like a good suggestion. I'll probably implement that as a user option for which layer to move revealed traps to.
a great script that i use all the time, i was &nbsp;wondering if you are setting it to move to the map layer, or even if not, could you also set ti to remove any status marker&nbsp;added to it?
1463404816
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Jon M. said: a great script that i use all the time, i was &nbsp;wondering if you are setting it to move to the map layer, or even if not, could you also set ti to remove any status marker&nbsp;added to it? The option to move revealed traps to the maps layer and remove its markers is scheduled for version 2.4.
cool thank you
1463807138

Edited 1463807172
Pat S.
Forum Champion
Sheet Author
I know I'm being thick headed but I read the thread and can not figure out something that is probably very simple. I installed the one click "it's a trap v1.23" generic version (no themes) due to using a retroclone system. I'm wanting the trap to be activated from a distance due to the nature of the trap. It is a shrieker mushroom that has an automatic activation range of 10 ft. It works if the token crosses it but I can not figure out the range part. Any one know what I have to do to get that range detection working?
1463851365
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Not sure if this is the best way, but for my laser turret, I just made a token with a transparent center and a red border that covers my trap's range and set that as the trap using the cobweb.
1463852224
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Pat S. said: I know I'm being thick headed but I read the thread and can not figure out something that is probably very simple. I installed the one click "it's a trap v1.23" generic version (no themes) due to using a retroclone system. I'm wanting the trap to be activated from a distance due to the nature of the trap. It is a shrieker mushroom that has an automatic activation range of 10 ft. It works if the token crosses it but I can not figure out the range part. Any one know what I have to do to get that range detection working? Scott's method is the way to do extended trigger ranges for now. In a future version, I might add in support for one of the auras to be used to extend a trap's range.
1463854290
Pat S.
Forum Champion
Sheet Author
Well ok thanks both of you, Scott and Stephan, for the information. I will just go back to the old manual method for now.
1463868708
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It works great Pat, you just name the red token whatever your trap is and it triggers just like it should. No need to go back to the bad old days of having to manually watch out for players crossing a trap.
1463902893
Ziechael
Forum Champion
Sheet Author
API Scripter
The only issue I have with using larger tokens and transparency for trigger range is that the token triggering the trap is sucked into the middle of the trap token, not a huge issue, nor a game breaking one but can be a bit odd with traps that have a large range to them.
1464047989
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Update: v2.4 is now unofficially available. See OP.
1464079416
Ziechael
Forum Champion
Sheet Author
API Scripter
Mmm, those updates look tasty! Loving the evolution :) Will have to have a play around with it later...
1466832107

Edited 1466833020
I seem to be having an issue with the 5e OGL. One of my characters is able to detect traps above their passive perception. &nbsp;For example, he has a passive perception of 16 and is detecting traps up to SpotDC of 21 whenever he walks into a room. &nbsp;Is there something I'm missing here? Any suggestions on how to fix this? Character Sheets used: I've used both the OGL and Community character sheet. Current Scripts: Just "It's a Trap 2.4" and 5e 1.1 EDIT: Problem Resolved- I made him fill out a new character sheet (using OGL) and it fixed the problem.
1466832857
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Jesse K. said: I seem to be having an issue with the 5e OGL. One of my characters is able to detect traps above their passive perception. &nbsp;For example, he has a passive perception of 16 and is detecting traps up to SpotDC of 21 whenever he walks into a room. &nbsp;Is there something I'm missing here? Any suggestions on how to fix this? Character Sheets used: I've used both the OGL and Community character sheet. Current Scripts: Just "It's a Trap 2.4" and 5e 1.1 Short term answer: Temporarily set your trap spot DCs 5 points higher.&nbsp; Long term answer: It's possible that some things in the 5E OGL character sheet got changed around. I'll look into it and see if we can get things fixed up.
Stephen L. said: Jesse K. said: I seem to be having an issue with the 5e OGL. One of my characters is able to detect traps above their passive perception. &nbsp;For example, he has a passive perception of 16 and is detecting traps up to SpotDC of 21 whenever he walks into a room. &nbsp;Is there something I'm missing here? Any suggestions on how to fix this? Character Sheets used: I've used both the OGL and Community character sheet. Current Scripts: Just "It's a Trap 2.4" and 5e 1.1 Short term answer: Temporarily set your trap spot DCs 5 points higher.&nbsp; Long term answer: It's possible that some things in the 5E OGL character sheet got changed around. I'll look into it and see if we can get things fixed up. Short Term: Tried that actually, it required it to be 22+ Long Term: I made him do a new character sheet, to test the issue, everything 100% works.
1466833649
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Jesse K. said: Stephen L. said: Jesse K. said: I seem to be having an issue with the 5e OGL. One of my characters is able to detect traps above their passive perception. &nbsp;For example, he has a passive perception of 16 and is detecting traps up to SpotDC of 21 whenever he walks into a room. &nbsp;Is there something I'm missing here? Any suggestions on how to fix this? Character Sheets used: I've used both the OGL and Community character sheet. Current Scripts: Just "It's a Trap 2.4" and 5e 1.1 Short term answer: Temporarily set your trap spot DCs 5 points higher.&nbsp; Long term answer: It's possible that some things in the 5E OGL character sheet got changed around. I'll look into it and see if we can get things fixed up. Short Term: Tried that actually, it required it to be 22+ Long Term: I made him do a new character sheet, to test the issue, everything 100% works. Oh, glad the new sheet fixed the issue then!
Stephen L. said: Oh, glad the new sheet fixed the issue then! So far, yeah. I'll let you know if I encounter any other issues in the near future and thanks for all of the work on the scripts. &nbsp;They work amazingly well, especially for a group that doesn't have a rogue.
Love this feature, thanks greatly for the work you have done. I seem to be having trouble with the spotdc in the shaped sheet theme. What should happen if the character detects the trap? I have set it as low as one and have never seen anything that looks like the trap is found.&nbsp;
1467941756
Ada L.
Marketplace Creator
Sheet Author
API Scripter
If the character spots the trap, it will be circled with a yellow ring.
I don't see anything. Had a player log in to check as well. Had set the DC to under 10 where the character has a Passive Perception of 16.&nbsp;
1468006609
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Hmm... maybe the sheet got updated recently and screwed things up for the script. I'll take a look at it, but it may be a while because I'm currently out of town with only my phone for Internet.
Thank you. The sheet did an update last week- not sure if this would have been affected. But I have the traps working with regard to sending the trigger message, playing &nbsp;a sound, and having the visual effect on screen. Haven't used it for damage or saves yet, but the spotdc is definitely not working. &nbsp; A week out of town without internet- hope it is a vacation and you are enjoying it!
Not a coder- but went to Github said&nbsp; Gets the passive perception for a character. It is assumed that + * Perception is the 12th skill in the character's skill list. while the Perception ability seems to be the 11th skill
And that might be the problem- the skills for the character seem out of order. Will redo sheet and see if that corrects.&nbsp;
redid sheet- with skills listed in standard order but still not working.&nbsp;
1468415913
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Alright, so I tested things out in my sandbox campaign. The spot DCs for traps appears to be working fine. I set up a character to have a passive perception of varying amounts on a map with traps with spot DCs of varying amounts. When I moved the character within line of sight to the traps, she was able to spot the ones she could with her passive perception. This is using the latest Shaped character sheet and scripts from the One-Click library. Could you post the JSON you are using to set up your traps?
Here you go Stephen.&nbsp; {"fx": "missile-smoke","sound": " Roll20 Axe 1 by Karolek6436 ","spotDC": 15}&nbsp; With this script I get the message from admiral ackbar that the character set off a trap. The fx and sounds work. But no yellow box indicating the trap has been detected.&nbsp;
1468505273
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Gary W. said: Here you go Stephen.&nbsp; {"fx": "missile-smoke","sound": " Roll20 Axe 1 by Karolek6436 ","spotDC": 15}&nbsp; With this script I get the message from admiral ackbar that the character set off a trap. The fx and sounds work. But no yellow box indicating the trap has been detected.&nbsp; I tried using your JSON with the script. Unfortunately, it's still working fine for me and I still couldn't replicate your issue.&nbsp; Do you have any dynamic lighting walls between the token and the trap? That would block the token's line of sight to the trap so it couldn't spot it. Other than that, I'm really not sure why it's not working for you. To get any further, I would probably have to manually debug your game.
1468505646
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I did notice though that the 5E-Shaped theme hasn't been processing FX specified in the JSON, so I'll go ahead and fix that.
You have gone to a lot of trouble. "Manually debug" sounds very time intensive and I don't want to put you through that. &nbsp; Could that rely on a script I don't have? Or does everything come with your script?
Thanks for your help Stephen- I will dig into an figure it out. At least I know the problem is something I am doing or not doing&nbsp;
1468762826
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I don't suppose anyone's made a pathfinder trap theme?
1468771374
Ziechael
Forum Champion
Sheet Author
API Scripter
Scott C. said: I don't suppose anyone's made a pathfinder trap theme? Is it far removed from the 3.5e one? Some minor tweaks to that one might suffice?
1468771899
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, good idea.
1468811971

Edited 1468811992
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Stephen, I have finally implemented a trap theme in my game, allowing the script to truly shine. I did have one question though; is it possible already, or would it be a potential new feature, to change how the victim token is moved. I have several large AOE traps in an area of this campaign and, as Ziechael noted above, tokens being moved to the center of trap is not great for large traps. Is there maybe a way for the script to get the location of the initial trap collision and move the token to that location? Thanks for all your work, Scott
1468816391
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Scott C. said: Hi Stephen, I have finally implemented a trap theme in my game, allowing the script to truly shine. I did have one question though; is it possible already, or would it be a potential new feature, to change how the victim token is moved. I have several large AOE traps in an area of this campaign and, as Ziechael noted above, tokens being moved to the center of trap is not great for large traps. Is there maybe a way for the script to get the location of the initial trap collision and move the token to that location? Thanks for all your work, Scott Not currently, although with some tweaks to Token Collisions script it uses, that could be possible.
1468829703
Ziechael
Forum Champion
Sheet Author
API Scripter
Stephen L. said: Scott C. said: Hi Stephen, I have finally implemented a trap theme in my game, allowing the script to truly shine. I did have one question though; is it possible already, or would it be a potential new feature, to change how the victim token is moved. I have several large AOE traps in an area of this campaign and, as Ziechael noted above, tokens being moved to the center of trap is not great for large traps. Is there maybe a way for the script to get the location of the initial trap collision and move the token to that location? Thanks for all your work, Scott Not currently, although with some tweaks to Token Collisions script it uses, that could be possible. Yey! Alarm traps, gas traps and other such AoE/large based traps thank you (under the assumption that even as you wrote that the matrix was spooling through your mind with the changes required ready for the tweaking ;) )
1468857506

Edited 1468857962
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Obviously I share Ziechael's joy at the prospect of this functionality being added. Another nice feature would be the ability to set a trap's properties so that it doesn't interfere with the character's movement. This would be especially useful for alarms as Ziechael mentioned above, but would also be awesome for those insidious traps that don't actually seem to do anything until later. Traps that lock doors, release a monster further in the dungeon, or cause a mind effect could all benefit from this functionality (and we GM's would benefit from still being able to take advantage of It's a Trap's auto-handling of trap activation). And, of course, if you use a trap theme that allows a json attribute like whisperTrap/secretAct that would cause the whole trap activation dialog to be whispered to the GM then there would be nothing to alert that party of adventurers that chose to charge straight into the dungeon without the barest of perception checks that they are about to die. Mwahahahaha ;)
1468902057

Edited 1468902254
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Good news! The features for stopping tokens at a trap's edge, not stopping tokens, and setting the messages to only be shown to the GM will be in It's A Trap 2.5 (also requires the Token Collisions 1.4 update). Trap JSON will support &nbsp;the following new properties:&nbsp; gmOnly (boolean): If true, then the trap's message is only displayed to the GM. stopAt (string): This is where the trap stops the token. If "edge", then the token is stopped at the trap's edge. If "center", then the token is stopped at the trap's center. If "none", the token is not stopped by the trap. Default: "center". These updates, and my updated trap themes to support the new features are available from this pull request:&nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/pull/314" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/pull/314</a> . Scott, for the trap theme you've implemented, to take advantage of the new features, you just need to use ItsATrap's announceTrap method in place of manually using sendChat. It accepts a TrapEffect object and your trap's post-processed message string as its arguments. This will handle the gmOnly property as well as the properties for FX, sounds, and API commands. stopAt is automatically supported without any change necessary to trap themes.
1468916087
Ziechael
Forum Champion
Sheet Author
API Scripter
Super... Star...! The possibilites to harrass my players are now infinite!!!
1468927472

Edited 1468928015
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, I'm impressed. That was a crazy fast turnaround Stephen. I really just futzed with your 3.5 theme for my pf one, so I'll probably just redo those edits on the new version.
1468945967
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I had most of the math already in place from previous enhancements to the script, which was previously just used for sorting the collisions. So it was pretty quick to implement. :)
1468962051
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Nice, Now that I'm really starting to use the scripts true functionality, I've got a question. How do you use the aura to set an AOE trap? I've got aura 1 set to 20 on my trap token, but tokens aren't triggering it.
1468963956
Ada L.
Marketplace Creator
Sheet Author
API Scripter
The aura determines what tokens are subjected to the trap when it is triggered. To actually trigger the trap, a token must collide with the trap's token.