Hello out there,
I've had DarkBASIC Classic V1.08 for over a year now, and I've worked with it on and off. Lately I have started on a game project, using DarkEdit. It's a top scrolling shooter game, in which you control a spaceship by yawing it. I have put the spaceship's model into the program, and I have a matrix under the ship. Overall the program works well.
But I'm having a problem with the matrix in the game. I originally had this code to create the matrix:
Rem ------> Prepare a Matrix <--------
Rem Create the Matrix
Make Matrix 1,2000,2000,20,20
Rem Texture Matrix, dude.
Load image "rock2.bmp",2
Prepare Matrix Texture 1,2,2,2
Rem Place random texture on each matrix tile
For x = 0 To 19
For z = 0 To 19
t = rnd(3)+1
Set Matrix Tile 1,x,z,t
Next z
Next x
Update Matrix 1
Rem update changes to matrix
Update Matrix 1
Rem mY is the variable for random matrix height (The value is now 100)
mY = 100
Rem to avoid an mY = 0 incident.....
If mY < 1 then mY = 1
Rem Randomize the matrix's height upon program startup, according to the mY variable above
Randomize Matrix 1,mY
The program loaded up fine with this matrix code. When I increase the size of the matrix to 10,000 X-world units and 10,000 Z-world units, and have 70 divisions on both the X and Z-axis, the program still works fine.
But when I try to increase the number of matrix divisions to 71, I get an error that says, "Runtime error at line 83. Matrix does not exist at line 83." (I wanted to increase the matrix divisions to make the texture on the matrix look clearer.)
My matrix code looks like this when I get this error:
Rem ------> Prepare a Matrix <--------
Rem Create the Matrix
Make Matrix 1,10000,10000,71,71
Rem Texture Matrix, dude.
Load image "rock2.bmp",2
Prepare Matrix Texture 1,2,2,2
Rem Place random texture on each matrix tile
For x = 0 To 69
For z = 0 To 69
t = rnd(3)+1
Set Matrix Tile 1,x,z,t
Next z
Next x
Rem update changes to matrix
Update Matrix 1
Rem mY is the variable for random matrix height (The value is now 100)
mY = 100
Rem to avoid an mY = 0 incident.....
If mY < 1 then mY = 1
Rem Randomize the matrix's height upon program startup, according to the mY variable above
Randomize Matrix 1,mY
.... and this is line 83, the line that the error describes:
What's the problem here? Is there a set limit on how many divisions I can have in a matrix, or is there another reason for this problem? And why does it say that the matrix doesn't exist at line 83, even though all I've done is increase the number of divisions?
Thanks in advance.
Bye for now, and happy coding!
Cheers,
Mr.C