I have a dictionary that gets saved to local storage every X minutes.
When the game starts I want it to load the dictionary from local storage if it exists. If it doesn't exist (ie the game has never been started before) I want to load the dictionary from a game file.
1. There is no event "if doesn't exist" and
2. It takes time to check exists so I don't want other events to continue until it is checked and loaded.
Link below is to an example capx of where I have got to but not working 100%. Any help appreciated
There is an if doesnt exist - 'item is missing'
Develop games in your browser. Powerful, performant & highly capable.
There is a useful new action "Wait for previous action to complete" for asynchronous operations like LocalStorage or AJAX. Change your code like this:
Thankyou —, I missed that tor some reason
Thankyou dop2000, that's a much cleaner solution and good to know about the wait action. Very handy.