Game Maker's Garage Forum

Game Creation => HTML5/Javascript => Topic started by: Silverwind on January 07, 2012, 06:41:54 AM

Title: Wow, localStorage!
Post by: Silverwind on January 07, 2012, 06:41:54 AM
I'm digging HTML5's localStorage object:

http://www.w3schools.com/html5/html5_webstorage.asp

"localStorage.playerHP = 50;" creates the variable "playerHP" on the user's computer and the value has no time limit expiry, so every time you revisit the website the variables maintain the value. Online RPG right there!
Title: Re: Wow, localStorage!
Post by: Gan on January 07, 2012, 12:44:33 PM
Wow that is so neat! That's gonna be super handy in the HTML GM.
Title: Re: Wow, localStorage!
Post by: Silverwind on January 07, 2012, 02:18:11 PM
The whosa what now?
Title: Re: Wow, localStorage!
Post by: Gan on January 07, 2012, 06:18:53 PM
Nothin, just a super secret wicked awesome project to further the development of the GMG.
Title: Re: Wow, localStorage!
Post by: Charlo on January 07, 2012, 07:28:07 PM
I've never experimented with local storage, but it does sound promising.  A nice alternative to cookies.
Title: Re: Wow, localStorage!
Post by: Silverwind on January 08, 2012, 07:36:03 AM
Yeah, W3S are pushing for localStorage to replace cookies altogether. All this rapid change in web development makes one fearful of spilling his tea so...

EDIT:

Due to quivering hands of course.
Title: Re: Wow, localStorage!
Post by: Gan on January 08, 2012, 10:09:42 AM
Quivering hands of excitement!
Title: Re: Wow, localStorage!
Post by: Connors on January 08, 2012, 02:38:44 PM
It sounds great!
Do you know where exactly this is stored? I'd be interested to know some specifics.
Title: Re: Wow, localStorage!
Post by: GMG Hendo on January 31, 2012, 06:32:53 PM
It sounds great!
Do you know where exactly this is stored? I'd be interested to know some specifics.

It's stored in a little key-value db store. I'ts really great, and easy to use.
Title: Re: Wow, localStorage!
Post by: Connors on February 01, 2012, 08:36:49 AM
Did it become part of Gan's program or what?
Title: Re: Wow, localStorage!
Post by: Gan on February 01, 2012, 09:34:33 AM
Brilliant idea Connors! I didn't think to put it in the HTML5 GM.

Which makes me think... I can further enhance this feature so not only can strings be saved, but also arrays and objects and other variables!
Wow, saving games is gonna be really easy.