N
NthingSinistr
Guest
So I have this inventory system that draws based on the view, and is toggle able. The problem comes when I regenerate the room and then toggle the inventory, and I get this error:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_inventory:
Unable to find any instance for object index '102361'
at gml_Object_obj_inventory_DrawEvent_1 (line 38) - button.x = ix;
############################################################################################
Here's the code.
Event: obj_inventory_Draw_1:
Event: obj_inventory_press E-key_1:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_inventory:
Unable to find any instance for object index '102361'
at gml_Object_obj_inventory_DrawEvent_1 (line 38) - button.x = ix;
############################################################################################
Here's the code.
Event: obj_inventory_Draw_1:
Code:
if (showInv)
{
var x1,x2,y1,y2;
x1 = view_xview[0] + 1464;
x2 = x1 + view_wview[0] - 1440;
y1 = view_yview[0];
y2 = y1 + 1080;
draw_set_color(c_black);
draw_set_alpha(0.8);
draw_rectangle(x1,y1,x2,y2,0);
draw_set_alpha(1);
for (i = 0; i < maxItems; i += 1)
{
var ix = x1+48+(i * 40);
var iy = y2-368;
if (i >= 10 && i <= 20)
{
ix = x1-352+(i * 40);
iy = y2-326;
}
if (i >= 20 && i <= 30)
{
ix = x1-752+(i * 40);
iy = y2-285;
}
if (i >= 30 && i <= 40)
{
ix = x1-1152+(i * 40);
iy = y2-244;
}
draw_sprite(spr_border,0,ix,iy)
button[i].x = ix;
button[i].y = iy;
}
}
Event: obj_inventory_press E-key_1:
Code:
if showInv = false
{
showInv = true;
}
else
{
showInv = false;
}