Webstorage Variables switching on APK?

Get help using Construct 2

Post » Mon Jul 07, 2014 11:40 am

I have some global variables that I save in Webstorage for sound toggles, initial value of the variables are set to 0(on)and can be changed to 1(off) with an On Touch event. When I test in browser & CocoonJS launcher everything works correctly, but when I export the game and compile an APK with CocoonJS and the game is installed on a device, the 1st time the game is ran the variables are set at 1 for some reason, if I check the options toggles and turn them on setting them back to 0(on) the settings stay fine from then on when you reopen the game, but it's just that first install the variables are set to 1 so the sound if off by default. I triple checked the variables, they always start at 0 and they can only be changed with an on touch event that is on a completely different screen, not sure what is happening here.
B
45
S
16
G
2
Posts: 107
Reputation: 4,253

Post » Mon Jul 07, 2014 12:08 pm

The question now would be, does the preview share the same folder as the export?
Image ImageImage
B
168
S
50
G
163
Posts: 8,226
Reputation: 105,071

Post » Mon Jul 07, 2014 12:47 pm

newt wrote:The question now would be, does the preview share the same folder as the export?


Are you asking if I'm exporting the same one that I'm previewing? Yes I am.
B
45
S
16
G
2
Posts: 107
Reputation: 4,253

Post » Fri Jul 11, 2014 12:28 am

Finally fixed this by putting the webstorage inside of int.

int(WebStorage.LocalValue("SoundSave"))

instead of

WebStorage.LocalValue("SoundSave")
B
45
S
16
G
2
Posts: 107
Reputation: 4,253


Return to How do I....?

Who is online

Users browsing this forum: ketramtu18 and 10 guests