I need help saving with local storage!

Get help using Construct 2

Post » Sat Aug 27, 2016 7:02 pm

Hi everyone.

I'm having some issues saving what has been bought and what's selected on my ingame shop.
I'm still new and I followed the wikis or tutorial about Local Storage however, im still having a difficulty saving some items properly.

In this capx example that I created:
https://drive.google.com/folderview?id=0B9tGN8-NMP_xQzFxUlZpclhXRzg&usp=sharing

You have a basic shop, where you can buy and select the item/player you want to use.
And im trying to save what has been bought already and what has been selected already.

What im trying to accomplish is:
1. If you buy an item, game saves, and next time you reload the game you dont have to buy it again.
2. If you select a bought item, game saves, and next time you reload, you will see your selected item by default.
3. Let say these buttons are players, if you select one, the other one de-selects. So next time you reload the game you will see the last player you selected.

I'm using instance Boolean variables for the "Bought" and "Selected" items/players.
I have encounter many bugs on the way im saving stuff and im pretty sure this can be done in a different easier way.

Could you guys take a look at my capx and see where I went wrong? and what's the best way to do it?
if you guys could fix my capx would be great :D
https://drive.google.com/folderview?id=0B9tGN8-NMP_xQzFxUlZpclhXRzg&usp=sharing

Note: On the capx
1. if you press 1 it will reset global variables and clear storage.
2. if you press 3 it will add 50 coins
B
30
S
14
G
2
Posts: 26
Reputation: 3,347

Post » Sun Aug 28, 2016 3:45 pm

Anyone?
B
30
S
14
G
2
Posts: 26
Reputation: 3,347

Post » Fri Sep 02, 2016 3:12 pm

Don't make it reset global variables.
B
25
S
6
G
4
Posts: 173
Reputation: 3,933

Post » Fri Sep 02, 2016 9:35 pm

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sat Sep 03, 2016 10:34 am

Hey, unxcellent I've figured out the New local storage system however I don't have my files right now so I can't upload. One Workaround you could do is look for OLD WEBSTORAGE CAPXs and build your game over those. They are much much easier to use.
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,246

Post » Sat Sep 03, 2016 10:45 am

MPPlantOfficial wrote:Hey, unxcellent I've figured out the New local storage system however I don't have my files right now so I can't upload. One Workaround you could do is look for OLD WEBSTORAGE CAPXs and build your game over those. They are much much easier to use.


When you insert a new object, right click on the background of the pop up window and select "Show Deprecated Plugins". I prefer Web-storage myself.
Last edited by Tekniko on Sat Sep 03, 2016 11:00 pm, edited 1 time in total.
B
56
S
15
G
13
Posts: 826
Reputation: 17,705

Post » Sat Sep 03, 2016 11:03 am

Tekniko wrote:
MPPlantOfficial wrote:Hey, unxcellent I've figured out the New local storage system however I don't have my files right now so I can't upload. One Workaround you could do is look for OLD WEBSTORAGE CAPXs and build your game over those. They are much much easier to use.


When you inset a new object, right click on the background of the pop up window and select "Show Deprecated Plugins". I prefer Web-storage myself.


Oh I didn't know that. Somehow I just assumed the old one was merged with the new one.
Thanks for letting me know!
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,246

Post » Sat Sep 03, 2016 7:14 pm

Tekniko wrote:
MPPlantOfficial wrote:Hey, unxcellent I've figured out the New local storage system however I don't have my files right now so I can't upload. One Workaround you could do is look for OLD WEBSTORAGE CAPXs and build your game over those. They are much much easier to use.


When you inset a new object, right click on the background of the pop up window and select "Show Deprecated Plugins". I prefer Web-storage myself.



Wasn't aware you could do that...
B
13
S
1
Posts: 63
Reputation: 719


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests