Thread Tools Display Modes
12/08/16, 11:53 AM   #1
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
SavedVars

I'll probably end up needing to post the code when I can, but I can at least describe the problem:

The script is indexing item name data to the SavedVars. It's supposed to put it in a table in a table (which it does), but randomly it'll end up putting some of the table vars in there as indexes with empty data. Such as SavedVars, @Rhyono, Defaults, a few of the data pieces as variable names (e.g. instead of [index] = data, it's [data] = "").
  Reply With Quote
12/08/16, 01:21 PM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
I saw this long time ago when we were corrupting data because of too large files..

How big is your file ? do you play in 32bits?

You should use 64 bits client and avoid saved vars of more than 32MB and avoid arrays of more 10k entries.
  Reply With Quote
12/08/16, 01:27 PM   #3
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
Originally Posted by Ayantir View Post
avoid arrays of more 10k entries.
We have found the problem! :P

I had been saving it to file for easier load on the client, but I may just return to having it assemble it on demand live rather than saving it in a file.
  Reply With Quote
12/08/16, 02:52 PM   #4
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
data from savedvars use a lot more memory and create loading incredibly much longer than rebuilding from scratch.

If your data don't need to be altered by user, generate it from API calls at startup, or if your data can't be accessed throught API, just provide big arrays of static data.


per example lorebooks addon with ~15k sub entries of static data only use 3MB in memory.
  Reply With Quote
12/08/16, 03:55 PM   #5
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
Ah, good to know. Rebuilding each time is definitely the way to go then. Thanks!
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » SavedVars

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off