Webstorge Question

Get help using Construct 2

Post » Wed Oct 23, 2013 12:28 pm

Hello,

I have input a Webstorge, and now my Problem is when i load the Data from the Webstorge (This is on the start of Layput 1) He makes from the Numbers a "NaN" That mean when I play the 2nd time the Webstorge makes all numbers to "NaN" what does that mean ? And how can i change that that the Webstorge can show up me my Numbers/ Variables.

I worked with this Tutorial and im now trying to fixx that error more than one hour but now all my ideas are dead. I did it 1:1


Tutorial: http://www.scirra.com/forum/webstorage-save-game_topic46118.html


Thanks


B
11
S
2
Posts: 93
Reputation: 917

Post » Wed Oct 23, 2013 12:49 pm

NaN mean "Not A Number"

Everything you save in webstorage is saved as a string. So when you retrieve the data from webstorage you will have to cast it back to a number if it was a number you saved.

Something like:

set myNumber to int(Webstorage.LocalValue("webstorageNumber"))

it is the "int()" that converts the string to an integer(a number).

Hope it helps.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Wed Oct 23, 2013 2:30 pm

Thanks first, but can you do an Example in a .capx ? Or make a Screenshot ?
I will be very happy.

Thanks
B
11
S
2
Posts: 93
Reputation: 917

Post » Wed Oct 23, 2013 4:00 pm

sure

.capx

Another time please put a @cvp in your reply, then i will get a notification. I only saw your answer by luck cvp2013-10-23 16:01:46
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Wed Oct 23, 2013 4:13 pm

@cvp Thanks,

can you better make a Screenshot please :( ?
I have Version 146 and you 147 or 148 so I cant open it, sorry. please make a Screenshot.


B
11
S
2
Posts: 93
Reputation: 917

Post » Wed Oct 23, 2013 4:40 pm

B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Wed Oct 23, 2013 7:36 pm

@cvp

Im sorry but it dont Works:

Here is my Screenshot: http://epvpimg.com/f8yIhPlasmaGames20132013-10-23 19:38:34
B
11
S
2
Posts: 93
Reputation: 917

Post » Wed Oct 23, 2013 7:46 pm

can you post your capx. it works fine for me. Just tried to change the wording to what you have exactly and it worked fine.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Wed Oct 23, 2013 8:59 pm

It works !

Thanks ! Thanks ! Thanks :D
B
11
S
2
Posts: 93
Reputation: 917

Post » Wed Oct 23, 2013 9:44 pm

your welcome. Happy to help.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Next

Return to How do I....?

Who is online

Users browsing this forum: Artcadev and 4 guests