Loading INIs from outside source?

Posted by Forgeio
Hey, I was wondering if there was any way to load your game's INI files from another website, say for example loading character stats from the INI files for leaderboards or profiles on a website. Thank you!

Replies (13)

Last message on 18 Nov 2017

Size43 (Administrator) on 24 Oct 2017, 15:35:50
You could use the API for this:https://gamemakerserver.com/en/docs/article/api/
However, please note that the API is deprecated and will be removed in the future.
Forgeio (Topicstarter) on 25 Oct 2017, 20:45:44
I don't know much about API, could you point me towards some places I could learn about how it works/how to implement it?
Size43 (Administrator) on 28 Oct 2017, 11:11:13
Once again I'd like to strongly advise against using it since it will be removed in the future. If you only want to show the highscores somewhere, you can also use the dynamic images.

However, if you still want to use it you'll have to learn a language like PHP, how to send HTTP requests, and how to parse JSON.
Forgeio (Topicstarter) on 25 Oct 2017, 22:10:05
Also, I'm having some trouble with synchronization. I have it so that the player creates a sword slash object at the x and y positions of the player with the image_angle being the direction of the mouse, and the slash object synchronizes the angle, however, it doesn't work and the other player still can't see the angle of the slash object. In the create event, I have the gms_sync(id,is_full) code, and in the step event I have this code:
if gms_instance_is_owner(id) {
x = obj_character.x;
y = obj_character.y;
image_angle = point_direction(x,y,mouse_x,mouse_y);
gms_instance_set(id,"image_angle",image_angle)
gms_instance_set(id,"y",y);
gms_instance_set(id,"x",x);
}
else
{
x = gms_other_get(id,"x");
y = gms_other_get(id,"y");
image_angle = gms_other_get(id,"image_angle");
}
what is wrong with this?
Size43 (Administrator) on 28 Oct 2017, 11:08:53
Note that x and y positions will be synced automatically.

It might be taking more time to sync the angle than that the slash is visible. If you want the angle to be available immediately, you should use gms_instance_sync_var_add (right before the call to gms_instance_sync). See the instance syncing tutorial for an example.
Forgeio (Topicstarter) on 3 Nov 2017, 03:35:00
Hey, I'm getting this error again, I can't really figure out what causes it.

___________________________________________
############################################################################################
ERROR in
action number 1
of Step Event0
for object obj_controller:

Retrieving owner for non-existing instance 100421.000000
at gml_Script_XServer_error
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_XServer_error (line 0)
gml_Script_gms_step
gml_Object_obj_controller_Step_0

Is there something that I may be doing in my code that is causing this?
Size43 (Administrator) on 5 Nov 2017, 11:40:36
Are you manually calling gms_instance_destroy anywhere?
Forgeio (Topicstarter) on 5 Nov 2017, 18:25:20
No, I just have a normal instance_destroy() event in the slash object.
Forgeio (Topicstarter) on 29 Oct 2017, 01:32:33
I am now getting this error,
___________________________________________
############################################################################################
ERROR in
action number 1
of Step Event0
for object obj_controller:

Retrieving owner for non-existing instance 100215.000000
at gml_Script_XServer_error
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_XServer_error (line 0)
gml_Script_gms_step
gml_Object_obj_controller_Step_0
Size43 (Administrator) on 10 Nov 2017, 14:27:41
Are you using the (Windows) / GM8 or the (All) version?
Forgeio (Topicstarter) on 10 Nov 2017, 23:37:23
The Windows Version. It has something to do with the synchronization, when I remove the gms_instance_sync(id,is_full) for my slash object it goes away. I'm also having trouble when it collides with the other player, when it checks for variables that are synced (such as the amount of damage the slash should do) it only reads them once every 2 or 3 times. Thank you for the help.
Size43 (Administrator) on 18 Nov 2017, 14:59:46
If you're still using gms_instance_set, those variables might not be synced on time for the collision event. Using gms_instance_sync_var_add would solve that problem.

Do you really need the is_full syncing? If you don't, switching to is_onetime or is_extended would fix the error entirely.

How quickly is the slash object destroyed? I'm suspecting that the instance is destroyed before the extension has the chance to fully sync it. (Once again note that this is only an issue for is_full syncing)
Forgeio (Topicstarter) on 29 Oct 2017, 02:00:21
Never mind, I shouldn't have messaged so quickly, I found the problem. Thank you!