Author Topic: How do i backup/restore values saved in the profile between profile imports?  (Read 4752 times)

sabotrax

  • Guest
Hello,
I'm working on a Star Citizen profile where I'm saving values in it. When people download the new version (delete the old, import the new), their previous saves are gone.
How do I backup/restore saved values or is there a better way to do this?

Greetings,
Marcus

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
If you want the values to survive a profile update (which, as you noticed, involves an actual delete+import, with the 'delete' part being the problem) then you have to implement your own storage scheme

The easiest way to do this is by using the "read/write text to a file" actions, but it might get a bit messy if there are many values you need to store... a more complex alternative, but with more control, is by using a plugin or the new Inline Functions of the latest betas
« Last Edit: January 12, 2017, 10:40:15 AM by Antaniserse »
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Antaniserse is correct.  When you export a profile, the data does not go with it, as that could cause problems for others and/or expose your own data.  This is by design.  You will need to come up with your own data storage/retrieval solution to maintain data outside of VA.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Correct me if I'm wrong, but I'd assume profile-saved variables are tied to the profile, not the commands.
If you were to delete all commands within a profile, and then import the commands from the new profile into the "shell" of the old one, would the saved variables not remain intact?

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Correct me if I'm wrong, but I'd assume profile-saved variables are tied to the profile, not the commands.
If you were to delete all commands within a profile, and then import the commands from the new profile into the "shell" of the old one, would the saved variables not remain intact?

Yes, that works too, assuming all the variable names are kept unchanged from the previous version

Slightly more tedious and error prone than replacing the whole profile, but it's a good alternative that does not require additional code
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin