How to make updater for GameMaker Game -


i using gamemaker. game working on need updated later on. how create updater people don't have download updated version. person playing can push button , game update.

i have done it.

i created file on server, can every server. in file said:

[version] version = 1010 

so newest version 1.0.1.0. there function gm_version check current version of game, ot return 1.0.0.1, don't know why done this. so, in order fix this, create event:

//re-order version , delete points version3 = string_replace(gm_version,'.','') point1 = string_pos('.',version3) version2 = string_delete(version3,point1,1) point2 = string_pos('.',version2) version1 = string_delete(version2,point2,1) string1 = string_copy(version1,point1,point2 - point1) version0 = string_delete(version1,point1,point2 - point1)  version_local = version0 + string1   //delete old file , serverfile version_online = 0 got = 0 file_delete("your file") file = http_get_file("your serverfile","your file") 

in asynchronous http event code:

if ds_map_find_value(async_load,"id") == file {     if ds_map_find_value(async_load,"status") == 0 {         ini_open("your file")         version_online = ini_read_string("version","version",version_local)         ini_close()         got = 1     } } 

last, in step event:

if got == 1 {     if version_online > version_local {         //your code when there's update, e.g. open homepage.     }     got = 0 } 

hope helped!


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -