Quick Help

Posted by Siert on March 20, 2007, 8:23 p.m.

Okay I have a problem, I'm using arrays, but they are all copying each other, I set up two, then the third, but the first and second are always the same. I change the second, and it changes the third. Please help, and please don't remove this from the front page, I will when it's answered, thanks.

//create event

pieces[0,0] = 0

grid[0,0] = 0

variable_global_array2_set(pieces,0,0,9)

variable_global_array2_set(pieces,1,0,8)

variable_global_array2_set(pieces,2,0,10)

variable_global_array2_set(pieces,3,0,12)

variable_global_array2_set(pieces,4,0,11)

variable_global_array2_set(pieces,5,0,10)

//draw event

draw_text(355,280,string(variable_global_array2_get(grid,0,0)))

It displays 9.

Comments

noshenim 17 years, 8 months ago

pieces[0,0]=0

grid[0,0]=0

pieces[0,0]=9

pieces[1,0]=8

pieces[2,0]=10

pieces[3,0]=12

pieces[4,0]=11

pieces[5,0]=10

draw_text(355,280,string(grid[0,0]))

will work excactly the same as what you got (except it's local not global)