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.

Code Snippets / [AGK] Save as String with Parsing [Multi-Platform]

Author
Message
Virtual Nomad
Moderator
17
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 3rd Nov 2022 04:59 Edited at: 3rd Nov 2022 05:18
the following is offered as example of saving/loading game/app data as/from a single string along with parsing and assignment of data within appropriately.

meant to be a cross-platform solution, the string will save/load as SharedVariables()/cookies where appropriate.

code is lightly commented:

when exporting to HTML for use @ itch.io or anywhere using cross-site cookies, make sure to apply THIS CHANGE to the .js player.

tested functional on WIN, Android and HTML with live demo HERE where you can change values and Refresh to reload saved data.

for a more involved "real" game example, see HERE with full source available HERE.
Phaelax
DBPro Master
19
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Nov 2022 18:35
There's several little things with itch.io, we should write up a sticky thread documenting all of them. The thread you linked to about cookies I saw parttimecoder mention something about failing to get a mysql highscore to work. I recall another thread (i'll have to find it) where I posted a solution that got my purpletoken system to work on itch. I think it'd be helpful for others we managed to roll all this info into a single thread.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda
Pixel-Perfect Collision

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2023-01-30 12:18:35
Your offset time is: 2023-01-30 12:18:35