heres my function:
`--------------------------------------------------
`Change Tile
`--------------------------------------------------
function tile(tilex, tilez, tile#, size)
set matrix tile 1, tilex, tilez, tile#
map(tilex, tiley) = tile#
`////////////////////ECHO\\\\\\\\\\\\\\\\\\\\\\\
text 1, 108, "Texture :" +str$(map(tilex,tiley))
`\\\\\\\\\\\\\\\\\\\\\\/////////////////////////
text 100,100,str$(tilez) +" " +str$(size)
`if current selection is grass
if tile# = 1
if tilez > 0
`check the tile Above the current tile is dirt
if map(tilex, (tiley - size)) = 2
set matrix tile 1, tilex, (tilez - size), 8
map(tilex, tiley - size) = 8
endif
endif
endif
endfunction
and here's how i call it:
if mouseclick() = 1 and menu = 0
tile(tilex, tilez, tile#, 1)
endif
and heres my problem:
Quote: "Runtime error at line 454. Array Accessed out of bounds at line 454"
line 454 is:
if map(tilex, (tiley - size)) = 2
and map is my array. can anyone tell me why i get that error?