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

RecursiveTables

Hi Everybody, I have been happily compiling loot tables using The Aaron's Recursive Tables API script.  However, while testing the second set of tables I received the following error: TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at Object.d20.getWeightedTable (/home/node/d20-api-server/api.js:135:72) at Object.d20.getTableElementCount (/home/node/d20-api-server/api.js:122:14) at validateParseResult (eval at <anonymous> (/home/node/d20-api-server/api.js:149:1), <anonymous>:288:32) at parseRollString (eval at <anonymous> (/home/node/d20-api-server/api.js:149:1), <anonymous>:370:22) at Object.process (eval at <anonymous> (/home/node/d20-api-server/api.js:149:1), <anonymous>:1025:17) at _processRoll (eval at <anonymous> (/home/node/d20-api-server/api.js:150:1), <anonymous>:1036:30) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:150:1), <anonymous>:976:10) at _findInlineRolls (eval at <anonymous> (/home/node/d20-api-server/api.js:150:1), <anonymous>:991:11) at inlinefinalcallback (eval at <anonymous> (/home/node/d20-api-server/api.js:150:1), <anonymous>:1102:7) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:150:1), <anonymous>:988:11) I am not quite sure whats going on but I have checked my code and corrected the few errors I could find in my tables.  I would appreciate any help you can offer. Thanks, Adrian
1516675325
GiGs
Pro
Sheet Author
API Scripter
Based on first 2 lines, that seems to be suggesting there's an invalid entry in one of your table cells. I'd check the weight column to make sure numbers are set properly, and also check text entries for unusual characters - I don't know how well recursive tables processes apostrophes, quotes, commas, etc. I assume it can handle them, but it's worth checking. Beyond that, I'll leave further error checking to the experts. But a screenshot of your tables, and posting your recursive table call will help get you better advice.
1516691360
The Aaron
Pro
API Scripter
That is odd. I don’t see anything in that callstack that’s in the RecursiveTable script. Not to say it isn’t coming from RT, but the crash looks like it’s happening in Roll20 code. G.G has the right idea; I’ve seem similar callstacks from bad vaulted in attributes. If you don’t find an error in the data but can get a repeatable case, I can hop in your game and see if I can track it down. 
After hours of going through my table and macros I found a couple misnamed tables and some spaces at the end of table entries (Incidentally the spaces at the end of a table item seemed to be causing the elusive "0" that would occasionally show up. It seems that if the item with the space in the title was added to the end of a line, then it would generate the "0").  It seems to be working now but I intend to give it a more rigorous test. I wanted to take this opportunity to say thank you The Aaron for designing such a useful tool.  And thank you both for your replies
1516770853
The Aaron
Pro
API Scripter
No worries!