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

[Troubleshooting][TOR API] need help troubleshooting and fixing issue

1542122215
Michael I.
Pro
Sheet Author
The code had been running fine for months until 90 days ago when last was used. I am assuming roll20 updated something that has broken the script. <a href="https://github.com/Aragent/The-One-Ring-API" rel="nofollow">https://github.com/Aragent/The-One-Ring-API</a> &nbsp;is all the current api being run to make it all work for TOR I believe the&nbsp;tor-stance.js is the one that is having issues &nbsp; TypeError: Cannot read property 'set' of undefined TypeError: Cannot read property 'set' of undefined at setStanceOnTokensCharacter (apiscript.js:2625:11) at updateStanceOnDrop (apiscript.js:2590:9) at apiscript.js:2563:5 at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1020:14) at updateLocalCache (/home/node/d20-api-server/api.js:1318:18) at /home/node/d20-api-server/api.js:1502:11 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)
1542123519

Edited 1542123657
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The problem is on line 112 of the tor-stance.js: var setStanceOnTokensCharacter = function (token, newStance) { var characterid = token.get('represents'); var stance = findObjs({ _characterid: characterid, _type: 'attribute', name: 'stance' })[0]; if(stance){ stance.set('current', newStance.toString()); } else { createObj('attribute',{ characterid: characterid, name: 'stance', current: newStance.toString() }); } stance.set('current', newStance.toString()); //This is the same as what is done in the if/else above, but it's not gated to make sure there actually is a stance to use .set on. This line doesn't appear to do anything actually, the code in the if/else takes care of this regardless of whether there was a stance or not. sortTurnorder(); // sendChat('character|'+characterid, '/w gm !sortturnorder'); }; If you don't want to edit the code, you could also make sure that every character has an attribute created called "stance".
1542162941
Michael I.
Pro
Sheet Author
Thank you Scott C. I appreciate you looking at this. I would have said something sooner but been without internet most of day due to Blizzard.&nbsp;