Error When Handovering the instances

Posted by jessasantos

___________________________________________
############################################################################################
ERROR in
action number 1
of Other Event: Game End
for object MOB_SLIME:

Data structure with index does not exist.
at gml_Script_gms_instance_handover (line 5) - buffer_write(_b, buffer_u16, ds_map_find_value(__s, "syncID") - 1000000);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_gms_instance_handover (line 5)
called from - gml_Object_MOB_SLIME_EndGameEvent_1 (line 3) - gms_instance_handover(id);

The MOB_SLIME is sync by is_full and when other client go to the other room and when they are back to the room that where i am the MOB_SLIME will destroy itself so i try to use handover but it shows that error
i put this code in room end and game end event:
if(gms_instance_is_owner(id))
{
gms_instance_handover(id);
}
the room end will not triggered an error but the game end have.
and also even the i use handover code in MOB_SLIME when i go to the other room and back it destroy itself again and again how can i fix this?
sorry for my poor english

Replies (6)

Last message on 18 Jun 2019

Size43 (Administrator) on 21 May 2019, 16:15:00
Do you destroy the slime at any point? (for example when it has no health)

Also, I think room end is also triggered when the game ends, so you don't need the handover in the game end.
jessasantos (Topicstarter) on 22 May 2019, 04:51:15
I destroy the slime if it has no health so if thats the problem in destroying the slime if other enter to the room that when you are ? what is the possible fixes of this?
jessasantos (Topicstarter) on 22 May 2019, 04:55:09
This is the example line
MOB_SLIME
Step Event:
if(_mob_life <=0)
{
instance_destroy();
show_mob_health = false;
with(OBJ_ATTACK_CONTROLLER)
{
instance_destroy();
}
expr+=1;
if(chance_ext(20))
{
coin+=1;
instance_create(x,y,OBJ_COIN_LOG);
}
}

and this another 1 which placed in collision with the bullet

//Damage
if(!_mob_life <=0)
{
_mob_life -=dps;
show_mob_health = true;
with(other)
{
instance_destroy();
}
}else
{
instance_destroy();

with(other)
{
instance_destroy();
}
show_mob_health = false;
with(OBJ_ATTACK_CONTROLLER)
{
instance_destroy();
}
}
Size43 (Administrator) on 1 Jun 2019, 19:41:38
Do you sync the health of the slime? Could it be possible that it gets destroyed while the health hasn't finished syncing?
jessasantos (Topicstarter) on 2 Jun 2019, 06:12:12
I didnt sync the health of the slime
Size43 (Administrator) on 18 Jun 2019, 12:51:45
Would you mind mailing me your project (gamemakerserver@outlook.com), so I can take a look?