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

[Encounter Helper] Reset Issue

Hi there! First I want to thank Jurt J. for his mods. I am clearly found of Encounter Helper API. It's clearly helpfull! I will be wonderfull if the reset option will work for me, but I am experiencing the same issue that makes crash the API with this error: ReferenceError: thisObj is not defined at apiscript.js:3329:21 at Array.forEach (<anonymous>) at resetEncounter (apiscript.js:3321:22) at apiscript.js:2932:45 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:1762: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) Is someone encountering the same issue? Maybe I am doing something wrong? Julien F.
1715525753
timmaugh
Forum Champion
API Scripter
Hi Julien .. In case the answer does not jump off the page for Kurt when he goes to look at his code, can you provide an example command line you are running that produces that error? Also, can you provide a screenshot of the other scripts you have installed? Either of these can, depending on the issue, bear on the source of the problem.
Of course! For the example, I am using the one-click button. I click on the reset button on my "cultistes" encounter it does the following command: !enchelp promptreset Cultistes It prompts the following message: "(From EncounterHelper): Confirm Reset for Cultistes" and I click on the confirmation that makes the following command: !eh reset Cultistes It displays : " (From EncounterHelper): Resetting encounter Cultistes to initial state" but nothing happens and the console shows the refence error message of mys first post and the API crashes.  For the scripts I have these ones:
1715686869
Kurt J.
Pro
API Scripter
Thanks Julien. I'll take a look.
1715782433
The Aaron
Roll20 Production Team
API Scripter
Looks like a copy/paste error.  This code: var theToken = getObj("graphic", mobid); if (theToken == undefined) { theToken = getObj("path", mobid); } if (thisObj === undefined) { thisObj = getObj("text", mobid); } should probably be: var theToken = getObj("graphic", mobid); if (theToken == undefined) { theToken = getObj("path", mobid); } if (thisToken === undefined) { thisToken = getObj("text", mobid); } Or possibly that part for dealing with text should just be removed?
1716335862
Kurt J.
Pro
API Scripter
I have updated the github version of the script to address this, but I haven't had a chance to test it out yet, so I haven't queued it for oneclick. If you want to give it a shot, it is at  ScriptCards/X_OtherScripts/EncounterHelper.js at main · kjaegers/ScriptCards (github.com) This version should also compensate for the problem of encounters being created on the gm layer.
Hello!  Thank you for the work. I will disable the oneclick one and test the github one. I will tell you if it is working. Yours, Julien
1716375733

Edited 1716448126
I have imported the script and disable the one-click one. However the reset does not work either. But this time the script does not crashed. It just displays the following errors, I presume one error per token in my example encounter (3 here). "Error resetting token -NxgoNBRtDf1vqLSC_H2#left=1505#top=245#width=70#height=70#bar1_value=9#layer=objects" "Error resetting token -NxgoLpDah3Rqlnef6-H#left=1435#top=245#width=70#height=70#bar1_value=9#layer=objects" "Error resetting token -NxgoOXa8ZllydXDGkyr#left=1575#top=245#width=70#height=70#bar1_value=9#layer=objects" However, there is no more feedback line on these errors than these ones. Here are the values in the Encounter Token if it can help: 01_Cultistesbis:-NxgoNBRtDf1vqLSC_H2#left=1505#top=245#width=70#height=70#bar1_value=9#layer=objects|-NxgoLpDah3Rqlnef6-H#left=1435#top=245#width=70#height=70#bar1_value=9#layer=objects|-NxgoOXa8ZllydXDGkyr#left=1575#top=245#width=70#height=70#bar1_value=9#layer=objects Yours, Julien