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

I'm having a bit of trouble with my API

1467173399

Edited 1467173801
I think it might be EasyExperience, but I'm not sure. this is the error I get. TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at apiscript.js:5024:51 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.outputConfig (apiscript.js:5023:11) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.HandleInput (apiscript.js:5140:29) 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 /home/node/d20-api-server/api.js:1197: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:54 It happens when I use the "!xp config" command. "!xp help" works, but then the script just falls apart if I try to actually use it.
1467174747

Edited 1467174841
Another script is throwing up another error. It was all working fine until today, don't know what happened. ReferenceError: getobj is not defined ReferenceError: getobj is not defined at apiscript.js:770:18 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:704:14) at updateLocalCache (/home/node/d20-api-server/api.js:933:18) at /home/node/d20-api-server/api.js:1076: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) 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 Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) This was a script made by TheAaron, but I think the problem might be because of another script.
1467175274

Edited 1467175390
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I think it might be EasyExperience, but I'm not sure. this is the error I get. TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at apiscript.js:5024:51 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.outputConfig (apiscript.js:5023:11) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.HandleInput (apiscript.js:5140:29) 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 /home/node/d20-api-server/api.js:1197: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:54 It happens when I use the "!xp config" command. "!xp help" works, but then the script just falls apart if I try to actually use it. Hmmm, Hi Jake; I'm the creator of EasyExperience. What other commands have you tried that throws this error?
1467175352
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Jake W. said: Another script is throwing up another error. It was all working fine until today, don't know what happened. ReferenceError: getobj is not defined ReferenceError: getobj is not defined at apiscript.js:770:18 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:704:14) at updateLocalCache (/home/node/d20-api-server/api.js:933:18) at /home/node/d20-api-server/api.js:1076: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) 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 Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) This was a script made by TheAaron, but I think the problem might be because of another script. Hi Jake, Have you added any new scripts since it was last working? In the code above, it looks like getObj got changed to getobj which is not the same thing. Out of curiosity, which script is it?
First, I think I found the problem with Easy Experience. My ExperienceThreshhold character sheet is nowhere to be found. But deleting and reinstalling the script doesn't seem to be recreating the character. Second, it's a custom script he made for me that will randomly move a character a short distance after the players move themselves.
1467175740
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
hmmm, ok, I'll do some investigation in my sandbox and see if I can get it to throw the error again. Do you have a game coming up, or do you have a bit before you need it all working?
1467175849

Edited 1467176030
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Also, are you using the one-click install version, or did you copy it from the repository/my gist page? EDIT: Hrmm, I can't get it to throw the error by deleting the ExperienceThresholds character. Hrmm-a-Hrmm-a-Hrmm. What settings have you configured EasyExperience to use?
I got a while, no real rush. And to answer the other question I changed a few scripts out when the library became a thing. I wanted to make sure I had the up to date dependencies for things like It's a Trap and Path Splitter so I got all the new "math" scripts. I also installed Extended Expressions recently.
It was configured to use pathfinder fast progression. Installed via one click. I know you say in the original post not to make a ExperienceThreshhold character but you think I should give it a try?
1467176225
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, I run with It's a Trap and all the math scripts, so we can probably toss those out as causing a problem. I've never used extended expressions or path splitter.
1467176458

Edited 1467176498
Turning off pathsplitter and changing getobj to getObj gives me this new one. ReferenceError: parsefloat is not defined ReferenceError: parsefloat is not defined at movedistance (apiscript.js:741:22) at apiscript.js:773:20 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:704:14) at updateLocalCache (/home/node/d20-api-server/api.js:933:18) at /home/node/d20-api-server/api.js:1076: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) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) EDIT: I get this even with Path splitter on and the getObj change.
1467176523

Edited 1467176700
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Well, I can't find where I wrote that (I remember writing it though), but I believe I said that because I didn't want to worry about people telling me the script didn't work because they manually created a character and didn't give it all the attributes it needed. But, it might be worth it to make a character named ExperienceThresholds character and see if !xp config will run. Then delete it and see what happens. EDIT: Jake W. said: Turning off pathsplitter and changing getobj to getObj gives me this new one. ReferenceError: parsefloat is not defined ReferenceError: parsefloat is not defined at movedistance (apiscript.js:741:22) at apiscript.js:773:20 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:704:14) at updateLocalCache (/home/node/d20-api-server/api.js:933:18) at /home/node/d20-api-server/api.js:1076: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) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) EDIT: I get this even with Path splitter on and the getObj change. It looks like the capitalizations in a lot of your scripts have been changed somehow. parsefloat needs to be parseFloat to actually call the javascript function. This is almost starting to look like a bug with the one-click install functionality (or somehow the code for several scripts has been futzed).
So I made a character name ExperienceThreshholds and got this again TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at apiscript.js:4283:51 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.outputConfig (apiscript.js:4282:11) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.HandleInput (apiscript.js:4399:29) 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 /home/node/d20-api-server/api.js:1197: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)
So I deleted everything, the script and the character, then reinstalled it via copying it into the api by hand and it still will not create the sheet itself.
1467177205
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, sorry, I apparently need to update the forum and wiki entry. It isn't supposed to create the sheet automatically any more. That's done in !xp config.
I made sure all the characters had "experience" attributes also since the forum post mentions a possible TypeError, but they all have the attribute.
I'm not an experienced programmer, but I'm also not new to this and can follow code pretty well. But I must admit I am quite flummoxed at what to do at this point. I think I've exhausted every experiment to test it. "!xp config" is throwing that error no matter what, even after a clean install. 
1467177945

Edited 1467177992
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, and that's not the issue you are getting (Also, I'm pretty sure that I've handled that TypeError with in script error messages. Just kept the warning in there in case). can you disable all your scripts except EasyExperience and then run it and call !xp config, help, challenge, and session and PM me any resulting error messages? I'll take a look at that in the morning before I head off to work.
Doing that now
Hey Folks! I have a similar issue. I have disabled anything else i've got to make sure this is only EE. I created the character ExperienceThresholds manually. did nothing with it. then used !xp config medium. which detected the players correctly, and set the xp progression to medium (pfmedium) then i tried !xp challenge <number> (with a macro to put the number in) and it threw me this: For reference, the error message generated was: TypeError: Cannot read property 'Session XP' of undefined TypeError: Cannot read property 'Session XP' of undefined at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.recordXP (apiscript.js:504:38) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.HandleInput (apiscript.js:713:37) 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 /home/node/d20-api-server/api.js:1197: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 Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) No idea whats going on.
1467206079
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Kalle, Are you also getting the error Jake was when you use !xp config to bring up the options menu? As for the error you copied, I'll have to look at the code once I'm on my computer, but it looks like it can't find the thresholds character. As a note, making a copy of the game fixed Jake's issue (no idea why). I'm gonna be working on figuring out what was happening this week.
1467210792
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Kalle, can you send me an invite to your game. I'd like to do some logging in the game that this is happening in since I can't for the life of me recreate it in my sandbox. I'm thinking that for both you and Jake the state has been corrupted somehow. I'd like to insert some log entries and play around with it to see where exactly it screws up when iterating through the characters.
1467223995
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I've taken a look at Jake's campaign and somehow (I have no idea how atm) the state was corrupted so that it stored several null values in it. Overwriting the state fixes the issue. I'll be adding a "restore defaults" command to the program to allow users to fix this themselves without having to dive into the code. That should be done later on today, not sure when it will hit one-click.
Hey Scott. Sorry for my late reply. Somehow roll20 did not showed your replies. I do have a suggestion for the future perhaps, also to make debugging easier. I never wrote in java but in c++/c#. and there i normally route any errors to a debug output, without crashing the entire api. I saw one other modder do something similar with creaturegen, but creaturegen does not work anymore and the man left roll20 unfortunately. But yeah it can be done. That is like currently my biggest wishlist thing on many api scripts. that they have proper debug scripted in, so they do not crash the entire setup :)
1467256628
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, I have error msgs programmed in for all the possible fail areas, however this was a case that shouldn't have been able to occur. I'll look into the debug options though in case they are more robust than I think they are.
Kalle P. said: Hey Scott. Sorry for my late reply. Somehow roll20 did not showed your replies. I do have a suggestion for the future perhaps, also to make debugging easier. I never wrote in java but in c++/c#. and there i normally route any errors to a debug output, without crashing the entire api. I saw one other modder do something similar with creaturegen, but creaturegen does not work anymore and the man left roll20 unfortunately. But yeah it can be done. That is like currently my biggest wishlist thing on many api scripts. that they have proper debug scripted in, so they do not crash the entire setup :) You may like to know that, at least for pathfinder, creaturegen works.
Tried it Jake. No dice. But now i got PCgenImport and that is even more versatile.
Strange, creaturegen works perfectly for me.