Legacy GM [Tutorial] Automatic Update Checker!

Gamerev147

Member
GM Version: Studio Pro
Target Platform: Windows
Download: NA (see video)
Links: NA

Hello everyone!

Description:
This is just a in depth tutorial on how to make a simple object that can download an INI file and check to see if a new version is available. If you have errors, please paste them in the comments or to this thread.

Thanks!

Tutorial:
 
Last edited by a moderator:
F

foose

Guest
Works pretty good. Thanks a lot! This has solved something that I wanted to incorporate into my some of my educational games. I am now ready to go onto bigger and better things. Thanks for keeping open your link! It really helped me to verify that this works.
 

Gamerev147

Member
Works pretty good. Thanks a lot! This has solved something that I wanted to incorporate into my some of my educational games. I am now ready to go onto bigger and better things. Thanks for keeping open your link! It really helped me to verify that this works.
I'm glad it worked for you! I was able to completely modify this engine to make a professional update checker. So if you take a close look at the code you can do a lot! Good luck!
 
G

GLaD0S

Guest
Hey, I'm kinda new to Game Maker and wanted to include this in my own App. It seems to work fine, but sometimes, when starting ( and checking for update ) this appears:
FATAL ERROR in action number 1 of Async Event: HTTP for object Updater:

file_text_write_string argument 2 incorrect Type ( undefined ) expecting a String ( YYGS )
at gml_Object_Updater_Other_62

I honestly were not able to find a difference between your and my code, but here it is:






The problem only occurs sometimes and i think it could be related to the internet connection. But it works fine in flight mode...
Hope you still can reply to this
Thanks ^^
 
Last edited by a moderator:

FrostyCat

Redemption Seeker
This is the tutorial author's fault for neglecting to check async_load[? "status"]. In adverse connection conditions or when the file is large enough, you will get one or more "progress" HTTP events that carry a status of 1, a loading progress but no content.

To avoid getting errors from hitting blanks like you did, check both the ID and the status like this:
Code:
if (async_load[? "id"] == async_ini) {
  if (async_load[? "status"] == 0) {
    // Only here is it safe to assume the download is successful.
    // Lines 8-11 plus 16-28 in your original HTTP event code go here
  }
}
Whenever you are dealing with HTTP functions, you must check both async_load[? "id"] AND async_load[? "status"] for expected values. Anything less is asking for trouble down the line.

PS: Please stop posting code in screenshots. Use [code] and [/code] tags and paste in the code in text.
 
G

GLaD0S

Guest
Thank you,
got it to work and now everything is going as it should. And yes from now on i will use
Code:
 ^^
 
M

Moises Abraham

Guest
Thats a very nice feature to have! I would love to have such a thing for android or the other mobile platforms since this could help a developer maintain an anti-pirating system since mobile games are easily breached D:
 
Top