Jump to content


Photo
- - - - -

[HTML5] Saving With INI File


  • Please log in to reply
7 replies to this topic

#1 Destron

Destron

    GMC Member

  • GMC Member
  • 919 posts
  • Version:GM:HTML5

Posted 15 November 2011 - 12:50 AM

  • Title: HTML5 Saving Game With INI File
  • Description: Since the default saving features of GM don't work with GM:HTML5 A lot of questions have come up on how to save a game.
  • GM Version: GM:HTML5
  • Registered: Yes (No free version)
  • File Type: .zip, .rar
  • File Size: 1.98MB
  • File Link: Version 1 ZIP File RAR
  • File Link: Version 2 ZIP File RAR
  • Required Extensions: N/A
  • Required DLLs: N/A
Summary

With Game Maker: HTML:5 you can no longer use the built in saving functions of GM. If you want to save a game, you now must use your own method. This is a VERY basic way of saving a game with an INI file. I avoided complicated code to make it as simple as possible, however it is in GML and not D&D. Hopefully this example will give you a jump start to understanding the process of saving a game via an INI file. This version only allows 1 save slot., but if the need is there I can update to allow multiple save slots of you can't figure it out, however I think the method is simple enough anyone should be able to modify it to their needs and build on it.

HTML5 used Local Storage to save your ini files on the end users PC, not on the web server.

You can see it live HERE Play a couple levels and save your game. The restart it and you will see the load button to load your previous game with.

UPDATE: I have has several people PM me about multiple save slots, so I have created a revised version that features 3 save slots instead of just 1. I am keeping both in the topic as the 3 slot version is slightly more complicated, so If you do not need multiple save slots use the first one. When you open the game, click New Game and you will see 3 save slots. They should
all say NEW. LEFT Click one and enter a name then press enter. Then you can click your name to start the game. RIGHT click on a slot to delete it.

INI Saving 2

You can see it live HERE

Download it here:
ZIP File RAR

Spoiler

Edited by Destron, 25 March 2012 - 08:07 AM.

  • 2

#2 john316

john316

    GMC Member

  • GMC Member
  • 9 posts

Posted 14 December 2011 - 03:54 AM

can you please give an example on multiple save slots with some sorta of login feature?thx in adv
  • 0

#3 _253314

_253314

    GMC Member

  • New Member
  • 1 posts

Posted 13 February 2012 - 04:24 PM

sir i cant download the file . . the domain is expired . .
  • 0

#4 Destron

Destron

    GMC Member

  • GMC Member
  • 919 posts
  • Version:GM:HTML5

Posted 01 March 2012 - 09:59 PM

Sorry link is fixed. Tried to transfer my domain from godaddy and they decided to get in a pissing match with the new registrar over it.
  • 0

#5 Osmium

Osmium

    Graphic Artist

  • GMC Member
  • 306 posts
  • Version:GM:Studio

Posted 03 March 2012 - 02:34 PM

Works fine.Thanks! :thumbsup:
  • 0

#6 Destron

Destron

    GMC Member

  • GMC Member
  • 919 posts
  • Version:GM:HTML5

Posted 25 March 2012 - 07:52 AM

Because I had a ton of inquiries, I added a second version with multiple save slots.
  • 0

#7 Molinware

Molinware

    GMC Member

  • GMC Member
  • 35 posts
  • Version:Unknown

Posted 06 June 2012 - 01:22 AM

So how it works?
Like... where the files keep saved?
  • 0

#8 Destron

Destron

    GMC Member

  • GMC Member
  • 919 posts
  • Version:GM:HTML5

Posted 06 June 2012 - 01:39 AM

The files are kept in your browsers HTML5 local storage on the users PC.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users