D
Diveyoc
Guest
Can anyone help with this issue. I think it has to do with the arguments, but I don't have a good handle on using them yet. I've converted some code from a 1d array into a 2d array.
Now I'm trying to use a Right Mouse click event to pick up an item off the floor.
My sample item is just a red ball that is frame 1 of the spr_item, image index.
FATAL ERROR in
action number 1
of Mouse Event for Right Pressed
for object obj_red_ball:
Variable obj_red_ball.max_columns(100037, -2147483648) not set before reading it.
at gml_Script_scr_item_pickup (line 2) - for (c = 0; c < max_columns; c += 1)
_________________________________________________________________________
//==== Right Mouse Pressed Event
scr_item_pickup(1);
audio_play_sound(snd_whoosh,0,0);
instance_destroy();
//==== (Script) - scr_item_pickup
for (c = 0; c < max_columns; c += 1)
{
for (r = 0; r < max_rows; r += 1)
{
if (global.inventory[c,r] == -1) // If slot [c,r] is empty
{
global.inventory[c,r] = argument0;
return(1);
}
}
}
return(0);
Now I'm trying to use a Right Mouse click event to pick up an item off the floor.
My sample item is just a red ball that is frame 1 of the spr_item, image index.
FATAL ERROR in
action number 1
of Mouse Event for Right Pressed
for object obj_red_ball:
Variable obj_red_ball.max_columns(100037, -2147483648) not set before reading it.
at gml_Script_scr_item_pickup (line 2) - for (c = 0; c < max_columns; c += 1)
_________________________________________________________________________
//==== Right Mouse Pressed Event
scr_item_pickup(1);
audio_play_sound(snd_whoosh,0,0);
instance_destroy();
//==== (Script) - scr_item_pickup
for (c = 0; c < max_columns; c += 1)
{
for (r = 0; r < max_rows; r += 1)
{
if (global.inventory[c,r] == -1) // If slot [c,r] is empty
{
global.inventory[c,r] = argument0;
return(1);
}
}
}
return(0);