> I don't think any of that changes the basic fact that you can't pretend asynchronous code is synchronous. It breaks assumptions like the events will run in any particular order, which the existing system makes obvious by making you use triggers in a separate event. Anything which looks like a simple comparison/access but really is asynchronous in the background would be even worse than we have now - it would just silently break or fail to work as you expect in random situations!
>
> I wrote up an idea for a "then" event to try and make things like this easier, but it's not supported and I'm not sure how much it would really help anyway: https://www.scirra.com/forum/idea-make-async-easier-with-quot-then-quot-event_t128870
>
Then a trigger on the event sheet on you say "load storage" and this event loads all the keys and sets to the variables you previously defined and in the case they are missing (first time running) sets to 0 or whatever you defined previously.
And for save another unique event. Now i have to do "get item" event and after a "set item" event, or there is another way to do in a unique event? . If not, will be great simply when X happens set Key.BestScore(The local storage) to BestScore(Global variable).
This is what i'm doing, is correct?
There is no way to save the "get item" event? and in the comparision say something like:
LocalStorage.key.BestScore
I think you need to take a step back and understand the fundamentals of async calls. what you are trying to do won't work. A quick google will bring you many results on the differences.
The way you are trying to use it is how the old storage worked, it was a sync call. New standards of browsers that is deprecated as I understand it and you need to use async methods.
Once you step back, and understand how/why it works, it is not bad at all.