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

Movement Tracker Set-up/issues

I'd like to see how far my players move, and be able to activate and deactivate a system that shows me. Luckily, I found movement tracker, but I cannot get it to work. I haven't changed any settings, the script, or campaign assets AFTER I downloaded the script. The last time I attempted to use it, I received the error image below. This only started happening after I added tracker's API. I've attached other scripts in use for reference.&nbsp; The link to Movement tracker I copy &amp; pasted: <a href="https://gist.githubusercontent.com/DarokinB/5715738/raw/ddfaa1e38e79a664d21a0170094fd9d268e99b98/gistfile1.txt" rel="nofollow">https://gist.githubusercontent.com/DarokinB/5715738/raw/ddfaa1e38e79a664d21a0170094fd9d268e99b98/gistfile1.txt</a>
1608113138

Edited 1608114687
Oosh
Sheet Author
API Scripter
Have you ever used the turn tracker in this campaign? It looks like the script is checking to make sure the turn order isn't empty, but it seems to be trying to parse a completely empty value, rather than an empty array. Try adding someone to the turn order, then running it again. Then clear the turn order and see if the error comes back. It's easy enough to add some extra checks in there for a completely blank turn order, it just doesn't seem like something that should be happening. An empty turn order doesn't cause any issues for me, it returns an empty array if I clear it and run that section of code (then cleanly exits when it checks the length, instead of throwing an error). I can't think of why the turn order would be completely blank... unless another script is deleting it? Someone else may have a better idea, I haven't played around with it much. edit - ah ok, the API Objects page does warn that a blank value is possible. If you search through the script for "JSON.parse(c", you should find 7 instances. If you replace these two lines: var c = Campaign(); var turn_order = JSON.parse(c.get('turnorder')); with these two lines: var c = Campaign().get('turnorder').trim(); var turn_order = (c.match(/\[.*\]/)) ? JSON.parse(c) : []; in each of the 7 instances, that should get rid of the error.