How do I use the LocalStorage Plugin?

Get help using Construct 2

Post » Wed Sep 23, 2015 11:42 am

AndreasR wrote:
ALLMarkMade wrote:I just want to add a High Score to my game so if the last score was higher it changes to that new high score and saves it and shows it. If it's not then it stays the same. I could do that easily with Web store but I'm a little lost doing it with local Storage.

Thank you in advance for your help.

AllMark


Hi,

I have a HighScore example in my dropbox folder, just check it out here ;)
https://www.dropbox.com/sh/7afzvo1w0mro ... l--Za?dl=0

Regards



I am so frustrated lol!

I downloaded your Highscore example and, ( used my own names ) but it does not store or show the HighScore. Looking at it, It should work but it does not. I also tried some other examples but still nothing.

best regards / j
B
6
S
1
Posts: 3
Reputation: 360

Post » Wed Sep 23, 2015 12:44 pm

Try to clear your cookies and cache. Then try again ;)

@epic2d
Can you attach a screen shot or the capx file?
Image Image iTunes: Match3 | Google Play: Match3
B
109
S
40
G
31
Posts: 1,177
Reputation: 29,418

Post » Wed Sep 23, 2015 4:20 pm

AndreasR wrote:Try to clear your cookies and cache. Then try again ;)

@epic2d
Can you attach a screen shot or the capx file?


I cant seem to attach any img files, Im new at this forum :)
B
6
S
1
Posts: 3
Reputation: 360

Post » Wed Sep 23, 2015 5:07 pm

epic2d wrote:
AndreasR wrote:Try to clear your cookies and cache. Then try again ;)

@epic2d
Can you attach a screen shot or the capx file?


I cant seem to attach any img files, Im new at this forum :)


You can mail me the images or the file :)
contact[at]shatter-box.com

I gonna check it then.

Regards
Image Image iTunes: Match3 | Google Play: Match3
B
109
S
40
G
31
Posts: 1,177
Reputation: 29,418

Post » Tue Oct 06, 2015 5:48 am

i have variable in sheet one
but sheet 2 is not getting sheet 1's update value
Image
B
72
S
42
G
48
Posts: 688
Reputation: 34,392

Post » Tue Oct 06, 2015 8:41 pm

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?
B
15
S
5
Posts: 142
Reputation: 1,659

Post » Wed Oct 07, 2015 12:56 pm

luckyrawatlucky wrote:i have variable in sheet one
but sheet 2 is not getting sheet 1's update value


Please provide always a capx example, otherwise it's nearly impossible to say what your issue is.

Regards
Image Image iTunes: Match3 | Google Play: Match3
B
109
S
40
G
31
Posts: 1,177
Reputation: 29,418

Post » Wed Oct 07, 2015 1:02 pm

SecondDimension wrote: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
Image Image iTunes: Match3 | Google Play: Match3
B
109
S
40
G
31
Posts: 1,177
Reputation: 29,418

Post » Thu Oct 08, 2015 4:50 am

AndreasR wrote:
luckyrawatlucky wrote:i have variable in sheet one
but sheet 2 is not getting sheet 1's update value


Please provide always a capx example, otherwise it's nearly impossible to say what your issue is.

Regards



here is capx
https://www.dropbox.com/s/yhwozpqlcbwle ... .capx?dl=0
Image
B
72
S
42
G
48
Posts: 688
Reputation: 34,392

Post » Sun Oct 11, 2015 8:30 am

luckyrawatlucky wrote:
AndreasR wrote:
luckyrawatlucky wrote:i have variable in sheet one
but sheet 2 is not getting sheet 1's update value


Please provide always a capx example, otherwise it's nearly impossible to say what your issue is.

Regards



here is capx
https://www.dropbox.com/s/yhwozpqlcbwle ... .capx?dl=0


Hi,
I already saw your capx example. But you are using a beta version and I use the latest stable version.
So I'm not able to open your project. I don't want to use a beta version for my projects-

Do you have an older version of it? Otherwise we have to wait till the stable version comes out.

Regards
Image Image iTunes: Match3 | Google Play: Match3
B
109
S
40
G
31
Posts: 1,177
Reputation: 29,418

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: BiffanyPFH and 30 guests