Hi,
Being new to this, I'm making a lot of simple mistakes. But that's all part of the learning process. Here is the first one I couldn't cure on my own.
I'm getting the following error message: Runtime error at line 337. Matrix coordinate does not exist at line 337
Here is the code that pertains:
REM Values for dimensions of matrix
fieldsize# = 1000.0
xdim = 10
ydim = 10
REM Make the matrix
make matrix 1, fieldsize#, fieldsize#, xdim, ydim
rem Set real dimensions to 'fieldsize' and #cells per axis to xdim and ydim
randomize matrix 1, matrix_height#
position camera 0, 1200, 0
point camera 1000, 1, 1000
load image "mat_texture.jpg", mat_texture
tiles_across = 1
tiles_down = 1
prepare matrix texture 1, mat_texture, tiles_across, tiles_down
for x = 1 to xdim
for y = 1 to ydim
set matrix tile 1, x, y, 1
next y
next x
update matrix 1
(In that code block, the line 'next y' is the one numbered 337 according to darkedit.)
(And I realise it's technically 'z' and not 'y' but I think in 2D...)
Now, the matrix appears to draw OK -- I can see it and it's textured correctly as far as I can tell, and with the correct number of cells. So I don't see what the problem is. Also, any other command placed on the offending line causes the same problem -- I tried putting in print statements for debugging and it caused the same error on the same line.
Different values for xdim and ydim do not change the error and they appear to draw correctly regardless of the value. Different values of fieldsize# do cause non-drawing if small enough, but I think that is not related to my problem.
If anyone can point out what I'm doing wrong, I'd be very appreciative. I have little enough hair left as it is!
Cheers, and thanks in advance.
We don't need no stinking badgers.