11/09/14, 06:36 AM | #1 | |
brekal
Guest
Posts: n/a
|
UI Error - function expected instead of nil value
Hey,
I'm trying to make some Alchemy Addon to help me get an overview of the ingredients i have in my bag. When logging into the game or reloading the UI it checks my backpack for some predefined Ingredients and saves the initial amount into a list. As soon as a bagupdate happens, it checks if it is an ingredient and counts one to the existing value in the list. The Function with the bagupdate works well but the function for getting the initial amount in my backpack throws an error. The error is: function expected instead of nil value. The line is Lua Code:
When I dump the two variables "name" and "count" they are defenitly not nil. Here is the code of my lua-file: Lua Code:
Do you have any suggestions? thanks in advance Last edited by brekal : 11/09/14 at 12:47 PM. |
|
brekal |
11/09/14, 09:27 AM | #2 | ||
|
|
||
11/09/14, 10:12 AM | #3 |
Your function which scans backpack wont work correctly. There are two issues: slotIndex starts with 0, and you should be scanning all bag slots not just numUsedSlots. It is because not all slots are full.
Lua Code:
As for the UI error - how is your addon manifest look like? It seems that you use LootManager in your XML for top level window. If xml file is listed after lua file in the addon manifest, your LootManager table defined in lua will be overwritten by the top level window defined in xml. |
|
11/09/14, 12:26 PM | #4 | |
brekal
Guest
Posts: n/a
|
thanks for your response,
@merlight: but I cant imagine that this is the reason because it is a comment. @garkin: I updated my first post with the whole lua-file - so everything shows up now. my txt-file looks like this: Lua Code:
and the xml-file looks like this: Lua Code:
btw - i deleted all the "saved-variables" stuff - because i dont need it now. Last edited by brekal : 11/09/14 at 12:42 PM. |
|
brekal |
11/09/14, 12:45 PM | #5 | |
|
Between loading your add-on Lua & XML files, and calling your ON_LOADED handler, the game reads your saved vars file and replaces the table. |
|
11/09/14, 02:08 PM | #6 | |
brekal
Guest
Posts: n/a
|
hmmm ... ok - i didn't know that.
thx for this info. nevertheless i still get the same error. Last edited by brekal : 11/09/14 at 02:34 PM. |
|
brekal |
11/09/14, 04:26 PM | #7 |
|
I suggest you try d("LootManager:", LootManager) before the offending call. Perhaps you have another addon using the same global name; with the dump you should at least see what's in there.
|
11/11/14, 01:39 PM | #8 | |
brekal
Guest
Posts: n/a
|
finally, the error disappeared over night -_-
I didn't change anything and when I started the game today no error occured. Thanks for your help. :-) |
|
brekal |
ESOUI » Developer Discussions » Lua/XML Help » UI Error - function expected instead of nil value |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|