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

Concentration bugged ?

Hi all, Is it only me or is concentration api bugged ??? When calling !concentration, the sandbox immediately crashes... Either on a pro account or as a player.... Anyone ? ReferenceError: character_name is not defined ReferenceError: character_name is not defined at addConcentration (apiscript.js:11319:52) at apiscript.js:11303:25 at Array.forEach (<anonymous>) at handleInput (apiscript.js:11301:34) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1736: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)
Has anyone has the same problem ??
API Scripter
I see the problem in the code... There must be a config setting for whether to tell everyone about the concentration or just the character. When you have that set to "character" you get the error. It's this function: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 addConcentration = (token, playerid, spell) => { const marker = state[state_name].config.statusmarker let character = getObj( 'character' , token.get( 'represents' )); if ((token.get( 'controlledby' ).split( ',' ).includes(playerid) || token.get( 'controlledby' ).split( ',' ).includes( 'all' )) || (character && (character.get( 'controlledby' ).split( ',' ).includes(playerid) || character.get( 'controlledby' ).split( ',' ).includes( 'all' ))) || playerIsGM(playerid)) { if (!token.get( 'status_' + marker)) { let target = state[state_name].config.send_reminder_to; if (target === 'character' ) { target = createWhisperName(character_name); } else if (target === 'everyone' ) { target = '' } let message; if (spell) { message = '<b>' + token.get( 'name' ) + '</b> is now concentrating on <b>' + spell + '</b>.' ; } else { message = '<b>' + token.get( 'name' ) + '</b> is now concentrating.' ; } makeAndSendMenu(message, '' , target); } token.set( 'status_' + marker, !token.get( 'status_' + marker)); } }, Line #10 really needs to be: target = createWhisperName((character || { get: () => { return ''; } }).get('character_name')); Although that still would (it looks like) allow for cases where the setting was set at 'character' but a character wasn't chosen. I *think*, from what else I see in the script, that case is accounted for. But this should, at least, get you past the error until the owner of that script can make the update. You might drop them a PM to alert them to this problem.
Thank you for your answer, I'll try to have a look at it. What's weird is that it was working perfectly fine before that and suddenly it was not working anymore... Also, I noticed a little issue as well :  When i Drag 2 identical monsters from journal, and i "concentrate" one of them, both of them get the symbol on, and if one of them is losing concentration failing its Constitution check, both of them lose their concentration... Is there a way that this doesn't happen ? I Think that concentration isn't maintained anymore, but it's such a useful script that it could be nice to have it corrected or maybe converted to scriptcards or similar ?? Thanks for your help

Edited 1639309393
So,  I get a new error : but it still doesn't work TypeError: Cannot read property 'split' of undefined TypeError: Cannot read property 'split' of undefined at createWhisperName (apiscript.js:11490:21) at addConcentration (apiscript.js:11319:34) at apiscript.js:11291:33 at Array.forEach (<anonymous>) at handleInput (apiscript.js:11289:42) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1736: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)
The Aaron
Forum Champion
API Scripter
Change this function: createWhisperName = (name) => { return name.split(' ').shift(); }, to: createWhisperName = (name) => { return (name||'') .split(' ').shift(); }, That should fix that crash.
Victor B.
Sheet Author
API Scripter
The concentration script hasn't been supported in years.  Apply your changes or move towards Combat Master that has concentration built in.