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

1503589136
Ada L.
Marketplace Creator
Sheet Author
API Scripter
If you're not seeing the whispered message, then it has probably cached the information that all of those characters have already attempted to notice the trap using the trap spotter ability. The first time a character with trap spotter comes within 10' of the trap, it will do a perception check. If they fail, then the trap isn't noticed and that character cannot attempt the check again. Try making a new copy of the trap and remove the original. See if you get the whispered messages then.
Thanks for your continued response, but I switch to another map to test, even create a new game to test, trap spotter all have no effect :'(
1503597667

Edited 1503597920
When I change to use the Pathfinder simple sheet, the trap spotter works normally. My previous tests were using Pathfinder sheet (not simple). Maybe the 'class-ability' should be 'ability' or 'abilities' or other name? I can't test my guess, because I don't know how to set the theme... Since I graduated from school, I forgot lot of programing knowledge... lol
1503599442
Ada L.
Marketplace Creator
Sheet Author
API Scripter
In the Neceros Pathfinder sheet you're using, the repeating section is indeed called "class-ability". I've tested this again and Trap Spotter is working for both the Neceros and "Simple" Pathfinder sheets.  How do you have the script installed? It looks like you've got it copy-pasted into your API. The Pathfinder theme script is intended to be installed only through the One-Click API since it relies on options set through the One-Click interface.
1503600019

Edited 1503600113
I am using the One-Click API, because in my test results, I feel the trap spotter function does not work, so I import the API try to figure out.  I previously create a new game, and test Neceros Pathfinder sheet and Pathfinder simple sheet, Neceros sheet's trap spotter still didn't work, but simple sheet works normally. I am also very confused ...
1503600371
Ada L.
Marketplace Creator
Sheet Author
API Scripter
In the One-Click options, did you set the "sheet" drop-down field to "Pathfinder"?
1503601506

Edited 1503601835
Yes, I did, in the Neceros sheet, functions other than trap spotter are working properly.
1503602877
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I noticed that the Class Abilities section of the version of the sheet you're using is different from mine.  Here are some screenshots of things working properly in my test environment. Here's the API set-up for it: Here, I moved the character "Grumpelo_PF" within 10' of a trap using the JSON you gave me. Observe that in the chat is whispered the result of the search. Here's a look at the character sheet and its underlying HTML. The version of the character sheet I'm using is the latest from the One-Click system. Observe that my version has "class-ability" as the name of the repeating section. Please confirm that the version of the sheet you're using has the same name for this repeating section.
1503634123

Edited 1503636520
I think I found the problem, your title is Orig Class Feature, means that field is generated by the old version sheet in the new version sheet. You click upper + sign in your screenshot&nbsp;to add a new ability, and check the new ability field, I think it should be the same field as mine. Or you can create a new character and check the field. Here is another screenshot. <a href="http://imgur.com/a/5g1F9" rel="nofollow">http://imgur.com/a/5g1F9</a>
1503669714
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Ah... Somehow I never noticed that. Ok, so I'll modify the theme then to provide support for both repeating sections.
1503670679
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I've modified the script to support both repeating sections. The fix will become available when it is merged into the Roll20 API repository.
Thank you again!
D&D 5e question: I am sure this is me setting my traps up wrong but I cannot figure out why the traps are deactivating when they are spotted.
1503724063
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Theodore S. said: D&D 5e question: I am sure this is me setting my traps up wrong but I cannot figure out why the traps are deactivating when they are spotted. Traps are only activated if they are on the GM layer.
OK. What is the difference between paths and self for activating? I am trying to set a hidden door trap that only 1 player can spot (using passive) but I don't want it to be visible until the character is next to it. How would I set the paths to work at 5 feet away, it will be revealed and activated?
1503881837
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Theodore S. said: OK. What is the difference between paths and self for activating? I am trying to set a hidden door trap that only 1 player can spot (using passive) but I don't want it to be visible until the character is next to it. How would I set the paths to work at 5 feet away, it will be revealed and activated? Self will activate the trap when a character moves through the trap token's space. Paths will activate the trap when a character moves through the path(s) selected for the trap, but only tokens overlapping the trap token's area will be affected. If you want players to be able to notice it with passive perception only within 5 ft of it, set the trap's Max Search Distance property to 5.
Stephen L. said: Theodore S. said: OK. What is the difference between paths and self for activating? I am trying to set a hidden door trap that only 1 player can spot (using passive) but I don't want it to be visible until the character is next to it. How would I set the paths to work at 5 feet away, it will be revealed and activated? Self will activate the trap when a character moves through the trap token's space. Paths will activate the trap when a character moves through the path(s) selected for the trap, but only tokens overlapping the trap token's area will be affected. If you want players to be able to notice it with passive perception only within 5 ft of it, set the trap's Max Search Distance property to 5. Is there a readme or something explaining how paths work with It's A Trap? I am still trying to get the hang of APIs as it will take alot of the guess work out of setting off traps, AOEs, etc. I am using quite a few of your APIs and have most of them figured out except for all the ins & outs of It's A Trap.
1503931903
Ada L.
Marketplace Creator
Sheet Author
API Scripter
The readme is shown on the script's tab on the API Scripts page for your game if you installed it through One-Click. You can also view the readme on the script's Github page:&nbsp;<a href="https://github.com/Roll20/roll20-api-scripts/blob/master/Its%20A%20Trap/README.md" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/blob/master/Its%20A%20Trap/README.md</a>
found out both my previous erros were due to user error :P my bad&nbsp;
Is there a way to put the target's token name, the character who triggered the trap, in the message? Within a macro/script, I would use @{target|token_name} but that is messing with the JSON and removing the curly braces. I tried escaping the braces with a \ but that ends up throwing an error in the console. When setting the message, I also get the following error in the console:&nbsp;"ERROR: Unable to find character target in chat command." Preferably looking for something like this in the message when the trap is triggered "@{target|token_name} is attacked out of the darkness" (I'm using the script to trigger an attack from a hiding creature)
1506914764
Ada L.
Marketplace Creator
Sheet Author
API Scripter
It already does this for any characters affected by the trap's area. See the "Target" field that shows the character name. If there isn't a creature in the trap's blast area, then the trap will be announced but no one will be affected.
1508017432

