Right, well it seems there is a way to get collision working with a model made in cshop. But it's quite hard.
I'll show you this thread I managed to find>
http://forum.thegamecreators.com/?m=forum_view&t=3401&b=10
I also had a small edit of your code. Instead of long lists of IF statements, which I guess is good if you want precision and no unexpected crashes appearing..
menu:
load image "pole position.bmp",1
make object plain 4,5,2
do
sync on
sync rate 80
position object 4,0,2,0
texture object 4,1
if rot2#=360 then rot2#=0
if rot2#<0 then rot2#=0
yrotate object 4,rot2#
rot2#=rot2#+5
load object "h-f1 car-move.x",3
yrotate object 3,90
position object 3,0,-2,0
if rot#=360 then rot#=0
if rot#<0 then rot#=0
yrotate object 3,rot#
rot#=rot#+5
speed2#=0
ink rgb(0,0,0),0
if mousex()>=300 and mousex()<=370 and mousey()>=200 and mousey()<=200+text height("New Game")
ink rgb(500,500,500),1
endif
text 300,200,"New Game"
if mousex()>=300 and mousex()<=370 and mousey()>=200 and mousey()<=200+text height("New Game")
ink rgb(500,500,500),1
if mouseclick()=1
exit
gosub game
endif
endif
sync
loop
return
game:
hide mouse
sync on
sync rate 30
fog on
fog distance 4000
load sound "carstart.wav",1
speed#=0
reversespeed#=0
rem load level
load object "level.x",2
position object 2,100,100,100
floor=object position y(2)
rem load your car
load object "h-f1 car-move.x",1
set object speed 1,50
scale object 1,7800,8200,7000
yrotate object 1,180
position object 1,object position x(1),floor,object position z(1)
do
center text 35,375,"speed="+str$(speed#)
center text 60,400,"reverse speed="+str$(reversespeed#)
Rem Store Object angle
AngleY# = object angle Y(1)
if speed# > 0 then loop object 1
if speed#=0 then stop object 1
If Leftkey()=1 and speed# > 0 then Yrotate object 1,Wrapvalue(AngleY#-3)
If Rightkey()=1 and speed# > 0 then Yrotate object 1,Wrapvalue(AngleY#+3)
if downkey()=1
If Leftkey()=1 and reversespeed# > 0 then Yrotate object 1,Wrapvalue(AngleY#+3)
If Rightkey()=1 and reversespeed# > 0 then Yrotate object 1,Wrapvalue(AngleY#-3)
endif
X# = Object position x(1)
Z# = Object position z(1)
Y# = object position y(2)
Position object 1,X#,Y#,Z#
CameraZ# = Newzvalue(Z#,AngleY#-0,600)
CameraX# = Newxvalue(X#,AngleY#-0,500)
CameraY# = object position Y(1)
position camera CameraX#,CameraY#+400,cameraz#
Point camera X#,Y#+300,Z#
if upkey()=0
if downkey()=1
if speed# > 0
speed#=speed#-2
endif
endif
endif
for speedvalue=1 to 60
if speed#=speedvalue
position object 1,object position x(1),floor,object position z(1)
move object 1,-2
endif
next speedvalue
if upkey()=1
if speed# < 60
speed#=speed#+.5
position object 1,object position x(1),floor,object position z(1)
for speedvalue=1 to 60
if speed#=speedvalue then move object 1,-2
next speedvalue
endif
if upkey()=0 and speed# > 0
if speed# > 0
speed#=speed#-1
endif
endif
if downkey()=1
if speed#=0
if reversespeed# < 10
reversespeed#=reversespeed#+1
for reversevalue=1 to 10
if reversespeed#=reversevalue then move object 1,1
next reversevalue
endif
endif
endif
if downkey()=0
if reversespeed# > 0
reversespeed#=reversespeed#-1
endif
endif
for reversespeed=1 to 10
if reversespeed#=reversespeed then move object 1,1
next reversespeed
sync
loop
return
If you wanted to store height values in an array, you might like to try a height map. If your X model is covered with one single texture (I doubt it, it probably repeats), you could turn it to greyscale and read the values of the colors you get from each pixel. This would take some loading.. or perhaps run some code beforehand, store the values in a file, then read the values in from the text file. I remember finding a height map converter in these forums some place... take a look around.
bleep bleep