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

Its a trap error

Good day, I've loaded "Its a trap" and the other required scripts. when the player token enters the square with the trap token, I get this error.... For reference, the error message generated was: TypeError: token.get is not a function at _getTokenPt (apiscript.js:3922:23) at _checkCollisionInWaypoint (apiscript.js:3867:23) at _getCollisionsInWaypoint (apiscript.js:3848:16) at _getFirstCollisionInWaypoint (apiscript.js:3804:26) at Object.getFirstCollision (apiscript.js:3734:33) at getTrapCollision (apiscript.js:3959:30) at apiscript.js:4033:22 at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:105:34), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:105:34), <anonymous>:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:673:14)   I tried to find other posts with this error, with no luck. Any ideas? thanks, Joe
1461265817
The Aaron
Pro
API Scripter
Do you have the required other scripts installed?: • [Token Collisions] <a href="https://github.com/Roll20/roll20-api-scripts/tree/master/Token%20Collisions" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/master/Token%20Collisions</a> • [Vector Math] <a href="https://github.com/Roll20/roll20-api-scripts/tree/master/Vector%20Math" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/master/Vector%20Math</a>
yes sir.&nbsp;
1461270162
The Aaron
Pro
API Scripter
Probably have to wait for Stephen L. to look. &nbsp;It appears that something in there is not actually a Token. &nbsp;Not sure how that might happen, but perhaps he has an idea. &nbsp;I feel like I've seen this in the past. &nbsp;I'll try to look again later.
Sure thing. No worries.&nbsp; Thanks as always for the help.
1461274268

Edited 1461274760
Ada L.
Marketplace Creator
Sheet Author
API Scripter
This happens when you enter the trap square? Not whenever you move anywhere else?&nbsp; What other scripts are you running in your game?
Hmmm. testing.&nbsp; OK. Anytime I move the token, not just when entering trap square. I should have tested that first. Running: Group init, shellcommand, tokenotes, tokennamenumbers, turnmarker, utility for tokenotes, IsGM, Tint, vector math, token collisions, its a trap &nbsp;&nbsp;
1461280494

Edited 1461281432
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I can't find the Tokenotes, its utility script, or the Tint script. Can you provide links or source code for those? I've created a blank campaign and added the scripts in your list, minus those ^. So far, I haven't been able to reproduce your issue.
<a href="https://github.com/defamai/Roll20/blob/master/Toke" rel="nofollow">https://github.com/defamai/Roll20/blob/master/Toke</a>... &nbsp; Tokenotes <a href="https://github.com/defamai/Roll20/blob/master/comm" rel="nofollow">https://github.com/defamai/Roll20/blob/master/comm</a>... &nbsp; &nbsp; &nbsp;utility for tokenotes <a href="https://app.roll20.net/forum/post/1760741/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/1760741/slug%7D</a> &nbsp; &nbsp;forum page about it <a href="https://app.roll20.net/forum/post/2139713/script-a" rel="nofollow">https://app.roll20.net/forum/post/2139713/script-a</a>... &nbsp;Tint Thank you very much for your help
1461286129
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I've found the culprit. Chris S.'s Tokenotes utility script is causing the issue, specifically when he augments the Array object prototype. It is NEVER a good idea to augment the prototypes of native Javascript objects. It appears that Tokenotes doesn't actually make use of the unique() method that he's tacked onto Array, so you should be safe removing the entire Array.prototype.unique function from the utility script. I've done that with your set of scripts and I'm having no problems with it.
Take this part out? Array.prototype.unique = function() { var a = this.concat(); for(var i=0; i&lt;a.length; ++i) { for(var j=i+1; j&lt;a.length; ++j) { if(a[i] === a[j]) a.splice(j--, 1); } } return a; };
1461293938
Ada L.
Marketplace Creator
Sheet Author
API Scripter
yes. :)
And we have a winner! Thanks so much. Be well, Joe