Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Reading writing browser storage in HTML5?

Author
Message
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 26th Sep 2020 22:21
Hi

I remember reading and writing browser storage when exporting to HTML5 was not possible in classic. I was hoping Studio going to bring this feature eventually, but then I stopped using AppGameKit for a couple years..
Now I decided to port one of my old classic projects to Studio and use the level editor this time and was wondering if it finally possible to read and write web storage somehow?

Read and write file functions in the project does not work in HTML5 and I did not find any HTML5 specific solution in the documentation.
So it is still not possible then to store data in the browser when exporting to HTML5?

Thanks.
Virtual Nomad
Moderator
18
Years of Service
Recently Online
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Sep 2020 23:49 Edited at: 26th Sep 2020 23:52
the SharedVariable commands now support cookies, if that helps?
i haven't pushed the limits (beyond saving/loading/parsing strings) but they're functional. what were you looking to save/load?
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 27th Sep 2020 08:21
Thanks, I didn't`t know about cookies, I`ll look in to that. Certainly better than nothing. Would be nice of AppGameKit could finally support some sort of storage or database solution on HTML5 though for reading, writing large amount of structured data.
I`m looking to save, load the game state, standard staff like current level, health, money, ammo, score, collected items, opened chests, doors..etc Not sure if cookies will do, but I shall try if there is no other option.
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 27th Sep 2020 11:24
Both window.localStorage and window.sessionStorage have been available in the HTML API for a while now, sadly, I don't think these were ever implemented in AGK.

Login to post a reply

Server time is: 2024-04-19 07:55:41
Your offset time is: 2024-04-19 07:55:41