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

CombatMaster V2 API Error

Hoping someone has seen this before.  I am cleaning up several old scripts out of my game. I am implementing the CombatTracker V2 to replace some of the functionality. I deleted all scripts out of my game e and restarted the API. I  now only have the CombatTracker V2 script enabled. I am getting the standard cryptic API error message below, anytime I move a token on a battlemap. This is even before I do any configuration with !cmaster --main. I am using Chrome  Version 85.0.4183.83 For reference, the error message generated was:  TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at handleGraphicMovement (apiscript.js:2464:33) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1047:14) at updateLocalCache (/home/node/d20-api-server/api.js:1345:18) at /home/node/d20-api-server/api.js:1529: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)  
1599665109
timmaugh
Pro
API Scripter
That is a fairly small function in the code, so it's easier to pinpoint what is going on (line 495): if ( getCurrentTurn ( ) . id === obj . get ( 'id' ) ) { obj is being passed by Roll20, so it isn't undefined, it has to be the getCurrentTurn() side. Before I dig into that part, have you established any sort of turn order? Without knowing more about the script, I think you should be able to add a line above it: if(!getCurrentTurn()) return; That is what line 493 looks like it is supposed to be doing... testing to see if you're even in a fight, but something between the inFight() function and getCurrentTurn() function is getting screwy. Long term, that's likely what will need to be fixed.
figured it out . One Click version has issues.  Upgraded to version 2.2