Quote: " i want it so it will texture the tile that you are in with image 1 when you click the mouse."
Quote: "now i put prepare matrix texture 1, 1, 1, 1 inside of that last code you gave me JT and when i click on the matrix, the whole thing is filled with image 1"
So, we're getting close then...
For the Prepare Matirx Texture command, what you need to do is first load an image into DB, then, use that image number as the image flage for the Prepare Matrix Texture command.
In that loaded image, you should have all your matrix textures. ie;
_____________________________________________________________
| | |
| | |
| | |
| | |
| | |
| Texture 1 | Texture 2 |
| | |
| | |
| | |
| | |
|______________________________|______________________________|
| | |
| | |
| | |
| | |
| Texture 3 | Texture 4 |
| | |
| | |
| | |
| | |
| | |
|______________________________|______________________________|
But, you can have alot more than 4 textures in the one image... you just have to make sure they're all in a grid.
Then when you use Prepare Matrix Texture, say that the above grid makes up image 1, that would mean you would use
Prepare Matrix Texture 1,1,2,2
The first "1" being the matrix number, the second "1" being the image number and the following "2's" being how many tiles across and down you have in the image itself.
Thus, you have effectively divided the Image 1 into 4 texture
tiles.
Therefore, when using Set Matrix Tile, you need to use the tile number to specify what tile you will use to texture that tile.
Set Matrix Tile 1,tilex,tilez,1
In this, the first "1" is the matrix number, the "tilex" is which tile on the x-axis of the matrix will be textured, and the same for the "tilez", finally, the last "1" is the texture
tile you wish to use. And in this case, I have used tile 1, which, in the above grid of the imgage 1, is Texture 1 ( ie, the upper-left texture ).
Therefore, the code you need would be somwthign along the lines of:
Load Image "image.bmp",1
Prepare Matrix Texture 1,1,1,1
` using 1,1,1,1 as it is matrix 1, image 1 and only one texture in the image.
Do
tilex = Int(Object Position X(1)/tilewidth)
tilez = Int(Object Position Z(1)/tiledepth)
if mouseclick() = 1
set matrix tile 1, tilex, tilez, 1
endif
Loop
And Voila, that should texture the clicked tile.
Hope I Helped...

Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy