gms_init

Usage: gms_init ( controller_object )

Description

This function only needs to be called when using one of the GameMaker: Studio versions of GameMaker Server.

This function initializes the extension. This function must always be called before any other GameMaker Server function.

If an error says the variable global.__set is not initialized, this function was not called on time.

controller_object should be the object from which gms_init, gms_step, gms_draw and if needed gms_network are executed.

Replies (6)

Last message on 26 Jul 2021

DinoWattz on 17 Jul 2021, 04:15:41
I found a function called gms_uninit but there's no documentation about it. does it even work?
Size43 (Administrator) on 26 Jul 2021, 19:01:37
I believe that function is run by default when you close the game, for the GM8 version of the extension. It does some cleaning up to shut down the connection more gracefully. You can use it before exiting the game, but I wouldn't recommend using it to disconnect from the server while keeping the game open. You might not be able to re-connect afterwards.
nathanguilbaud on 11 Apr 2020, 15:34:59
- When I run gms_init in window with a good wifi connection it takes about 6s to finish
- When I run gms_init in an android App on my phone connected to the same Wifi it takes 13s to finish
- When I run gms_init in an android App on my phone with no Wifi but a very good 4G connection it never connects

Does that means that I need a good connection in order to connect to the server ?
Size43 (Administrator) on 21 Apr 2020, 10:24:52
For some reason GameMaker's networking api takes a long time to connect on some phones. I am not able to reproduce the issue so its hard for me to debug. If you could figure out which part of the start up sequence takes the longest (by editing the extension and for example inserting some debug messages to measure timing) it would help me a lot.
Template on 24 Apr 2019, 08:46:35
Why loading on the android - long? Please help me.
Size43 (Administrator) on 24 Apr 2019, 12:06:49
This is an issue which I've not been able to reproduce. If you could add some debugging messages to gms_connect and figure out which line is taking the longest that'd help me out a lot in figuring out what's going on and fixing the issue.