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

Stephen L. said: I don't currently have a trap theme for the Vampire the Masquerade system to support passive perception. If you could provide a good description of the rules for how traps and passive perception work in the system, then I might be able to make one. Vampire does not have any passive Perception. It does have attributes and skills such as Perception, Alertness, Investigation. A passive Perception to me would be something like the character's Perception + Alertness added together or something like that. I would just assign the value to an Attribute on their character sheet that I think the mod would use.
1493994666

Edited 1494000004
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Xargun said: Stephen L. said: I don't currently have a trap theme for the Vampire the Masquerade system to support passive perception. If you could provide a good description of the rules for how traps and passive perception work in the system, then I might be able to make one. Vampire does not have any passive Perception. It does have attributes and skills such as Perception, Alertness, Investigation. A passive Perception to me would be something like the character's Perception + Alertness added together or something like that. I would just assign the value to an Attribute on their character sheet that I think the mod would use. So, for the purpose of handling rules for passive perception, should I assume that if a character's Perception and Alertness are both integers, and if their sum is greater or equal to the trap's passive perception DC, then the character should spot the trap?  How about rules for how traps make attacks against characters that activated them? Could you also explain how that would work? I'm not familiar with the Vampire: The Masquerade system, so, I need to know about these rules before I go implementing a trap theme for it.
Stephen L. said: Xargun said: Stephen L. said: I don't currently have a trap theme for the Vampire the Masquerade system to support passive perception. If you could provide a good description of the rules for how traps and passive perception work in the system, then I might be able to make one. Vampire does not have any passive Perception. It does have attributes and skills such as Perception, Alertness, Investigation. A passive Perception to me would be something like the character's Perception + Alertness added together or something like that. I would just assign the value to an Attribute on their character sheet that I think the mod would use. So, for the purpose of handling rules for passive perception, should I assume that if a character's Perception and Alertness are both integers, and if their sum is greater or equal to the trap's passive perception DC, then the character should spot the trap?  How about rules for how traps make attacks against characters that activated them? Could you also explain how that would work? I'm not familiar with the Vampire: The Masquerade system, so, I need to know about these rules before I go implementing a trap theme for it. Vampire (or any World of Darkness Game) uses d10 for everything. Instead of a high number you need a number of successes to succeed. The normal difficulty is a 6. So detection of a normal trap would be Perception & Alertness (difficulty 6) with a minimum of 3 successes (3 dice of 6+). If they were searching for traps it would be Perception & Investigation (with possibly a lower difficulty). (Combat is a bit confusing if not explained - and I'm sure I'll do a poor job - much better over voice) Attacks for a mechanical trap would be Dexterity & Melee to hit - then the target gets to Dodge the attack with Dex & Dodge. If the attack still succeeds then the trap would roll damage (Strength plus bonus for weapon). Then the player rolls Soak - there is no 'Armor Class' like in many other games and everything is decided by opposing die rolls. But my question is basically (instead of you making a specialized version for World of Darkness) is if I make static attributes for each character will the script still work ?  I am mostly interested in the part of the script where they auto detect a trap or auto trigger one. If I have to roll a few extra die for damage and such that is fine by me.. I just want to be able to allow them to move around freely and what happens happens....
1494336267

Edited 1494336301
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Auto-detection would only work if there were a trap theme to support the system. That feature doesn't work with just the It's A Trap script by itself. Can you explain how Soak works?
Stephen L. said: Auto-detection would only work if there were a trap theme to support the system. That feature doesn't work with just the It's A Trap script by itself. Can you explain how Soak works? Sure - but I'm going to write a brief combat explanation and then will post the whole thing. Will probably make more sense too.
1494343787

Edited 1494343825
Unlike other games, Vampire (or any World of Darkness Game) is based on the d10 and number of successful rolls versus how high (or low) any one roll is. Vampire uses a difficulty system of 2-10 (lower is easier; 6 is normal difficulty); with a die role of 1 always bad (botch - removes 1 success from most rolls per 1 rolled). Combat is fairly straight forward. You roll your attack (Dex & Skill for the 'to hit'), then the target rolls a Defensive Action (if they saved one - usually Dex & Dodge). Each success on the defense removes one success on the attack. If the attack is reduced to 0 or less successes then its a miss. Otherwise its a hit. Each success over 1 on the 'to hit' adds 1 die to the damage die (to reflect the quality of hit). The attacker then rolls damage - usually a flat number for guns (plus additional die from the 'to hit'). Melee weapons have a set damage die and the attacker would roll Strength & Damage (plus additional from the 'to hit'). The target then rolls their Soak - basically Stamina & Armor (if any). Any successes from the Soak roll comes off the successes from the Damage roll and what is left is damage inflicted upon the target. Now this is basic and many things can modify each and every roll - including Discipline use (Like spells). For the Script I would think the trap would only need to roll a base 'to hit' and list its damage type and amount. The player would then roll their dodge (if available) and then soak outside the script. If this doesn't make enough sense we can chat over some Voice over IP system if you want - I have Mumble and Discord installed but can get whatever you want. Shoot me a PM and we can set it up.
1494347696
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Okay, I think this is enough information for me to work off of. When I have time, I'll see about making a World of Darkness trap theme.
Stephen L. said: Okay, I think this is enough information for me to work off of. When I have time, I'll see about making a World of Darkness trap theme. Thank you
1494959360

Edited 1494959524
Mike
Pro
Is there a way to make a trap with a blast Ignore NPCs?
1494976360
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Nope
Hi, I applied that patch you said to do but I am still getting this error: TypeError: Cannot read property 'replace' of undefined TypeError: Cannot read property 'replace' of undefined at getFrom (apiscript.js:3951:43) at apiscript.js:3940:31 at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1510:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400 Help D: It happens right when I click anything in the trap making wizard right away. I set up the attritubutes, the sheet type, I made sure all the other APIs needed were updated, I applied that bugfix you said to do, and it's still not working. I'm using the 5e OGL sheets.
Now just chilling after restarting API I have this in the box TypeError: Cannot read property 'replace' of undefined TypeError: Cannot read property 'replace' of undefined at getFrom (apiscript.js:3951:43) at apiscript.js:3940:31 at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1510:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400
1495460020
Ada L.
Marketplace Creator
Sheet Author
API Scripter
That patch may be a bit old now. I'd recommend installing the script and its dependencies from One-Click and try again. However, the function getFrom() is used in either It's A Trap, any of its trap theme scripts, or any of its dependencies. This is more likely a conflict you're having with another script. After doing a quick search through the Roll20 API repository, the only script that uses a function called getFrom() is Rollable Table Macros. From looking at their script, I can tell what's going wrong, but the details are technical. I will inform the Rollable Table Macros script's author about the error.
Well, first of all I would like to thank you for this great script. It really makes it easy to set traps which are both useful and beautiful. I was wondering if there is an easy way to reset a trap once triggered. Of course, one can just paste a copy of the non-triggered trap somewhere and replace the triggered one with it, but a one-click reset is nicer. Does it exist?
1495653509
Ziechael
Forum Champion
Sheet Author
API Scripter
If you set the trap to not be revealed when triggered it will trigger every time it is encountered... essentially an automatic reset :)
1495657708
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Algunillo said: Well, first of all I would like to thank you for this great script. It really makes it easy to set traps which are both useful and beautiful. I was wondering if there is an easy way to reset a trap once triggered. Of course, one can just paste a copy of the non-triggered trap somewhere and replace the triggered one with it, but a one-click reset is nicer. Does it exist? The trap will be reset when you move it back to the GM layer.
1496253492
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Update: World of Darkness (classic) trap theme is now available from One-Click.
Stephen L. said: Update: World of Darkness (classic) trap theme is now available from One-Click. Excellent. I will download it and test it out. Thanks a lot.
1496324617

Edited 1496325846
Hi All, Firstly I have little (read no) experience with scripting. Having said that I have managed to bumble my way through most of the setup for using this with the D&D 5E Shaped sheet. Everything is working as it is supposed to, except for this error: "TypeError: Cannot read property 'get' of undefined\n at TrapTheme.getSheetRepeatingRow.then.rowAttrs (apiscript.js:6348:26)\n at process._tickCallback (internal/process/next_tick.js:109:7)" This error only occurs when in line of sight of the trap and occurs after each move, so I'm thinking it has to do with the perceptionModifier and passivePerception fields, neither of which I have an entry in since I'm not sure what is supposed to go in them (unable to find any reference on the character sheet). I'm guessing it is trying to check passive perception of the trap and not succeeding. Can someone please advise what is required in these fields? EDIT: All good: Gerry S. Permalink Quote Report Nevermind on the 'not implemented' thing; I see the function is actually in the theme.js So, I read the getPassivePerception function in them.js. Then noticed my characters don't have a passive perception attribute. Went to the character sheet (Shaped 9.0.1), clicked the 'gear icon' to go to sheet settings. Saw "Passive Skills" was unchecked. I checked it, and now the script works perfectly!!! TL;DR: Make sure "Passive Skills" is ON in your character sheet settings tab. Working now.
1496800678
Jedd
KS Backer
Marketplace Creator
I'm having an issue linking a trap's saving throw to the special saves in the 5e Shaped sheet. I have Fortitude linked to Constitution, Reflex linked to Strength & Dexterity, and Will linked to Intelligence, Wisdom, & Charisma. I tried doing custom/none and inputting the "conSaveModifier" value as "fortitude_saving_throw_mod_with_sign" as that's the closest attribute I could find that was correct, but got an error saying "Cannot read property 'conSaveModifier' of undefined". Any help?
1496873385

