Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Retreiving data using dataSaver.load - Gideros Forum

Retreiving data using dataSaver.load

simransimran Member
edited June 2014 in General questions
I am saving the game scores using dataSaver.save(), but not able to retrieve them.Here is my code

Here is what I have tried:
--in init()
self.sets = {}
self.sets[1] = 0
--in EnterFrame
if collision then
sets = dataSaver.load("|D|Scores")
for _, val in pairs(Scores) do
table.insert(self.sets, val) --value in self.sets are not getting inserted
self.Highest = self.sets[#self.sets]
count = count + 1
dataSaver.save("|D|Scores", count)



  • HubertRonaldHubertRonald Member
    edited June 2014
    Hi @simran

    Try the next in your main.lua
    sets = dataSaver.load("|D|sets") -- loading data
    if  (not sets) then -- create "sets" if it doesn't exists
    	sets = {}
            sets.Scores = 0
            sets.GodMode = false
            sets.Goals = {}
    	dataSaver.save("|D|sets", sets)
    -- "sets" should be a global variable because you'll use it in different class
    For more detail check these links of our friend @ar2rsawseen


  • Hi Simran.
    Don't use load and save table in OnEnterFrame!
    Try saving Score in global parameter and when you need it save the value in table by dataSaver
Sign In or Register to comment.