Edited 1508017916
Hey! I'm having a problem with It's a trap! API script with the OGL 2.0 sheet. So, i setup a simple trap, what i'm finding is now when a token "springs" the trap, the script is incorrectly calculating the save DC. I've put the attributes variables in the It's a trap! D&D 5e Generic one-click variable page. I believe the variables was recently updated for version 2.0 of the sheet, i'm using&nbsp;@{dexerity_save_bonus} for the&nbsp;The name of the Dexterity save modifier attribute. I get 1d20 + undefined number in the DC roll messaged to me when i hover over the DEX SAVE DC number.. See below: I noticed that it it might be rolling still under the DC15... where is this defined? I tried to see the script itself, but i can't since it was installed via the script library in roll20. thanks!
1508160454
Ada L.
Marketplace Creator
Sheet Author
API Scripter
If you're using the OGL sheet, you should just select "ogl" from the "sheet" drop-down field. This will automatically figure out the names of the attributes to use. If you need to provide the attribute names manually, enter them in as "attribute_name" instead of as "@{attribute_name}".
Yeah, i have always set the sheet to "ogl" under the customization options. However, it has never auto populate those fields, so i assumed i needed to add them. Are they being added in the background?&nbsp; &nbsp;Thanks for the suggestion.
1508168371
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Yes, they are added in the background. The fields are only there for if you choose "none/custom" from the drop-down list. I'm sorry this is confusing, but with the current way that the One-Click installer system works, there is no way for me to hide those fields if anything other than none/custom is selected.
Ok, i removed all the variables under the customization, and i reloaded the api sandbox. However, in testing again, it still shows that field as "1d20+ undefined".&nbsp; Maybe this isn't a problem at all, and it just peeked my curiosity as being one.
1508171227

Edited 1508171377
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I think I see what the issue is. You have the trap set up to both do an attack against AC and do a Dex save. The script isn't built to support both being used at the same time. If you have a trap that makes an attack and requires a save, I would try setting it up as separate traps for the attack and save components. Whenever I have time again to update the script, I'll make it so that it'll yell at the user if they try to make a trap with both an attack and a save.
ahhh&nbsp; ok. Thanks! I'll make the changes.
I'm in the process of building a system of hidden switches in the dungeon for the players to find. My only, and rather small, issue is that the switches need to be on the token layer in order to be activated and that the rather small switches still have the cobweb status symbol on them when revealed. Is it possible to change this in some easy way so that the revealed switches appear clean?
1509324740
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Ravenknight said: I'm in the process of building a system of hidden switches in the dungeon for the players to find. My only, and rather small, issue is that the switches need to be on the token layer in order to be activated and that the rather small switches still have the cobweb status symbol on them when revealed. Is it possible to change this in some easy way so that the revealed switches appear clean? Not currently. You'd have to manually remove the cobweb status after they are revealed.
Got it. Thanks a lot Stephen, I still find new ways to use this script and both me and my players love it.
Just started to test this script for my own game and the creation macro is showing up in the character specific macros.&nbsp; My player who helps me test stuff is busy, so i dont&nbsp; know if this is a mebonly problem
Athedia said: Just started to test this script for my own game and the creation macro is showing up in the character specific macros.&nbsp; My player who helps me test stuff is busy, so i dont&nbsp; know if this is a mebonly problem Do you mean that it show up as a token action? Cause in that case you can unclick that box when editing the macro.
1509832589

