Datastores have been a concern for me for a long time, and no, it’s not just data loss.
This is a really simple question, will data be lost/mixed up if I were to add new data?
This is my ultimate concern:
Let’s say that this was the data that was going to be saved when the game just got released:
Coins -- Value is 1
Wins -- Value is 2
Losses -- Value is 3
and then save it with SetAsync
or UpdateAsync
from getting the data stored in a table:
local Statistics = Stats:GetChildren()
local TOV = {}
for i, Stat in pairs(Statistics) do
table.insert(TOV, Stat.Value)
end
DSS:SetAsync(UniqueKey, Statistics)
the table would look something like this
local TOV = {1, 2, 3}
And then in the future, I add an update that adds a new value:
Coins -- Value is 1
Wins -- Value is 2
DamageDealt -- Value is 0
Losses -- Value is 3
As you can see, table TOV stores the data for Coins
, Wins
, and Losses
, but not for DamageDealt
. This is my concern. When the data loads in again, the values would be changed:
Coins -- Value is 1
Wins -- Value is 2
DamageDealt -- Value is 3 [Should be 0]
Losses -- Value is 0 [Should be 3]
Is this a problem? If it is can you overcome it?
If you don’t get my question, I can elaborate it, you just need to ask.
Thank you so much.