[SOLVED]How Come Webstorage isn't saving global variable?

Get help using Construct 2

Post » Tue Apr 29, 2014 2:37 am

This is the code I used. I want the global variable(gvar_emeralds) to remain the same even if the user exits out of the game and returns. What should I add?
You do not have the required permissions to view the files attached to this post.
Last edited by HZGaming on Fri May 02, 2014 1:15 am, edited 1 time in total.
B
37
S
14
G
3
Posts: 263
Reputation: 4,280

Post » Wed Apr 30, 2014 12:51 am

You're doing it backwards. You need to set the GlobalVariable to the WebStorage.LocalKey.

take a look at this fine example i just made for you ♥

Fine Example
B
43
S
12
G
6
Posts: 446
Reputation: 6,807

Post » Thu May 01, 2014 1:28 am

@Sargas Thank you for your example and time but that did not solve my problem. I tried modifying the code a bit since it did not work so here is another screenshot. It would be great if you could take a look it again.
You do not have the required permissions to view the files attached to this post.
B
37
S
14
G
3
Posts: 263
Reputation: 4,280

Post » Thu May 01, 2014 1:42 am

i don't get it, what is it you want to do? my example did what you said you wanted, didn't it? did you run it?

your line 16 might be preventing the value to be set, i'm not sure if whether if 16 or 13 is going to happen first. Use ELSE like in the example, so a command takes priority.
B
43
S
12
G
6
Posts: 446
Reputation: 6,807

Post » Thu May 01, 2014 7:15 pm

@Sargas you example worked flawlessly but I just haven't been able to replicate the behavior. I don't really understand why.
B
37
S
14
G
3
Posts: 263
Reputation: 4,280

Post » Thu May 01, 2014 7:45 pm

can you share your capx?, i might be able to find the problem if i take a look. i'll add comments on what i change.
B
43
S
12
G
6
Posts: 446
Reputation: 6,807

Post » Thu May 01, 2014 8:07 pm

Actually @Sargas that won't be necessary anymore. I managed to solve my problem :) Thank you for your time and expertise!
B
37
S
14
G
3
Posts: 263
Reputation: 4,280

Post » Thu May 01, 2014 8:11 pm

Could you please add [solved] to your topic name, now when you found a solution for your problem. So other people could find it if they encounter similar issue, and for others who trying to help to know that it was solved already.
ImageImageImageImage
B
158
S
66
G
43
Posts: 2,603
Reputation: 35,868


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests