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

Error with OGL char sheet !longrest script

Hello, I've installed the 5e OGL companion script and have been testing the !longrest feature. I have also installed the ChatSetAttr script in order to replenish the class resources on the char sheet. I have 4 PC tokens, and for 3 of them the script works as it should, replenishing spells (in the case of a sorc), hit dice and class resources as expected. However, in the case of a paladin character, I get the error listed below when I try to use this !longrest macro (which I borrowed from someone here on the forums - sorry forgot who that was). Thanks for any help you all may be able to provide! Macro: !longrest @{selected|character_name} !setattr --silent --sel --class_resource|@{selected|class_resource|max} !setattr --silent --sel --other_resource|@{selected|other_resource|max} &{template:atk} {{desc=**@{selected|character_name}** *Long Rest Taken* Reset HP, Spell Slots, @{selected|class_resource_name}, @{selected|other_resource_name}}} Error message: TypeError: Cannot read property 'get' of undefined at longrest (apiscript.js:1431:39) at handleapicommand (apiscript.js:1156:13) at apiscript.js:1113:13 at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1634: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 Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400
1531147617
Victor B.
Pro
Sheet Author
API Scripter
did you have a token selected when you ran it?  
Yes, token selected. It works for 3 out of the 4 characters. I'm not sure what is different about the one PC that does not work. All of these characters were made with the charactermancer with the 5e OGL sheet prior to the companion script being installed.
Can you verify that the failing character has a hit_dice attribute?
Yes, the hit die of the char is set to D10 (as selected from the drop down menu) and the character presently has 1 hit die and 2 hit dice max (level 2 char). I set them that way specifically for testing purposes.
Can you try manually deleting the hit_dice attribute from the Attributes & Abilities tab and then re-enter the testing values in the Character Sheet tab > CORE page.
Yes, I had tried that with a few different values previously to no effect. I always set the max hit die to a higher value than the current hit die obviously. Nothing changes the outcome, there is always an error upon !longrest.
I managed to resolve the issue. It turns out there was a second character that was created with the same name, which was difficult to detect in the journal because it was at the very bottom and we are running tomb of annihilation, so there is a lot of content. The existence of that second character caused the script to crash. By renaming the dummy character it no longer creates the error message.