That's the old terrain commands
You better use the Advanced terrain commands
(media attached)
rem Advanced Terrain System - TS tests
_________CODE_TOP_____________:
sync on
backdrop on
autocam off
set global collision off
hide mouse
hgtmapsize=256
terrscale=100
terrheightscale=100
landsize=hgtmapsize*terrscale
x#=landsize/2:z#=landsize/2
watersize=landsize:waterheight=-100
skysize=landsize*2
gosub create_terrain1
gosub make_sky
gosub set_ambient
gosub make_walker
active=100
gosub Resetcam
sync rate 60
_______THE_DO_LOOP_______:
do
oldx#=x#
oldz#=z#
if inkey$()="e" then sync rate 0
if inkey$()="E" then sync rate 60
if inkey$()="0" then x#=0.0:z#=0.0
x#=newxvalue(x#,a#,s#)
z#=newzvalue(z#,a#,s#)
th#=get terrain ground height(1,x#,z#)
gosub walker_control
position object active,x#,th#,z#:yrotate object active,a#
gosub update_camera
gosub camera_controls
gosub information
position object 99,x#,0,z#
scroll object texture 99,0.00002,0.00002
update terrain
sync
loop
______MOVEMENT_CONTROL______:
walker_control:
if upkey()=1 and s#<6 then s#=s#+0.3
if downkey()=1 and s#>-6 then s#=s#-0.3
if leftkey()=1 then a#=wrapvalue(a#-2)
if rightkey()=1 then a#=wrapvalue(a#+2)
if inkey$()="ù" then s#=0.0
if inkey$()="à" then s#=60.0
return
_______WORLD_BUILD_________:
create_terrain1:
rem this is the terrain texture (ground landscape)
load image "terrtexture2.bmp",1,0
rem this is the detail texture (tiled on top of
rem the land texture according to the tiling command)
load image "detail.tga",2
rem make the object terrain
make object terrain 1
rem profile it according to the heightmap gray scale
set terrain heightmap 1, "heightmap256.bmp"
rem set the scale (size) of the terrain - (xlength,height,zlength)
rem it equals the heightmap size x the scale factor
rem in this case 256 x 100 = 25600 DBP units
set terrain scale 1,terrscale,terrheightscale,terrscale
rem split value (number of limbs for culling)
set terrain split 1,8
rem detail map tiling
set terrain tiling 1,4
rem light - xdir, ydir, zdir, red, green, blue, intensity
set terrain light 1,0.6,0.6,0.6,1.0,1.0,0.9,0.9
rem texture the terrain with base (1) and detail (2) texture
set terrain texture 1, 1, 2
rem finally build the terrain
build terrain 1
return
make_sky:
rem sky texture
load image "skytexture.bmp",20
make object sphere 99,skysize,20,20
scale object 99,100,50,100
set object 99,1,1,0,1,1,1,1
texture object 99,20
scale object texture 99,5,5
return
set_ambient:
set ambient light 80
fog on
fog color rgb(200,200,200)
fog distance 26000
return
_________CHARACTERS__________:
make_walker:
make object sphere 100,20
set object 100,1,1,0,1,1,1,1
return
_______INFORMATION______:
information:
set cursor 0, 0
print "fps = ",screen fps ( )
print "polygon count = ",statistic(1)
print
print "x# = ",x#
print "z# = ",z#
print "h# = ",h#
print
print "th# = ",th#
print "landsize = ",landsize
return
______CAMERA__ROUTINES___:
camera_controls:
if inkey$()=">" then gosub Resetcam
if inkey$()="m" then camhgt=2000:camrot=0:camdist=-4000:camlen=550
if inkey$()="M" then camhgt=5000:camrot=0:camdist=-6000:camlen=2000
mymousex=mousemovex()
if mymousex>0 then a#=a#+1
if mymousex<0 then a#=a#-1
mymousey=mousemovey()
if mymousey>0 then camlen=camlen+5
if mymousey<0 then camlen=camlen-5
return
update_camera:
rem Position camera to the back of the character
ca#=wrapvalue(a#)
cx#=newxvalue(x#,ca#,camdist)
cz#=newzvalue(z#,ca#,camdist)
cy#=th#+camhgt
position camera cx#,cy#+camhgt,cz#
point camera x#,cy#+camlen,z#
yrotate camera ca#
return
Resetcam:
set camera range 10,skysize*1.1
camdist=-300
camhgt=120
camrot=0
camlen=0
return
end