look for the example code for the terrain commands, you need more than just make terrain, you need to load the heightmap, a texture, a detail texture, THEN build the terrain, then update it, and you might need to scale and position it depending on the size of your bitmap, plus IIRC you need your maps to be multiple power of 2 sizes, and make sure you have the 5.9 update since the "correct" terrain commands are not in the earlier versions of Pro (it had a simplified terrain functionality that was not very useful)
edit: heres a function to create a terrain, you just to load the three bitmaps at the start (could be any name actualy)
function Create_World()
load image "texture.bmp", 1
load image "detail.bmp", 2
load image "map.bmp",3
if object exist(1)
delete object 1
endif
make object terrain 1
set terrain heightmap 1, "map.bmp"
set terrain scale 1,10,1,10
set terrain split 1, 16
set terrain tiling 1, 4
set terrain light 1, 1, -0.4, 0, 1, 1, 1, 0.5
set terrain texture 1, 1, 2
build terrain 1
endfunction
[edit-edit] heres a whole program I found lurking on my hd, the detail texture has been altered to give a chequred pattern since Pro no longer has the ability to draw circles that go off the edge of the bitmap without crashing, as it could when the code was originaly written, and I can`t be bothered to sort it, it also crashes when you try to create a new heightmap, all these problems are actualy down to changes made in the upgrades, it used to compile and work as intended, but now its broken and needs sorting, feel free to do as you please with it.
Rem Project: TerraMagica
Rem Created: 26/03/2005 11:24:45
Rem ***** Main Source File *****
sync on: sync rate 0: hide mouse
randomize timer()
sync:sync
if file exist("times.ran")
open to read 1,"times.ran"
read word 1,history
close file 1
delete file "times.ran"
inc history
open to write 1,"times.ran"
write word 1,history
close file 1
else
open to write 1,"times.ran"
write word 1,1
close file 1
endif
backdrop on: autocam off: set camera range 0.01, 50000
color backdrop rgb(88,0,180)
make object sphere 2,50
color object 2,rgb(255,0,0)
Make_Map()
Make_Texture()
Detail_Bitmap()
Create_World()
position camera 1250,0,1250
set camera view 5,5,400,300
make camera 1
position camera 1,1250,2300,1250
point camera 1,1250,0,1250
set camera view 1,415,310,630,470
worlds=1
draw sprites last
do
control camera using arrowkeys 0,0.1,1
hi# = get terrain ground height( 1, camera position x( ), camera position z( ) )
position camera camera position x( ), hi# + 1.8, camera position z()
if spacekey()
Make_Map()
Create_World()
endif
if scancode()=59
Make_Texture()
Create_World()
endif
if scancode()=60
Detail_Bitmap()
Create_World()
endif
if scancode()=61
text 300,240,"WORKING":sync
copy file "texture.bmp","world texture "+str$(worlds)+"_"+str$(history)+".bmp"
copy file "detail.bmp","world detail "+str$(worlds)+"_"+str$(history)+".bmp"
copy file "map.bmp","world map "+str$(worlds)+"_"+str$(history)+".bmp"
inc worlds
text 300,240,"WORLD SAVED!"
sync
wait 2000
endif
update terrain
ink rgb(255,255,255),0
text 410,5,"scene framerate:"+str$(screen fps())+" "
text 410,20,"x position:"+str$(camera position x())+" "
text 410,35,"z position:"+str$(camera position z())+" "
text 410,50,"y position:"+str$(camera position y())+" "
text 410,80,"press space to generate a"
text 410,95,"new heightmap."
text 410,120,"press F1 to generate a"
text 410,135,"matching new texture."
text 410,160,"press F2 to create a"
text 410,175,"new detail map."
text 410,200,"press F3 to save the"
text 410,215,"current world"
text 410,240,"Fast terrain Prototype"
text 410,255,"tool v0.01 © Mentor"
text 425,295,"Location & Current View"
text 25,445,"Texture Heightmap Detail"
sprite 1,5,310,1
scale sprite 1,50
sprite 2,143,437,3
rotate sprite 2,-90
scale sprite 2,50
sprite 3,280,310,2
scale sprite 3,50
position object 2,camera position x(),camera position y(),camera position z()
if camera position x()<0 then position camera 0,camera position y(),camera position z()
if camera position x()>2500 then position camera 2500,camera position y(),camera position z()
if camera position z()<0 then position camera camera position x(),camera position y(),0
if camera position z()>2500 then position camera camera position x(),camera position y(),2500
sync
loop
function Create_World()
`text 300,240,"WORKING":sync
load image "texture.bmp", 1
load image "detail.bmp", 2
load image "map.bmp",3
if object exist(1)
delete object 1
endif
make object terrain 1
set terrain heightmap 1, "map.bmp"
set terrain scale 1,10,1,10
set terrain split 1, 16
set terrain tiling 1, 4
set terrain light 1, 1, -0.4, 0, 1, 1, 1, 0.5
set terrain texture 1, 1, 2
build terrain 1
endfunction
function Make_Texture()
text 300,240,"WORKING":sync
if file exist("texture.bmp")
delete file "texture.bmp"
endif
load bitmap "map.bmp",1
create bitmap 2,255,255
for i=0 to 254
for l=0 to 254
set current bitmap 1
Red=rgbr(point(i,l))
set current bitmap 2
if Red<36
Colour=rgb(rnd(40)+5,rnd(15)+5,rnd(15)+5)
dot l,254-i,Colour
endif
if Red>35 and Red<140
Colour=rgb(rnd(10)+5,rnd(60)+10,rnd(10)+5)
dot l,254-i,Colour
endif
if Red>150
Colour=(rgb(Red,Red,Red))
dot l,254-i,Colour
endif
next l
next i
get image 2,0,0,254,254
save image "texture.bmp",2
delete image 2
delete bitmap 1
delete bitmap 2
endfunction
function Detail_bitmap()
text 300,240,"WORKING":sync
if file exist("detail.bmp")
delete file "detail.bmp"
endif
create bitmap 4,256,256
set current bitmap 4
for i=1 to 262000
Grey=rnd(200)+50
ink rgb(Grey,Grey,Grey),0
diam=rnd(10)+3
circle rnd(220)+20,rnd(220)+20,diam
next i
get image 4,0,0,254,254
save image "detail.bmp",4
delete bitmap 4
delete image 4
endfunction
function Make_Map()
text 300,240,"WORKING":sync
if file exist("map.bmp")
delete file "map.bmp"
endif
create bitmap 1,256,256
set current bitmap 1
lock pixels
for l=1 to 120
col=rnd(200)
ink rgb(col,col,col),0
diam = rnd(30)+3
xpos=rnd(200)+40
ypos=rnd(200)+40
for i=1 to diam
circle xpos,ypos,i
next i
next l
for i=1 to 100
w=rnd(255)
x=rnd(255)
y=rnd(255)
z=rnd(255)
col=rnd(200)
ink rgb(col,col,col),0
line w,x,y,z
next i
for i=1 to 1000
x=rnd(255)
y=rnd(255)
value=point(x,y)
value=rgbr(value)
bumpdip=rnd(1)
if bumpdip=1 and value<225
dot x,y,value+rnd(10)
endif
if bumpdip=0 and value>10
col=value-rnd(10)
dot x,y,rgb(col,col,col)
endif
next i
blur bitmap 1,6
get image 1,0,0,254,254,1
save image "map.bmp",1
delete image 1
set current bitmap 0
delete bitmap 1
endfunction
I have included the exe compiled under patch 6 pre-release, feedback on any problems would be cool (note sexy 1.5mb file size..new files are much smaller, only 7mb uncompressed).
Windows system error, an unknown error in DLL >Unknown< has caused an unknown fault, keyboard not detected, press any key to continue or hard reset to erase C:.