What is wrong with my array saving events? Capx inside

Get help using Construct 2

Post » Sun Feb 08, 2015 3:12 pm

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.
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Sun Feb 08, 2015 3:59 pm

You have a number variable instead of text. Also you can store the array as a single JSON string instead of specifying each individual element.
You do not have the required permissions to view the files attached to this post.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,670

Post » Sun Feb 08, 2015 4:18 pm

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.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests