rekjl's Recent Forum Activity

  • Hi guys,

    How do I add two single digit numbers from an array into a single double digit or more number? For example, array 0 = 5, array 1 = 2, and I want to get the value 52.

    I thought the code below would work, but it didn't.

    (array.at(0)) & (array.at(1))

    I would think it is something close to this, and I am missing something in the syntax.

  • Colludium, thank you so much, that was indeed the issue.

  • Hi guys,

    I will need to save data into an array as a json file because there will be possibly over a thousand data to be stored, so saving as individual variables might not be the way to go. However, I am having problem in that when I save the array and load it, it works fine as I move between layouts, or restart the game using a restart button inside the game. However, when I exit the game and than run it again, the data is not available anymore. I made a capx below.

    https://www.dropbox.com/s/isz945p3q1oia56/ArrayJsonTest.capx?dl=0

    Please run the "main" layout. Press on the play button and it will bring you to another layout. Press any of the blue boxes to increase the value. The values for button 1 and 2 are being saved to an array and stored to webstorage as a json file. The third one is saved using normal webstorage. Switching between layouts or restarting by pressing the green button in the main layout shows everything works fine. But when you exit and restart, only the third one saved with normal webstorage is displayed correctly.

    I am sure I must be doing something wrong, could anyone please help point out what I am doing wrong?

    Also out of curiosity, does the amount of data stored and being saved and retrieved affect the performance of the game? For example, 10 000 individual webstorage key for a mobile game, will there be a noticeable effect on performance?

    Thanks everyone!

  • DetteMan, thanks for that info! That is some peace of mind for me to continue my game.

  • Hey guys, was wondering how updating a newer version of our game works? For me, I am planning to make my game with 50% of the levels done, than update it later with the rest of the levels. Is there any issues with crosswalk in terms of updating? I am worried that webstorage might be affected and reset everything. Anyone here with experience with this?

  • , haha it's been so long that I almost forgot how to set it up. But will definitely give it a try soon. Would be fantastic if it indeed solves the problem.

  • Haha thanks so much ramones! It indeed was something so simple. Also, thank you so much for the showing me how to save as a Json string. I'm just starting to learn about it and I thought the only way to save it was to use the download action, but that was not appropriate for mobile games. Again, thanks! I can continue on with my game now.

  • Hi guys, in my capx, you can see that the array is not properly saved as it won't show the new value once you restart the layout. Press the Up sprite to change value, and press the restart sprite to restart the layout.

    If you play it in the debugger, you can see that once it restarts layout, the values all return to 0. I guess it must be that I am not properly saving my array cause the loading seems to work. But I am using the same style of code from an earlier game of mine that worked. I am sure I must be missing something simple.....I hope.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have been using webstorage all this while, the problem is I have over 100 values in the array, and I am not sure if there is a way to enter all the values into the webstorage more effectively than using (Array.At(0)&","& Array.At(1)&","&Array.At(2)&","& Array.At(3)....etc etc) Someone mention that Json could do this, which was why I am looking into it. Haha might need to turn back again.

  • Somebody, I hope you don't mind me asking a bit cause I am really stumped with Json a bit. Is the only way to save a Json file to use the download option? It opens a new window and ask to save the file. I am making a mobile game so that is out of the question. What is the other option to automatically save it? I am using it to save a 100+ array. Thanks.

  • No problem maxer006. Best of luck!

  • Thanks Will look into JSON as this will be the first time working with it. All my previous was with webstorage and I had to manually enter one after the other.

    Again, thanks!

rekjl's avatar

rekjl

Member since 13 Oct, 2013

None one is following rekjl yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies