Are you returning the height of the land? And if so, what functions are you using for that, specifically?
You should be using
getStaticCollisionX()
getStaticCollisionY()
getStaticCollisionZ()
In this line:
if IntersectObjectDBC(100,0,wx,50000,wz,wx,-50000,wz,1)
the 1 at the end is an exclusion of object 1, it's not being tested. What happens if you change this value to 0?
Also make sure you are using float values for xyz .
Make sure your landscape has it's normals pointing outwards, towards the ray. The ray will not return collision detection if it is hitting the back of a face. That means if you are inside a box and casting the ray from inside the box, it will not detect collision with the walls unless the box is inside out. Likewise, is you are under the terrain and cast a ray up, it will not detect collision unless your terrain has normals on both sides.
And it doesn't seem to be the range, this bit of code returns true on collision:
sync on
sync rate 0
#include "DBCcollisions.dba"
load dll "DBCcollision.dll",1
make object cube 1,25
`setupComplexObjectDBC(<objNum>,<GroupNum>,<FacesPerNode>)
setupComplexObjectDBC(1,0,8)
do
`intersectObjectDBC(<obj/groupNum>,<GroupFlag>,<oldx>,<oldy>,<oldz>,<x>,<y>,<z>,<excludeObj>)
result=intersectObjectDBC(1,0,0.0,50000.0,0.0,0.0,-50000.0,0.0,0)
text 0,0,str$(result)
sync
loop
Make sure you are using updateObjectDBC(<objNum>
Enjoy your day.