Friends.
This Action code is for normal models that have Z point in the midle.
#define Desfase_z skill50
VECTOR temp;
VECTOR vtemp;
VECTOR atemp;
action robotB()
{
c_setminmax(me);
var Distancia_Suelo = 0;
var Porcentaje_Animacion = 0;
var Velocidad_Vertical = 0;
while( player )
{
vec_diff( vtemp, player.x, my.x );
vec_to_angle( atemp, vtemp );
my.pan = atemp.pan;
Distancia_Suelo = c_trace(vector(my.x,my.y,my.z + my.Desfase_z),vector(my.x,my.y,my.z - 4000), IGNORE_ME | IGNORE_PASSABLE | USE_BOX );
my.z -= Distancia_Suelo;
if ( vec_length(vtemp) > 150 )
{
c_move (me, vector( 8 * time_step, 0, 0 ), NULL, IGNORE_PASSABLE | GLIDE);
ent_animate(my, "run", Porcentaje_Animacion, ANM_CYCLE);
Porcentaje_Animacion += 6 * time_step;
Porcentaje_Animacion %= 100;
wait(1);
}
else
{
ent_animate(my, "stand", Porcentaje_Animacion, ANM_CYCLE);
Porcentaje_Animacion += 6 * time_step;
Porcentaje_Animacion %= 100;
wait(1);
}
}
}