If you don't want to use arrays and want to use whatever matrix you are currently using where heights are not stored anywhere you can use modified version of my code that you couldn't understand.
I tried to make my previous example easy to understand. The idea being to retrieve height at centre of any tile and then do what yo like with that height. My example simply stuck an object there to show you it working. All you had to do was use a bit of logic to texture the tile.
Glad to hear you are getting to grips with things anyway.
sync on : sync rate 60 : autocam off : randomize timer()
sizex=2000
sizez=2000
tilesx=64
tilesz=64
` rock texture
ink rgb(128,128,128),0
box 0,0,64,64
ink rgb(0,0,0),0
for f=1 to 50 : dot rnd(63),rnd(63) : next f
` grass texture
ink rgb(0,255,0),0
box 64,0,128,64
ink rgb(0,0,0),0
for f=1 to 50 : dot 64+rnd(63),rnd(63) : next f
` grab textures into image 1
get image 1,0,0,128,64,1
` make a matrix
make matrix 1,sizex,sizez,tilesx,tilesz
set matrix 1,0,0,1,2,1,1,1
set matrix trim 1,0.01,0.01
prepare matrix texture 1,1,2,1
` set the heights to make a landscape
for x=0 to tilesx
for z=0 to tilesz
set matrix height 1,x,z,(100.0*cos(x*15+(z*2)))+(30.0*sin(z*10.0))
n#=(5+(rnd(5)))/10.0
set matrix normal 1,x,z,n#,n#,n#
next z
next x
` texture each tile over 70 with rock, otherwise grass
for x=0 to tilesx-1
for z=0 to tilesz-1
` get world coordinates of centre of each tile
x#=sizex*(x+0.5)*1.0/tilesx
z#=sizez*(z+0.5)*1.0/tilesz
` get height at that position
h#=get ground height(1,x#,z#)
tex=2
if h# > 70 then tex=1
set matrix tile 1,x,z,tex
next z
next x
update matrix 1
position camera sizex/2,200,0
pitch camera down 20
do
control camera using arrowkeys 0,5,5
sync
loop
Boo!