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

Power Cards Macro Helper Crashes/Unusable

Since latest update to Power Cards and Power Cards Macro Helper, the API crashes--without fail--producing the following error:
I've got the same error Dave and I'm not using the updated versions. I think it's something on the server side.
1600436218
The Aaron
Roll20 Production Team
API Scripter
I peeked at the code.  It seems to be caused by the state not having a PCMHelper property, which causes it to be undefined when Queue is looked for on it.  I don't know why this would cause an issue in games where you've used it before, but if you haven't used it, it's because state is set up in an on('ready') event, but the on('change:attribute',...) events are firing before 'ready' has occurred.  Moving line 253: on("ready", function() { to line 234, right before: on("change:attribute", function(obj) { Should fix it. Kurt should update the script.  All on() events should be registered in on('ready'), unless you are specifically dealing with the load order events for exiting objects in the game.
Script-magic! :)
1600436785
Kurt J.
Pro
API Scripter
The Aaron said: I peeked at the code.  It seems to be caused by the state not having a PCMHelper property, which causes it to be undefined when Queue is looked for on it.  I don't know why this would cause an issue in games where you've used it before, but if you haven't used it, it's because state is set up in an on('ready') event, but the on('change:attribute',...) events are firing before 'ready' has occurred.  Moving line 253: on("ready", function() { to line 234, right before: on("change:attribute", function(obj) { Should fix it. Kurt should update the script.  All on() events should be registered in on('ready'), unless you are specifically dealing with the load order events for exiting objects in the game. Thanks Aaron. I'll make the updates as suggested.
Hi, I'm having trouble with all the available versions of Power Cards. It's a new campaign, but it seems to happen on old ones as well. When I use a !Power command it posts a blank line and shuts down all the scripts. First happened yesterday, then seemed okay this morning; now seems to be back.  Not sure if it's something I'm doing wrong, but I'm really not trying anything outlandish and I've never had this problem before. Any help really appreciated.  The error message is: ReferenceError: RollOdds is not defined ReferenceError: RollOdds is not defined at apiscript.js:1291:18 at Array.forEach (<anonymous>) at apiscript.js:1214:35 at checkFinishedOps (eval at <anonymous> (/home/node/d20-api-server/api.js:158:1), <anonymous>:757:7) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:158:1), <anonymous>:837:8) at Timeout._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:825:19) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)
I grabbed the latest version from Git Hub. It works so far. Thank you, once again, Aaron and Kurt for your help. It is greatly appreciated.
I have just launched a new campaign and the power cards (although I am using the latest version 3.8.14) crashes with the following error : TypeError: Cannot read property '0' of null TypeError: Cannot read property '0' of null at apiscript.js:3257:49 at Array.forEach (<anonymous>) at apiscript.js:3246:10 at checkFinishedOps (eval at <anonymous> (/home/node/d20-api-server/api.js:158:1), <anonymous>:757:7) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:158:1), <anonymous>:837:8) at Timeout._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:825:19) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)
1600722970
Kurt J.
Pro
API Scripter
Cornet E. said: I have just launched a new campaign and the power cards (although I am using the latest version 3.8.14) crashes with the following error : TypeError: Cannot read property '0' of null TypeError: Cannot read property '0' of null at apiscript.js:3257:49 at Array.forEach (<anonymous>) at apiscript.js:3246:10 at checkFinishedOps (eval at <anonymous> (/home/node/d20-api-server/api.js:158:1), <anonymous>:757:7) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:158:1), <anonymous>:837:8) at Timeout._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:825:19) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7) Can you post the card you are having trouble with? Does this crash: !power {{ --name|Test }}
Hi Kurt, everything works, thank you.
Dave T said: I grabbed the latest version from Git Hub. It works so far. Thank you, once again, Aaron and Kurt for your help. It is greatly appreciated. Dave T, can you post a link to this working version???
Power Cards ver. 3.14: <a href="https://github.com/Roll20/roll20-api-scripts/commit/a4c50b1aa5f32699f06b8a28a01444cb021c7ed2" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/commit/a4c50b1aa5f32699f06b8a28a01444cb021c7ed2</a> PCM Helper: <a href="https://github.com/Roll20/roll20-api-scripts/commit/a4c50b1aa5f32699f06b8a28a01444cb021c7ed2" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/commit/a4c50b1aa5f32699f06b8a28a01444cb021c7ed2</a> These did the job for me. If the links don'' take you to the scripts, IM me and I can send you the files direct.