Advertisement Create a free account

[Crash/Troubleshoot] 5th OGL API Ammo tracking crashing when using specific weapons/ammo

1549687270

Edited 1549693310
This is my first time running into an error I couldn't troubleshoot so I figured why not ask the great Roll20 community :) I had been trying to mess around with making a macro for Fighter's Second Wind, essentially creating an attack that uses the resource as ammunition, plugging the ammo=id from the attack into a template:atk d10 roll. Although I couldn't get it quite right my ammo tracker started doing this:     The ammo tracking portion is no longer inline and is separated and improperly formatted for all ammo tracking. I decided to revert all my changes and then delete/re-enable the script but this issue persisted. To help with troubleshooting:  Sheets:  D&D 5e by Roll20 Scripts:  5th Edition OGL by Roll20 Companion, PowerCards, ChatSetAttr Sheet settings:  ammo tracking is enabled on the character sheet Resource:  enabled Use As Resource:   enabled Any help is much appreciated! EDIT: The below issue was resolved. A player had re-uploaded his old character into his journal again and since they had the same name there was a conflict. I still do need help figuring out why the ammo tracking is separated. Then when I attempted to attack with a Longbow +1 that tracks regular Arrows as ammo, this happens in console and the script crashes TypeError: Cannot read property 'set' of undefined TypeError: Cannot read property 'set' of undefined at handleammo (apiscript.js:2558:16) at apiscript.js:2124:17 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
1549740759

Edited 1549740871
Scott C.
Pro
Sheet Author
API Scripter
It is separated because the ammo tracking message is sent from the script after the attack is rolled. It is a separate message and so is separated. Additionally, it looks like the script is set to send the message from the GM's account regardless of who actually used the ability so this prevents the ogl's roll template formatting from making it look like the second message is part of the first message. Edit: note I'm not actually sure if changing the script to message "from" the ability's user would resolve the display issue.
Thanks for helping me out Scott!  Yeah, that makes sense. It does seem like that is how the script is intended to work, given that in the images on the wiki the attacks are followed by a separate gray message box. But the style of those boxes seem different than what I have, why is that? Scott C. said: It is separated because the ammo tracking message is sent from the script after the attack is rolled. It is a separate message and so is separated. Additionally, it looks like the script is set to send the message from the GM's account regardless of who actually used the ability so this prevents the ogl's roll template formatting from making it look like the second message is part of the first message. Edit: note I'm not actually sure if changing the script to message "from" the ability's user would resolve the display issue.
1549808972
Scott C.
Pro
Sheet Author
API Scripter
The 5e by Roll20 sheet has two stylings. I believe you can change between them in the sheet's settings menu.
1549819319
keithcurtis
Forum Champion
The D&D styling is also relatively new, and the wiki images may predate that.
Thank you guys for all the help! I'll dig into changing the style and hopefully it'll look the way I'd like, but everything seems to be functioning as intended.