Edited 1509833083
Ravenknight said: Athedia said: Just started to test this script for my own game and the creation macro is showing up in the character specific macros.&nbsp; My player who helps me test stuff is busy, so i dont&nbsp; know if this is a mebonly problem Do you mean that it show up as a token action? Cause in that case you can unclick that box when editing the macro. Duh, thanks, I am an idiot
If it helps I only knew that cause I made the same mistake. :D Happy rolling!
1510292366

Edited 1510292678
Well I wanted to setup passive perception somehow. Even though I use a custom system. I thought perhaps I could setup a perception score and use the pathfinder for use with no character sheets. But, I can't find documentation to save my life on how passive perception or even pathing work s on either of those scripts.&nbsp; Figured out Pathing...I think....Not sure. Now, how does passive perception work? Is there a read-me that explains how this works? The documentation is lacking for people that want to setup without character sheets. I just can't find it anywhere. And its NOT in the one-click read-me.
1510322171

Edited 1510325274
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Paul M. said: Well I wanted to setup passive perception somehow. Even though I use a custom system. I thought perhaps I could setup a perception score and use the pathfinder for use with no character sheets. But, I can't find documentation to save my life on how passive perception or even pathing work s on either of those scripts.&nbsp; Figured out Pathing...I think....Not sure. Now, how does passive perception work? Is there a read-me that explains how this works? The documentation is lacking for people that want to setup without character sheets. I just can't find it anywhere. And its NOT in the one-click read-me. Passive perception is only supported for systems that have a trap theme script implemented for them. You'll have to implement your own trap theme for your custom system. Normally the way that you would set up passive perception with a supported trap theme script is by setting the "Spot DC" field from the theme-specific trap properties. Then as long as a character's passive perception stat is &gt;= the Spot DC, they'll notice the trap.
Okay Say I want to give the player a passive perception check, like using the Pathfinder one says it supports just the basic attributes. Do they need a Perception stat or a passive perception attribute?
1510327933
Ada L.
Marketplace Creator
Sheet Author
API Scripter
You would need the characters to have a perception modifier attribute. The script uses that to calculate the actual passive perception. Also, in the script's One-Click options, be sure to check the "enablePassivePerception" checkbox since by default Pathfinder doesn't actually have passive perception.
So name the attribute "Perception Modifier" ?
1510342084
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Not exactly. In the One-Click options, there should be a "perceptionModifier" field that is used if you have the "sheet" field set to "custom/none". Set that to whatever the name of your perception attribute is.
1510697987

Edited 1510758209
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Update: v3.7 (pull request pending) Paths can now be used as the activation areas for a trap. This supports both lines and polygons (requires fill color). Passive search will notice activation paths for traps. You can now set traps to be destroyed after they are activated. This is toggled with the "Destroyable" property. <a href="https://github.com/Roll20/roll20-api-scripts/pull/" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/pull/</a>...
1510746091
Ziechael
Forum Champion
Sheet Author
API Scripter
Nice changes... can't wait to have a play :)
1510760053

Edited 1510845973
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Added one more update to it.&nbsp; The API Command property now allows multiple API commands. Each command should be separated by ";;". EDIT: Also got an update for the Pathfinder and D&D 3.5 trap theme. Pathfinder and D&D 3.5 traps can now make touch attacks. To do this, set the "Attack Vs" property to "touch AC".
1512746318
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Patch v3.7.1 (pull request pending) Fixed a bug causing default tokens dropped to the VTT from characters to sometimes trigger traps. New tokens now have a 1-second delay before they can interact with traps. Fixed a bug in the Pathfinder trap theme causing Trap Spotter to work for only the first character who uses it on a trap. <a href="https://github.com/Roll20/roll20-api-scripts/pull/" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/pull/</a>...
1512751801
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Update: Created Starfinder trap theme (pull request pending) This theme supports traps for both characters and starships. Get it from beta here:&nbsp; <a href="https://raw.githubusercontent.com/Cazra/roll20-api" rel="nofollow">https://raw.githubusercontent.com/Cazra/roll20-api</a>... For it to work outside of One-Click, you'll also need to add in this little script to set up some configurations: on('ready', () =&gt; { &nbsp; &nbsp; state.itsatrapthemestarfinder = { &nbsp; &nbsp; &nbsp; &nbsp; useroptions: { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sheet: 'Starfinder Simple', &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; kac: 'kac', &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; eac: 'eac', &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; fortSaveModifer: 'fort', &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; refSaveModifier: 'ref', &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; willSaveModifier: 'will', &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; perceptionModifier: 'perc', &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; acm: "acm", &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; starshipAC: 'starshipAC', &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; starshipTL: 'starshipTL', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enablePassivePerception: "1" &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; passPercAttempts: {} &nbsp; &nbsp; }; &nbsp; &nbsp; globalconfig.itsatrapthemestarfinder = undefined; &nbsp; &nbsp; log('TEST - mocking up globalconfigs for ItsATrap SF Theme.'); });
Thanks Stephen.&nbsp;
1512835612
Ada L.
Marketplace Creator
Sheet Author
API Scripter
You're welcome! ^__^