Hi there,
I’m using the ICE module.
My question is to others who have used it about the first ever app loadup.
Currently i load my ‘icebox’ and then retrieve some data from it.
If it doesn’t exist i create it as the default value.
myData = ice:loadBox( "myData" )
local MuteSound = myData:retrieve( "MuteSFX" )
local MuteMusic = myData:retrieve( "MuteMusic" )
local Coins = myData:retrieve( "Coins" );
if (MuteSound == nil) then
myData:store("MuteSFX", 0);
myData:save("MuteSFX");
print("SFX Saved")
end
if (MuteMusic == nil) then
myData:store("MuteMusic", 0);
myData:save("MuteMusic");
print("Music Saved")
end
if (Coins == nil) then
myData:store("Coins", 0);
myData:save("Coins");
print("Coins Saved")
end
...
The very first time an app is played, it’ll go through creating all the data. Any subsequent time it wont.
Is this the best way to do this?
Since i have alot and maybe more! But i can’t think of a way to save them all or state them all without doing it this way.
How do you people do it?
Thanks,
Matt [import]uid: 91798 topic_id: 21932 reply_id: 321932[/import]
[import]uid: 87138 topic_id: 21932 reply_id: 87225[/import]