Jump to content


Photo

Reading And Writing Files (save files) with HTML5


  • Please log in to reply
13 replies to this topic

#1 LowchefBox

LowchefBox

    GMC Member

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

Posted 26 February 2012 - 08:09 AM

Reading And Writing Files (save files) with HTML5 - This is not supported in html5 or I'm not sure it is.

Let take some random game that uses java that does this. Bare with me here but i'm about to use Minecraft as a reference. Minecraft is java based
and can save world files in folders and option settings on your computer (not server host). It gets transferred to a folder called .minecraft in your appdata folder.
How can I do this with html5. I want to simply just do file_text_open(),file_text_read(),file_text_write(),etc. But alas, html5 does not support these functions anymore.
PLEASE HELP!

Note: I don't specifically want it so save to your appdata folder. I should freely decide where the file saves on your hard drive.
  • 0

#2 iSeiren

iSeiren

    www.worrall.pw

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

Posted 26 February 2012 - 06:49 PM

Reading And Writing Files (save files) with HTML5 - This is not supported in html5 or I'm not sure it is.

Let take some random game that uses java that does this. Bare with me here but i'm about to use Minecraft as a reference. Minecraft is java based
and can save world files in folders and option settings on your computer (not server host). It gets transferred to a folder called .minecraft in your appdata folder.
How can I do this with html5. I want to simply just do file_text_open(),file_text_read(),file_text_write(),etc. But alas, html5 does not support these functions anymore.
PLEASE HELP!

Note: I don't specifically want it so save to your appdata folder. I should freely decide where the file saves on your hard drive.


What you would have to do is use an extension like mine: http://gmc.yoyogames...26&fromsearch=1 to write the file, then open the written file in a new window for the player to download it.

Then like once a week, clear the folder you use to save the files to on your server.
  • 0

#3 LowchefBox

LowchefBox

    GMC Member

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

Posted 26 February 2012 - 07:56 PM


Reading And Writing Files (save files) with HTML5 - This is not supported in html5 or I'm not sure it is.

Let take some random game that uses java that does this. Bare with me here but i'm about to use Minecraft as a reference. Minecraft is java based
and can save world files in folders and option settings on your computer (not server host). It gets transferred to a folder called .minecraft in your appdata folder.
How can I do this with html5. I want to simply just do file_text_open(),file_text_read(),file_text_write(),etc. But alas, html5 does not support these functions anymore.
PLEASE HELP!

Note: I don't specifically want it so save to your appdata folder. I should freely decide where the file saves on your hard drive.


What you would have to do is use an extension like mine: http://gmc.yoyogames...26&fromsearch=1 to write the file, then open the written file in a new window for the player to download it.

Then like once a week, clear the folder you use to save the files to on your server.

Yes i've tried this but this is what I do not wish to do. I want the save file to save on the user's computer. Not the web server host.
  • 0

#4 iSeiren

iSeiren

    www.worrall.pw

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

Posted 27 February 2012 - 12:14 AM



Reading And Writing Files (save files) with HTML5 - This is not supported in html5 or I'm not sure it is.

Let take some random game that uses java that does this. Bare with me here but i'm about to use Minecraft as a reference. Minecraft is java based
and can save world files in folders and option settings on your computer (not server host). It gets transferred to a folder called .minecraft in your appdata folder.
How can I do this with html5. I want to simply just do file_text_open(),file_text_read(),file_text_write(),etc. But alas, html5 does not support these functions anymore.
PLEASE HELP!

Note: I don't specifically want it so save to your appdata folder. I should freely decide where the file saves on your hard drive.


What you would have to do is use an extension like mine: http://gmc.yoyogames...26&fromsearch=1 to write the file, then open the written file in a new window for the player to download it.

Then like once a week, clear the folder you use to save the files to on your server.

Yes i've tried this but this is what I do not wish to do. I want the save file to save on the user's computer. Not the web server host.


You can only save into the temporary web files i think, correct me if im wrong but the normal ini_write functions work without any extensions.
  • 0

#5 Mayhem Games

Mayhem Games

    Proud Kiwi

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

Posted 27 February 2012 - 01:09 AM

You need to remember that you are developing for the web and not a desktop. HTML5 uses a sandbox like environment to store files, these are usually removed when the game is closed or when the user clears the cache or temporary internet files.
  • 0

#6 Solvius

Solvius

    GMC Member

  • GMC Member
  • 190 posts

Posted 27 February 2012 - 01:58 PM

You need to remember that you are developing for the web and not a desktop. HTML5 uses a sandbox like environment to store files, these are usually removed when the game is closed or when the user clears the cache or temporary internet files.


And more and more people that want to develop games do not want this. They see other games on the internet, browserbased, saving games, online scores etc etc.
Why is YoYo games not busy to make it possible to save games, make online scores?
The whole concept of gamemaker is still to make a stand alone game, while we are online and want to play together with others.

