Ray casting is the best way to go. I recommend searching the forum for "collision DLL" and installing the plugin, this would be the code for height detection:
rem load the object
load object "terrain.x" , 1
SC_SetupComplexObject 1 , 1 , 2
rem main loop
do
rem do your stuff here
rem check for collision with terrain using ray casting
rem ray is casted from x,10000,z down to x,-10000,z
rem make sure the terrain is in between those two heights.
x# = object position x(3300)
y# = object position y(3300)
z# = object position z(3300)
if SC_RayCast( 1 , x# , 10000 , z# , x# , -10000 , z# , 0 )
rem check if player is below intersection point
if y# < SC_GetStaticCollisionY() then gosub hitobj
endif
rem refresh screen
sync
rem end of main loop
loop
Alternately, if you're too lazy to get the plugin and want much slower code, you can use the built in method (untested):
rem load the object
load object "terrain.x" , 1
rem main loop
do
rem do your stuff here
rem check for collision with terrain using ray casting
rem ray is casted from x,10000,z down to x,-10000,z
rem make sure the terrain is in between those two heights.
x# = object position x(3300)
y# = object position y(3300)
z# = object position z(3300)
if y# < intersect object( 1 , x# , 10000 , z# , x# , -10000 , z# )
gosub hitobj
endif
rem refresh screen
sync
rem end of main loop
loop
TheComet
"if you don't understand recursion than you probably don't understand recursion." ~Jerico2day