Sync instances placed in room editor?

Posted by aridale
Im trying to sync doors across all players when they open/close and the door objects are placed in the standard gamemaker studio room editor. When I try to use gms_instance_is_owner it crashes on launch. I'm guessing it's because the instance doesnt have an owner according to GMS because it wasnt created ingame.

So besides making a door spawner... what do I do?

Heres the error just in case:
ERROR!!! :: ############################################################################################
ERROR in
action number 1
of Step Event0
for object obj_GMS:


Retrieving owner for non-existing instance 100181.000000
at gml_Script_XServer_error (line 3) - show_error(argument0, false); ############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_XServer_error (line 3)
called from - gml_Script_gms_step (line 171) - XServer_error(gms_action_get_argument_string(0)); called from - gml_Object_obj_GMS_StepNormalEvent_1 (line 1) - gms_step()

Replies (1)

Last message on 24 Mar 2020

Size43 (Administrator) on 24 Mar 2020, 11:53:26
Apologies for the delay.

It might be easier to save this in global variables instead of trying to use instance sync. i.e. just using gms_global_set("door" + string(id), door_is_open) to save the state, and gms_global_get("door" + string(id)) to check the state (optionally with gms_global_exists if you want to set a default value).