This is one of the reasons I have stopped all my activities with gamemaker. Actually I am upset about it and even angry.
  • 0

#7 Mayhem Games

Mayhem Games

    Proud Kiwi

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

Posted 27 February 2012 - 02:19 PM

They see other games on the internet, browserbased, saving games, online scores etc etc.


This is a draw back of HTML5 (And the browsers that support it) not Game Maker, it is purely for security reasons. Most games that have highscores ect... use a SQL databases or the like to store scores.
  • 0

#8 Solvius

Solvius

    GMC Member

  • GMC Member
  • 190 posts

Posted 27 February 2012 - 02:43 PM

They see other games on the internet, browserbased, saving games, online scores etc etc.


This is a draw back of HTML5 (And the browsers that support it) not Game Maker, it is purely for security reasons. Most games that have highscores ect... use a SQL databases or the like to store scores.


You pointed out my point. There is a other program needed to get, for example highscores...

I remember that YoYo games a couple of years back was advertising; they would make a online highscore possibility. What happened with that?

The most people that uses gamemaker are "NOT" programmers. How many have stopped, after paying for gamemaker, with making games because of the things I mentioned.

I am one of them, I have wasted a lot of money and valueble time to conclude that gamemaker is not, and from the looks of it, and will not become, the tool people want.

Naah same old story same old song. Again wasted time against fan boys... :P
  • 0

#9 daz

daz

    GMC Member

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

Posted 27 February 2012 - 03:04 PM

You cannot expect the world. Do you expect YYGs to host the high scores for you? You'll have to wait until someone wishes to create a global high scores extension, and even then it's unlikely they will host your scores either. I cannot think of one framework/engine I have used that has ever provided the means for storing global high scores.
  • 0

#10 Mayhem Games

Mayhem Games

    Proud Kiwi

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

Posted 27 February 2012 - 05:49 PM

There is a other program needed to get, for example highscores...


You can't expect Yoyo Games to do everything for you, nor should you expect them to host your games online.

If you buy a product such as Game Maker:HTML5 (Or any web based product) it is expected that at minimum you understand the technologies behind websites such as SQL. I think that Game Maker as a whole is taken too lightly, people expect to click the publish button and it be magically on the web, this is not the case.
  • 0

#11 Solvius

Solvius

    GMC Member

  • GMC Member
  • 190 posts

Posted 02 March 2012 - 09:57 AM

for daz:

Clockwork is a very nice solution for online scores, and yes they host it to.
I think it would be not that difficult for YoYo games to start such a service. I will even pay for it if neccasery.
Same for saving games possibilitys. YoYo could make a system that can be used for Gamemaker users to add a lot more fun. And again it doenst have to be free...
Maybe YoYo games should is start thinking outside the box. Here are two oppurtunity's for them to generate money.

for Mayhem Games:
Do you want to develop computer games without spending countless hours learning how to become a programmer? Then you've come to the right place. GameMaker allows you to make exciting computer games, without the need to write a single line of code. Making games with GameMaker is a lot of fun!

After a few days the exciting part is dropped way below zero for many people. You actually need to be a programmer to make exciting games. You need to learn codes to make a exciting game. You need to spend countless hours to find something out or to get it working properly. You need to be an PHP, MySQL, database expert to get someting exciting. Fun? I am pritty agrivated at the moment.
Where are the good games made with gamemaker? games everybody talks about. And then outside the little circle of people that's around YoYo games.
  • 0

#12 GameRoom

GameRoom

    GMC Member

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

Posted 03 March 2012 - 05:25 PM

You need to remember that you are developing for the web and not a desktop. HTML5 uses a sandbox like environment to store files, these are usually removed when the game is closed or when the user clears the cache or temporary internet files.

I actually did some Googling and realized that there is local storage and session storage in HTML5. It's only 5 MB, but apparently it's never cleared unless you run out of room or something. I guess just try to compress and be efficient. Maybe use binary and convert that to a string and make a text file (HTML5, Y U NO SUPPORT FILE_BIN?). Hopefully the file_text and ini functions use this folder as default.

Edited by GameRoom, 03 March 2012 - 05:26 PM.

  • 0

#13 wtrbrs

wtrbrs

    GMC Member

  • GMC Member
  • 47 posts

Posted 09 April 2012 - 03:40 PM

I think it is possible to put your high score and other data in a cookie with some javascript that you can use in gamemakerhtml5. I am refurbing my javascript at the moment, so can not tell you now how to do it exactly. But I am 95% sure it can be done like this.
  • 0

#14 GameRoom

GameRoom

    GMC Member

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

Posted 17 April 2012 - 01:33 AM

I have used the file_text functions with no problems. Unless you clear your local storage, the file_text functions work perfectly. The only problem I have is that there's no binary file support. :sad:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users