Edited 1496876503
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I think I may have found the problem with that. You can try the fix for it from here:&nbsp;<a href="https://github.com/Cazra/roll20-api-scripts/blob/trapThemeFix/ItsATrap_theme_5E_Generic/3.0.2/TrapTheme.js" rel="nofollow">https://github.com/Cazra/roll20-api-scripts/blob/trapThemeFix/ItsATrap_theme_5E_Generic/3.0.2/TrapTheme.js</a>
1497290288
Jedd
KS Backer
Marketplace Creator
I uploaded the new TrapTheme.js, and that seemed to fix the issue - thanks!
1497304478
Ada L.
Marketplace Creator
Sheet Author
API Scripter
No problem. :)
Hi&nbsp;Stephen Can you add a touchAC(touch armor class) to the Pathfinder theme? Because some traps are use touch attacks, i.e ray spells. thank you!
1498737190
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I'll add that to the features roadmap.
1499473327

Edited 1499473357
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hey Stephen, Not sure if I'm mis-setting up my traps or what, but they aren't revealing when activated (I've got it set to reveal on activation based on the wizard). Theme: 5e sheet: ogl
1499693034

Edited 1499693574
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Scott C. said: Hey Stephen, Not sure if I'm mis-setting up my traps or what, but they aren't revealing when activated (I've got it set to reveal on activation based on the wizard). Theme: 5e sheet: ogl Thanks for pointing that out. I'm having some trouble replicating the issue, but I'll try to get around to fixing it soon. Could you copy-paste the JSON from your trap's GM notes here?
Hi, I've installed the It's a trap! and It's a trap - 5e Generic scripts from the one click install menu. Doing some experiment I've understood, more or less, how to set up traps and triggers but I can only spot the trap and send the message on the chat window. I' m not able to make attack bonus, spot dc, save throw, and damage works. I've tried to add manually the attributes name (I'm using 5e OGL sheet), but I don't know if I'm doing it correctly) Here are some images of my set up and of what i get in the chat window: As you can see I've set up damage roll and other things about my trap but when the pc spots it (by stepping on the path that triggers it) the chat panel shows only the written message but not damage and other attributes. Am I doing something wrong? &nbsp;
If you notice the sheet drop down on the first item- try clicking on it. I bet there is an OGL sheet there &nbsp;see if that fiexes the problem
1500904254
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Yes, select the OGL sheet from the drop-down "sheet" field.
Ok it seems now is working. I can spot the trap using passive perception, but I'm sure there is a way to spot it even with an active search (I've tried to raise the DC above the passive perception of the pc's token I'm using for the test moving that token near the trap and continuously doing perception skill checks, but when I hit the DC of the trap nothing happens). Let's say my players want to search actively a trap paying attention on where they put their feet, how can I set up this?
I don't believe the script handles active checks. If they try an active check simply make the check as you would normally, and if they find the trap maybe draw a circle around it yourself using the games drawing tools.&nbsp;
There is a parameter that maybe misled me in the One-Click option menu. "Passive perception" and "perception modifier". Thought that the second refers to an active check.
Such a possibility would be great, but maybe is not possible to make the script react to something that depends on a die roll like an active check.
1500923211
Ada L.
Marketplace Creator
Sheet Author
API Scripter
The "perception modifier" is only used for custom sheets that don't have a "passive perception" attribute to fall back on, but it may be used in the future to support active searching. The Pathfinder theme has a limited version of active searching that operates by a rogue's Trap Spotter ability. For general active searching, it isn't as simple a task. The script would have to capture the sheet's chat output for the active search, parse that based on the sheet, check trap distances, and then compare the result to the trap's perception DC. The chat capture, distance check and result compare are the easy parts. The tough part would be parsing the search result out of the chat output, especially since the sheet authors might have that change over time.&nbsp;
1500956935

Edited 1500958647
I have installed its a trap theme, but having an issue where tokens and object do move to the layer specified. Using Pathfinder simple character sheet. Pathfinder its a trap theme as well.&nbsp; Edit: Never mind got it to work right...wasn't set to reveal when activated.
Does the OGL sheet theme for D&D have issues with FX displayed when a trap is activated? I can only get a default one (an explosion).
1501258541
Ada L.
Marketplace Creator
Sheet Author
API Scripter
No, but the the FX API itself is picky about how you provide FX names. If an unrecognized name is given, then it will default to "burn-fire".
1503216890

Edited 1503220176
is there a way to make the trap only trigger once whiteout revealing/moving it to the map/token layer? If there is I'm blind as to how to find it..&nbsp; I had the idea of using the trap script to read out room descriptions once a player enter the room, but don't want any token to obstruct the map view once it's triggered (especially for rooms with multiple entrences so the "trap" have to cover the entire room. or spam the chat as all 5 of my players explore the area
1503231303
Ziechael
Forum Champion
Sheet Author
API Scripter
Use an invisible token and have it reveal as normal... nothing blocking your view and only triggers once :)
Hi~&nbsp;Stephen, I have some questions about Pathfinder theme's&nbsp;Trap Spotter ability to ask. I just need to write "Trap Spotter" on the ability field on the character sheet, and set the trap spot DC? But the result of my actual operation is that anyone who sees the trap will automatically detect the trap. Even he don't have the&nbsp;Trap Spotter ability and he is more than 10 feet away from the trap. This is my trap setting.&nbsp;<a href="http://i.imgur.com/fj5Yqpf.jpg" rel="nofollow">http://i.imgur.com/fj5Yqpf.jpg</a> {"damage":"100d6","missHalf":true,"save":"ref","saveDC":18,"spotDC":20,"fx":{"name":"beam-frost","offset":[0,0]},"message":"just test","revealWhenSpotted":true}
1503509813
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Lin O. said: Hi~&nbsp;Stephen, I have some questions about Pathfinder theme's&nbsp;Trap Spotter ability to ask. I just need to write "Trap Spotter" on the ability field on the character sheet, and set the trap spot DC? But the result of my actual operation is that anyone who sees the trap will automatically detect the trap. Even he don't have the&nbsp;Trap Spotter ability and he is more than 10 feet away from the trap. This is my trap setting.&nbsp; <a href="http://i.imgur.com/fj5Yqpf.jpg" rel="nofollow">http://i.imgur.com/fj5Yqpf.jpg</a> {"damage":"100d6","missHalf":true,"save":"ref","saveDC":18,"spotDC":20,"fx":{"name":"beam-frost","offset":[0,0]},"message":"just test","revealWhenSpotted":true} Yes, you just have to have an special ability for that character called "Trap Spotter", exactly as you have done in the Pathfinder sheet. I just tried your trap out in my test environment and it's working just fine. If you have someone in the party whose passive perception (10 + Perception) is greater than the trap's spot DC, then they will automatically notice the trap. Is that what might be causing your problem with the trap always being detected? You can also configure a max search distance for the traps. This way if someone does have high enough passive perception to automatically notice the trap, they won't notice it unless they are within that search distance.
So if anyone's passive perception(10+perception) is higher than the trap's spot DC, even he don't have the Trap Spotter ability, he will still automatically find the trap, is that so? According to Paizo Creative Director James Jacobs's words "The Trap Spotter rogue talent is a good way to gain an auto-spot ability for traps in the game. Normally, you can't autospot traps like this. A player has to specifically state that they're looking for traps." So this is the advantage of Trap Spotter ability, even if your passive perception is very high, if you do not specifically state that you're looking for traps, you will never find a trap. So it's possible to add a new switchable function, when switching to "yes" mode, only those who have Trap Spotter ability can automatically detect the traps?
Maybe chose a custom setup instead? Using trapspotter instead of passive perception&nbsp;
1503517421
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Yeah, I suppose I could add a checkbox to enable/disable passive perception for the Pathfinder theme.
Oh &nbsp;thank you!!
Sorry... but I still have some problems. The following is the result of my multiple tests. a). The trap has spot DC 26, and a max search distance is blank. 1). Character one has perception +15 and Trap Spotter ability, but even if he is close to the trap 10 feet away, there is nothing happen, this is the result I have tested many times. But in theory he has a 55% chance to find the trap. 2).&nbsp;Character one has perception +16 and Trap Spotter ability, when he sees the trap, he automatically detects the trap, even if he is more than 10 feet away from the trap. But in theory he has a 45% chance to miss the trap. 3).&nbsp;Character two&nbsp;has perception +16 and without Trap Spotter ability,&nbsp;when he sees the trap, he automatically detects the trap, even if he is more than 10 feet away from the trap. b). The trap has spot DC 26, and a max search distance is 10 ft. 1). Character one has perception +15 and Trap Spotter ability, but even if he is close to the trap 10 feet away, there is nothing happen, this is the result I have tested many times. But in theory he has a 55% chance to find the trap. 2). Character one has perception +16 and Trap Spotter ability, when he closes to the trap 10 ft away, he automatically detects the trap. But in theory he has a 45% chance to miss the trap. 3). Character two has perception +16 and without Trap Spotter ability, when he closes to the trap 10 ft away, he automatically detects the trap. Is there a conflict or bug between passive perception and the trap spotter ability? Or my test method or my settings are wrong? Because in my test results, when the character's passive perception(10+perception) is&nbsp;greater or equal to the trap's spot DC, he can always&nbsp;automatically detects the trap, even he don't has the trap spotter ability.&nbsp;when the character's passive perception(10+perception) is lower to the trap's spot DC and he has the trap spotter ability, but he will never detects the trap.
1503585965
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Lin O. said: Sorry... but I still have some problems. The following is the result of my multiple tests. a). The trap has spot DC 26, and a max search distance is blank. 1). Character one has perception +15 and Trap Spotter ability, but even if he is close to the trap 10 feet away, there is nothing happen, this is the result I have tested many times. But in theory he has a 55% chance to find the trap. 2).&nbsp;Character one has perception +16 and Trap Spotter ability, when he sees the trap, he automatically detects the trap, even if he is more than 10 feet away from the trap. But in theory he has a 45% chance to miss the trap. 3).&nbsp;Character two&nbsp;has perception +16 and without Trap Spotter ability,&nbsp;when he sees the trap, he automatically detects the trap, even if he is more than 10 feet away from the trap. b). The trap has spot DC 26, and a max search distance is 10 ft. 1). Character one has perception +15 and Trap Spotter ability, but even if he is close to the trap 10 feet away, there is nothing happen, this is the result I have tested many times. But in theory he has a 55% chance to find the trap. 2). Character one has perception +16 and Trap Spotter ability, when he closes to the trap 10 ft away, he automatically detects the trap. But in theory he has a 45% chance to miss the trap. 3). Character two has perception +16 and without Trap Spotter ability, when he closes to the trap 10 ft away, he automatically detects the trap. Is there a conflict or bug between passive perception and the trap spotter ability? Or my test method or my settings are wrong? Because in my test results, when the character's passive perception(10+perception) is&nbsp;greater or equal to the trap's spot DC, he can always&nbsp;automatically detects the trap, even he don't has the trap spotter ability.&nbsp;when the character's passive perception(10+perception) is lower to the trap's spot DC and he has the trap spotter ability, but he will never detects the trap. I made some changes to add the checkbox to disable/enable D&D 5 style passive perception. It might take a week or two for these changes to be merged into the API though, so until then you'll still be experiencing issues a2, a3, b2, and b3. For issues a1 and b1, I'm not sure what's going on. When the character with the trap spotter ability gets within 10' of the trap, you should see a whispered message to the GM informing you of the result of the perception check made with the trap spotter ability. If the character has already searched for this trap and failed, it will not try again next time they get within 10' of it. See if Trap Spotter works if you make a copy of the trap and delete the original one. That should reset the cached information for whether or not the character tried to search for the trap.
I recorded a short film of a test. <a href="https://i.imgbox.com/H42DIA2P.gif" rel="nofollow">https://i.imgbox.com/H42DIA2P.gif</a> The first two characters have trap spotter ability with +15 perception, and the third character don't have trap spotter ability with +24 perception. The trap token is new and the spot DC is 26. So... I didn't see the&nbsp;whispered message&nbsp;of the result of the perception check made with the trap spotter ability... :'(