View Single Post
01/25/16, 08:42 AM   #6
coolmodi
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 47
Originally Posted by sirinsidiator View Post
2) ZO_SavedVars is a highly complex object. I am not sure if ZO_DeepTableCopy is enough to replace the values correctly. I don't personally use ZO_SavedVars, so correct me if I am wrong, but I think the right way to accomplish what you want is to just create a new ZO_SavedVars object and pass the values that need to be copied as defaults.
He wants to copy the settings between the character specific vars and the account wide ones. Creating a new object with the other's settings as default won't work as the values are already set. Default values are only used if the setting doesn't exist in the saved vars already. He could increase the version everytime to force it to overwrite it with the defaults though, but that may not be the best option I think

He should just make a function himself that sets all settings to the ones from the other SV and doesn't change the tables. That way it would work for sure.

And yes, the reload in my code there isn't needed, I could just change the reference and it should work fine.

Last edited by coolmodi : 01/25/16 at 08:46 AM.
  Reply With Quote