Ok. I've understood your problem as follows:
You've made a terrain in an extern program (Maya), that is not an A7-terrain but an A7-model. You want it to behave like a terrain.
AFAIK you only have to set(terrain,POLYGON). When "polygon" is set, the model still needs a bounding box. When c_trace/c_move hits the bounding box, then (!) the engine will check the polygonal shape and if there is contact or not. So it's fine if the bbox is a little bit bigger than the model itself.
Here is a code that I've written some days ago for someone else, so I know that it works (you may test the current model/ situation with it):
action player_walk() {
var anim_percent = 0;
var grounddist, key_space_released = 0;
VECTOR speed,temp;
vec_set(speed,nullvector);
wait(1);
vec_set(temp,vector(-15,-15,-20)); // die bounding box setzen
vec_scale(temp,my.scale_x); //falls der spieler im level eine andere größe als 1 hat
vec_set(my.min_x,temp);
vec_set(temp,vector(15,15,20)); // die bounding box setzen
vec_scale(temp,my.scale_x); //falls der spieler im level eine andere größe als 1 hat
vec_set(my.max_x,temp);
my.z += 232;
while(1) {
if(!key_space) { key_space_released = 1; } // endlose Sprungwiederholung bei gedrückter Taste verhindern
if(key_a || key_d) {
my.pan = 180*key_a;
anim_percent += 8*time_step;
ent_animate(me, "run", anim_percent, ANM_CYCLE);
}
else {
anim_percent += 4*time_step;
ent_animate(me, "stand", anim_percent, ANM_CYCLE);
}
speed.x += (45*(key_d-key_a)-speed.x)/3*time_step; // sanftes beschleunigen
grounddist = c_trace(my.x,vector(my.x,my.y,my.z-150),IGNORE_ME | USE_BOX);
grounddist = clamp(grounddist+150*(!trace_hit),-5,150);
if(grounddist < 10 && speed.z <= 0) {
my.z -= grounddist-5;
speed.z = 0;
if(key_space && key_space_released) {
speed.z = 50;
}
}
else { speed.z += maxv((-60-speed.z)/5,-7)*time_step; }
c_move(my,nullvector, vector(speed.x*time_step,0,speed.z*time_step),GLIDE);
//Cameraposition
camera.x = 100+my.x;
camera.y = -2500;
camera.z = 400+my.z;
camera.pan = 90;
camera.tilt = -5;
wait(1);
}
}
Next, try using the polygon flag in trace_mode (I've never used it before, pls check the manual).
Then try it with a normal A7-terrain from MED.
EDIT: I'm not sure what your code should do:
// adjust entity to the ground height, using a downwards trace
if(c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_PASSABLE|IGNORE_ME) > 0)
dist_down= my.z + vFeet.z - hit.z; // always place player's feet on the ground
else
[b]dist_down = 0;[/b]
if((dist_down > 0))
{
dist_down = [b]clamp(dist_down,100,accelerate(speed_down,-nc_gravity * time_step,0.1));[/b]
}
The limits in clamp are -,+ not +,- if I read your code right.
Then why do you set down_dist = 0; ? (I did not spend much time on understanding it, though)
Have you tested the code with block geometry?
Then, try if(down_dist >
5) { ... }.