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

Sandbox Crashing on Turn Change [5e Shaped]

Recently swapped from OGL to Shaped and I can't get this error to stop popping up when I hit the "Next Turn" button. TypeError: Cannot read property '1' of null TypeError: Cannot read property '1' of null at apiscript.js:14333:89 at /home/node/d20-api-server/node_modules/underscore/underscore.js:440:19 at each (/home/node/d20-api-server/node_modules/underscore/underscore.js:188:9) at Function.groupBy (/home/node/d20-api-server/node_modules/underscore/underscore.js:439:7) at _.<computed> [as groupBy] (/home/node/d20-api-server/node_modules/underscore/underscore.js:1638:39) at RestManager.rechargeDieRollUses (apiscript.js:14333:9) at apiscript.js:14322:52 at /home/node/d20-api-server/api.js:3066:5 at Function.each (/home/node/d20-api-server/node_modules/underscore/underscore.js:188:9) at handleSheetWorkerComplete (/home/node/d20-api-server/api.js:3065:5)
1597180421
The Aaron
Roll20 Production Team
API Scripter
That's going to be a hard one to track down.  I'm pretty sure this is the line that's failing:       .groupBy(attribute => attribute.get('name').match(/^(repeating_[^_]+_[^_]+)_.*$/)[1]) Something left over from the 5eOGL sheet has a similar name, but not the expected format.  Try putting this script in and see what it outputs to chat: on('ready',()=>{ let names = [...new Set( ...findObjs({ type:'attribute' }) .filter(a=> /^repeating_(?!armor|equipment|offense|utility|action|reaction|spell|lairaction|regionaleffect).*$/.test(a.get('name'))) .filter(a=> !/^(repeating_[^_]+_[^_]+)_.*$/.test(a.get('name'))) .map(a=>a.get('name')) )]; sendChat('',`/w gm <div><ul><li>${names.join('</li><li>')}</li></ul></div>`); }); If it has output, I can probably fix it with a modification to the above.
1597183464

Edited 1597184185
Hmmmm. Okay.. Edit: The error seems to not trigger on the Monk. Always triggers on the spellcasters.
1597192894
The Aaron
Roll20 Production Team
API Scripter
If you want to pm me an invite and GM me, I think I can fix it. 
Try turning off the refresh uses on turn option in the Shaped5e config. Maybe that has something to do with it?
1597195798

Edited 1597195832
Victor B.
Pro
Sheet Author
API Scripter
Why is it getting into restmanager at all?  Is there something you can set on 5e shaped to rest?  
@Juan That seems to solve it. So it has to do with the turn recharge for sure.
1597266295

Edited 1597266365
I wouldn't use any rest manager for the Shaped 5e sheet since it already has (imo) most of the basic rest functionalities including restoring spells and class/race features, recovering hit dice, among others, for both long and short rests, 5-6 recharges, on turn, manual recharges, etc.
1597266372
The Aaron
Roll20 Production Team
API Scripter
The RestManager in question in the above callstack is the one in the Shaped Companion script.
1597267192

Edited 1597267455
Since I am in the process of transferring from a two year use of OGL to Shaped I'm sure there are quite a few things that were previously set up that will cause small complications or be unnecessary now.  I've essentially gotten rid of half of my API library since the shaped sheet does so much already.  That being said, I keep getting the "Slots Police" error when I have "Automatically expend spell resources" checked. And having "Automatically use ammo" checked doesn't actually deduct ammo. Probably some conflict with the previous settings. Still a pain in the butt to figure out. I feel like I'm untangling Christmas lights.
The Aaron said: The RestManager in question in the above callstack is the one in the Shaped Companion script. Oh, I see now.