THANK YOU for the local storage update, all is good now :D

Discussion and feedback on Construct 2

Post » Wed Apr 22, 2015 3:11 am

THANK YOU for setting the ItemValue to the key value without "Get item" action.
Local Storage is now a full replacement for WebStorage.
Yes it is asynchronous but that is ok now because the *trigger within a trigger* nonsense is over.

I can see the slow death of webstorage in Construct 2 now.
People, please stop using Webstorage for all your future projects, Local Storage is ready for prime time :)

Thank you @Ashley.
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Wed Apr 22, 2015 3:54 am

@toddler the local storage looks promising. This also works fine with devs using cocoonjs.
sleep is only for the weak!
B
91
S
30
G
12
Posts: 139
Reputation: 11,992

Post » Wed Apr 22, 2015 4:13 am

Oh I spoke too quickly, it seems if you make more than one request at the same time, the "itemvalue" will be overridden in all the wrong sequence depending on the latest retrieval UNLESS you use item get.

I ended up still having to use on item get.
It's ok, I think I understand why this will be an issue.

It's alright.

But kinda still a bug though, lol.

So people, the correct sequence to using Local Storage is:

Step 1:
Check if Key Exist.

Step 2:
If Key doesn't exist triggers, do your shit.
If Key DOES exist, call "get item" for that key.

Step 3:
Trigger happens from get item, retrieve it via itemvalue.

Yes Webstorage does it all in one line but it seems those days are decidedly over now :(


======================================================================
Old Method:
Image

New Method:
Image
======================================================================

I've finally bite the bullet and change it, for all of you still deciding, remember, the more you add to your game, the more it is going to be difficult to comb through and remove your webstorage, yes I know you probably group it properly but CAN YOU BE SURE ?
Better fix it while your game is still small, or even if it is big, do you want to fix it when it is Bigger ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Wed Apr 22, 2015 9:38 am

ItemValue is set to the correct value in the 'On item exists' trigger, as of r203, so you should not need to use a 'Get item' action in 'On item exists'. However it's not set in 'On item missing', since, well, there is no item :)
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Post » Wed Apr 22, 2015 10:44 am

@Ashley, looks like you messed up big time with this release ;p
Now Local Storage doesn't even work.
Image

LOL :D
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Thu Apr 23, 2015 10:14 am

Yeah, accidentally used a new JS feature which Chrome supports but Firefox doesn't yet. It's already fixed for the next beta.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Post » Thu Apr 23, 2015 1:32 pm

can i use local storage for saving highscore ?
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Post » Thu Apr 23, 2015 2:46 pm

@Ashley
Well, first of all thanks for your work

I would like to read the documentation of the "Local Storage" since there is nothing in the manual yet (maybe because it's still in beta)
Thanks for the fixes in R203, now it's easier to use it, without having to use another 'Get item'
B
89
S
28
G
11
Posts: 652
Reputation: 11,428

Post » Thu Apr 23, 2015 5:41 pm

matrixreal wrote:can i use local storage for saving highscore ?


YES you can, I am using it now and it functions PERFECTLY.
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Thu Apr 23, 2015 5:44 pm

Ashley wrote:Yeah, accidentally used a new JS feature which Chrome supports but Firefox doesn't yet. It's already fixed for the next beta.


It is really depressing to hear this, Firefox was once the big game of the town.
And now, Firefox doesn't play many of the webGL features and now this...
If it is not for Firefox's ability to download videos, I would have stop using firefox completely by now.
B
12
S
3
Posts: 288
Reputation: 1,694

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests