How do I change webstorage to local storage same values?

Get help using Construct 2

Post » Tue Apr 12, 2016 7:22 pm

hi i have an old project capx with webstorage and value "cont" for "continue"
Image

how to convert that to localstorage???
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Wed Apr 13, 2016 3:24 am

In Local Storage, there is no more every tick checking for item existence because in Local Storage it will be a trigger and adding Every(X) seconds on the condition will be inefficient .But without that, It should be like this..

--Without Regular every tick Item Check "Local key "Cont" exists (Efficiecnt)--

*System -> Trigger Once
--------->Local Storage -> Check Item exists("Cont")

*Local Storage -> On Item exists("Cont")
--------->System -> Set Global Variable Value "level" to LocalStorage.ItemValue
--------->Sprite -> Set Animation Frame to 1

--With Regular every tick Item Check "Local key "Cont" exists (Inefficiecnt)(Not a good idea but it is more like a WebStorage because of the regular every tick item checking)--
In this case, I rather recommend finding a new way to check if Item exists like above or use variables to check rather than this method.


*System -> Every(dt) Seconds
--------->Local Storage -> Check Item exists("Cont")

*Local Storage -> On Item exists("Cont")
--------->System -> Set Global Variable Value "level" to LocalStorage.ItemValue
--------->Sprite -> Set Animation Frame to 1
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,862


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 50 guests