How do I use the LocalStorage Plugin?

1 favourites
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • AndreasR

    Thank you.

    I must say that WebStorage is far better in this particular task.

    This was all i needed to write for this to work:

    WebStorage local key "x" <= 9 | WebStorage set local key "x" to "0"&WebStorage.LocalValue("x") and that was it, i turned my number "9" to "09".

    With LocalStorage for the same task one must use external variables, write functions and write dozen lines of code (not to mention errors that popup in both these examples).

    Thas in my book total rubbish... but if Ashley thinks that this is better who am i to argue?

    Anyway thank you for all your help.

  • AndreasR

    Thank you.

    I must say that WebStorage is far better in this particular task.

    This was all i needed to write for this to work:

    WebStorage local key "x" <= 9 | WebStorage set local key "x" to "0"&WebStorage.LocalValue("x") and that was it, i turned my number "9" to "09".

    With LocalStorage for the same task one must use external variables, write functions and write dozen lines of code (not to mention errors that popup in both these examples).

    Thas in my book total rubbish... but if Ashley thinks that this is better who am i to argue?

    Anyway thank you for all your help.

    You're welcome

    LocalStorage isn't much more complicated then WebStorage. It's just diffrent

    Let me know if you have further questions, I'm glad to help!

    Regards

    Andreas

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    https://www.dropbox.com/sh/7afzvo1w0mro ... l--Za?dl=0

    Regards

  • Oh yes, thank you, I did see this and take a look at it. Yours is saying web storage and mine only has local storage is there a difference?. Also the button set up is a little confusing because I don't need those so I'm not sure how to work around then.

    Damn you guys are good at this stuff...

    Thank you

  • > 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 <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    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

  • Try to clear your cookies and cache. Then try again

    epic2d

    Can you attach a screen shot or the capx file?

  • 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

  • > 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

  • i have variable in sheet one

    but sheet 2 is not getting sheet 1's update value

  • 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?

  • 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

  • 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

  • > 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

  • >

    > > 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

Jump to:
Active Users
There are 2 visitors browsing this topic (0 users and 2 guests)