View Single Post
01/04/24, 11:21 PM   #2
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 410
So, in debugging something that gives an error like that, the first thing to check is what line/piece of code is causing the issue.
You haven't provided line numbers, but the error originates from line 4 of your code snippet. So you can drill down on that particular line.
Looking at the error again, it says 'function expected instead of nil.' Or, in other words, you tried to call a function, but the function was did not exist (nil being similar to null)

So you are trying to call a function that does not exist on line 4, so it's a good idea to then check the functions used on that line closely. If you do /script d(GetJounalQuestInfo) you'll see that the output is nil! Compare that to /script d(GetNumJournalQuests) where you get something like function: 0000012BB24BF7E0.

Now at this point, if you look veeeeery closely, letter by letter, at the function you're calling, you might see the problem.
GetJounalQuestInfo

In this case it was a simple typo, but in cases where it isn't a typo, double checking https://wiki.esoui.com/API for the function name, or maybe inspecting the table (if the function you're trying to call is on a table) using /zgoo or torchbug can help you to find out why a function you're trying to call is nil. For reference, I had to look at the API page for the actual function name before I noticed it was a typo
  Reply With Quote