I must say I'm very frustrated by LocalStorage, I have tried switching my project over to it from WebStorage and really having trouble. I retrieved a lot of data from WebStorage from within functions, and this just doesn't seem to be supported now, as every retrieve needs a separate trigger which I can't put inside my functions. The GetKeyAt expression only allows you to grab a key by number rather than name, which is no use to me.
Is there really no way to just retrieve a key by name from within a function and then use that value? As an example, I just want to run a function, retrieve the height and width of an array from 2 LocalStorage keys and then run loops using those 2 values. This was very easy with WebStorage, but now it seems like I'll have to do something extremely complicated just to accomplish the same thing. Unless I'm missing something?
Hi,
the problem about LocalStorage is, that you have to fetch the key first in order to get the information behind that key. This makes it more complicate than using Webstorage.
I managed it the way that I load the LocalStorage on the start of the layout into an array. Then during the game I'll enter the updated variables first into the array and then the array to the LocalStorage.
If a further function needs a specific value, I will fetch it from the array, not from the LocalStorage.
Maybe this helps you for your project.
Regards
Andreas