• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

id reference is invalid

K

krugen

Guest
id_master is 100035. Why did this happened? id_master != noone is not good enough?



Code:
if destroyed //boolean value
{
    instance_destroy();  
}
else
{
    if id_master != noone
    {
        x = id_master.x;  //line 19
        y = id_master.y;

        image_alpha = id_master.image_alpha;
        image_speed = id_master.image_speed;
    }
}


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_dot_shadow:
Unable to find any instance for object index '100035' name '<undefined>'
at gml_Object_obj_dot_shadow_Step_0 (line 19) - x = id_master.x;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_dot_shadow_Step_0 (line 19)
 

CloseRange

Member
no what you need is:

Code:
if(instance_exists(id_master) {


}
noone is just a special number you as the developer can use for ease of reading code.

EDIT: I smell ninjas :eek:
 
K

krugen

Guest
id_master is 100035. Why did this happened? id_master != noone is not good enough?


Code:
if destroyed
{
    instance_destroy(); 
}
else
{
    if id_master != noone
    {
        x = id_master.x;  //line 19
        y = id_master.y;

        image_alpha = id_master.image_alpha;
        image_speed = id_master.image_speed;
    }
}


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_dot_shadow:
Unable to find any instance for object index '100035' name '<undefined>'
at gml_Object_obj_dot_shadow_Step_0 (line 19) - x = id_master.x;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_dot_shadow_Step_0 (line 19)
no what you need is:

Code:
if(instance_exists(id_master) {


}
noone is just a special number you as the developer can use for ease of reading code.

EDIT: I smell ninjas :eek:
are these two the same?

if instance_exists(id)

if (instance_exists(id))
 
Top