How do I use this new local storage?

Get help using Construct 2

Post » Tue May 12, 2015 5:48 pm

Hi everyone,

So I've worked with the previous web storage a good amount.. and one of the big things i remember from before is that you had to check if a key existed.. and using an invert condition "if key does not exist"... create the key..

in this new system I see I can do something like this:

on start of layout:

check item "keyname" exists.. but then what? does it automatically create the keystore?

then i want to do things like compare, but this too isn't feeling familiar.. just feels like while I get it's not completely different, it's different in how I understood web storage to work with C2. I haven't seen any

even the C2 manual seems to still talk about the old plugin, not the new one so that wasn't informative. I saw some other questions out there, but none of them cover this..

I just want to create a couple of local storage values so I can save thing like high score and volume on / off so far.. so when you turn off sound and quit.. next time you come in the volume will still be off.

Thanks!
Caleb
B
59
S
9
G
1
Posts: 942
Reputation: 6,553

Post » Tue May 12, 2015 6:01 pm

A good example is in this thread:

viewtopic.php?t=129603
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue May 12, 2015 6:48 pm

awesome thanks! I couldn't find anything concrete in my searching although it did leave me confused a little..

In his example i see that he does check "does it exist" and has a condition of "if it exists.. cool do this" if it doesn't exist.. cool do that.." but i don't see in here where they actually do "Create" the keystore so it exists next time. or maybe it's created at some point along the way without saying "Create this key".
B
59
S
9
G
1
Posts: 942
Reputation: 6,553

Post » Tue May 12, 2015 7:00 pm

There is a set item action.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue May 12, 2015 9:22 pm

ah the .set item value? ok good to know! :)
B
59
S
9
G
1
Posts: 942
Reputation: 6,553


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 43 guests