Hello all so I'm gonna do a little documentation on the functions regarding storage in Game lab
[FUNCTION EXPLANATION HERE]
setKeyValue(key, value, callback?)
getKeyValue(key, callback?)
by using this function it's important to understand the parameters as such I'll describe them below in this format
name: (type's that are accepted by the parameters + ? displays that it's optional)
-> key: (string) basically serves as a var declaration in a database
-> value: (any) this is basically the setter from the key declaration
-> callback?: (Function(param?)) not necessary, however it is needed for getKeyValue while it's used less in setKeyValue / see more at demo examples
[USE CASES HERE]
when setting key values it is asynchronous meaning that it does not update in real time, as such callbacks are necessary if you wish to access the necessary information once it is update you will need callbacks, in order for your program to operate without needing to be halted for loading in a save it may be best to set default parameters when it's initialized
var stored = "";
setKeyValue("test", "World", function() {
// the only way to retrieve a set value is by using getKeyValue, however you can update a local var with the info
getKeyValue("test", function(value) {
stored = value;
console.log("Hello "+ stored);
})
})