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 eventpieces[0,0] = 0grid[0,0] = 0variable_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 eventdraw_text(355,280,string(variable_global_array2_get(grid,0,0)))It displays 9.
post script/code?
AAAH! SHORT SHORT <b>SHORT</b> BLOG! REPORT REPORT REPORT!
…AHAHA! I got you there, I knew I'd trick you.I'm not good with arrays, so have fun doing it yourself!Have fun finding out that i need to see the code you used to help.
This is a situation where it would be really nice to see your code.
ok
not exactly what i thought you meant.it should be displaying 0ny other events/code?if you're using global variables, it means that there's another thing using those variables.draw_text(355,280,string(variable_global_array2_get(grid,0,0)))is the same asdraw_text(355,280,string(global.grid[0,0]))Looks like the problem is in the create event you've forgotten:
Ah, I misunderstood the problem. Why not try doing this anyways:
variable_global_array2_set(grid,0,0,0)(you have the grid array but not the global grid array)
Also, those (pieces and grid) look like local variables, so you should probably be using variable_local_array2_set
Player: so i can just ditch the functions and use grid[a,b] since its all in one object? But why does it use the other array then. I'll have to see tomorrow if it works. Thanks!