Issue with multiple Saved Vars in 1 metafile
Hello,
In one of the project I have, I got multiple saved vars. There declared as is : Lua Code:
DATAMINED_DATA DATAMINED_BOOKS are a bit linked together. DATAMINED_DATA is built by a function, no problem. Then I got another function, which does this : Lua Code:
then DATAMINED_BOOKS is altered several times When saving, changes are repercuted in both variables. This first issue is easy to handle, because both variables (two arrays of hundreds of thousands of lines) are equal.. Another issue is with eideticReverse eideticHomonym eideticReverse is linked to a slash command, the array is built. eideticHomonym is linked to a another slash command, the array is built. eideticReverse & eideticHomonym are in the same Lua file but each one got its own function they don't have anything in relation, except being in the same Lua file and the metafile. When I run the function which build eideticHomonym, 1 column is written in eideticReverse variable and so the code is totally faked. the possibilities for me are to change the metafile (remove one of the 2 vars) before executing code in order to avoid this, Or merge the whole data into one super array, like ZO_Ingame does. If its a known bug, or something. The var POSTMAIL_DAEMON is built from datamining since months, and I wouldn't lost it due to this issue ... PS: I don't use the ZO_SavedVars object. |
Lua Code:
Just gives you another way to look up the table pointed to by DATAMINED_DATA. If you want to make a copy of DATAMINED_DATA into DATAMINED_BOOKS and then do operations on it, use either ZO_ShallowTableCopy or ZO_DeepTableCopy. Iirc, the deep copy preserves any metatables while shallow only copies the actual data. (I think you knew this, just expanding for completeness). As for the other issue, I'd have to monkey around with it to see for myself and I dont have time today :banana: |
Quote:
http://www.esoui.com/forums/showpost...5&postcount=33 http://www.lua.org/source/5.1/lcode.c.html#addk http://www.lua.org/source/5.1/lopcodes.h.html#SIZE_Bx |
All times are GMT -6. The time now is 09:18 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI