Maintenance for the week of December 23:
• NA megaservers for maintenance – December 23, 4:00AM EST (9:00 UTC) - 9:00AM EST (14:00 UTC)
• EU megaservers for maintenance – December 23, 9:00 UTC (4:00AM EST) - 14:00 UTC (9:00AM EST)

upgrade saved variable

cyx54tc
cyx54tc
✭✭✭✭
I wonder if it is possible to upgrade saved variable. For example I had a version 1 savedvar, then later I decide to make some changes and the newer one is version 2. I want to be able to retrieve the version 1 var, update it and save it as version 2. In the above scenario if I call ZO_SavedVars:NewAccountWide with version = 2 directly it will wipe the version 1 var. If I call ZO_SavedVars:NewAccountWide with version = 1 then the version 2 vars will be wiped. Any one got a good way to solve this?
  • WandaMey
    WandaMey
    ✭✭✭
    I think you can declare several savedvars in your manifest then they should make different tables in your saved vars.

    ## SavedVariables: MyAddonVars MyAddonVarsv2 MyAddonVarsv3

    never tried though.
    if it works you should be able to copy what you need from MyAddonVars to MyAddonVarsv2 if the second is empty.
    Then next loading, if the new one has data, you can empty the previous version (if you dont need it anymore). No need to keep all data twice. I imagine you have a lot if you absolutely dont want to wipe and rebuild them from scratch.

    PS for this kind of help you should visit ESOUI forums.
    Edited by WandaMey on November 24, 2015 1:45AM
  • cyx54tc
    cyx54tc
    ✭✭✭✭
    WandaMey wrote: »
    I think you can declare several savedvars in your manifest then they should make different tables in your saved vars.

    ## SavedVariables: MyAddonVars MyAddonVarsv2 MyAddonVarsv3

    never tried though.
    if it works you should be able to copy what you need from MyAddonVars to MyAddonVarsv2 if the second is empty.
    Then next loading, if the new one has data, you can empty the previous version (if you dont need it anymore). No need to keep all data twice. I imagine you have a lot if you absolutely dont want to wipe and rebuild them from scratch.

    PS for this kind of help you should visit ESOUI forums.

    Interesting solution there. I will definitely take a note of that.
    And yea I guess ESOUI would be the place to go
    thanks again
Sign In or Register to comment.