PUT WEB STORAGE AS VARIABLE

Get help using Construct 2

Post » Tue Jun 11, 2013 2:59 pm

I'M TRYING TO PUT A WEB STORAGE VALUE AS A VARIABLE
WHEN I SET THE VARIABLE TO TEXT AND IN THE EVENT SHEET TRY TO SET THE VALUE TO IT IT SAYS IT DOESN'T ACCEPT A NUMBER AND WHEN I SET IT TO A NUMBER IT SAYS IT WONT ACCEPT A TEXT ANYBODY KNOW A WAY TO TRANSLATE ITsosensible2013-06-11 15:22:57
B
41
S
11
G
7
Posts: 514
Reputation: 9,701

Post » Tue Jun 11, 2013 3:03 pm

Use str(your value) to get strings, int(your value) to get integers.
B
24
S
9
G
7
Posts: 756
Reputation: 7,312

Post » Tue Jun 11, 2013 3:20 pm

OK BUT IT WONT ACCEPT THE WEB STORAGE VALUE IN THAT BUT THANKS ANY WAYSsosensible2013-06-11 15:21:49
B
41
S
11
G
7
Posts: 514
Reputation: 9,701

Post » Tue Jun 11, 2013 3:22 pm

Post your project or screenshot of the events, and go easy on the caps lock :)
B
24
S
9
G
7
Posts: 756
Reputation: 7,312

Post » Tue Jun 11, 2013 3:32 pm

sorry about the caps lock sometimes i acedently hit it while working heres a snap shot
http://dropcanvas.com/#Ja39761JphzI99
B
41
S
11
G
7
Posts: 514
Reputation: 9,701

Post » Tue Jun 11, 2013 4:12 pm

Drop Canvas link didn't work for me :(
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,038

Post » Tue Jun 11, 2013 4:23 pm

You are using it wrong, you are just setting your variable to 0.

Here is a tutorial on how to use web storage: https://www.scirra.com/tutorials/266/webstorage-how-to-save-ingame-information

Aand of course web storage manual entry for all the stuff you can do with it: https://www.scirra.com/manual/120/webstorage
B
24
S
9
G
7
Posts: 756
Reputation: 7,312

Post » Tue Jun 11, 2013 8:41 pm

right i tried to set the variable to the web storage but it wont let me
B
41
S
11
G
7
Posts: 514
Reputation: 9,701

Post » Wed Jun 12, 2013 3:41 pm

I figured out the problem I wasnt putting "" around the the web storage value I wanted to use thanks for the help and you were right about wrapping it with int
B
41
S
11
G
7
Posts: 514
Reputation: 9,701


Return to How do I....?

Who is online

Users browsing this forum: NN81, Yahoo [Bot] and 5 guests