Hi!
I`m converting my game from c-script to lite-c. I`m using c_trace in the player-script, but it gives me a much too high value. To the code:
Code:
while(1)
{ [...]
vec_set(temp,my.x);
vec_set(player_pos,temp);
temp[2]-=5000;
hight_above_ground=c_trace(player_pos,temp,IGNORE_ME|IGNORE_FLAG2|IGNORE_PASSENTS|IGNORE_SPRITES|USE_BOX);
if(hight_above_ground<62){player_gravitiy[2]=time_step*move_knee_force;}
else{if(hight_above_ground>64){player_gravitiy[2]-=gravitation*time_step;}
else{player_gravitiy[2]=0;}}
if((move_jump)&&(hight_above_ground<64)){player_gravitiy[2]=jump_force*time_step;snd_play(jumpsound,soundlautstaerke,0);}
c_move (spieler,nullvector ,player_gravitiy,IGNORE_PASSABLE|IGNORE_SPRITES|GLIDE|USE_BOX);
wait(1)
}
The result is a never ending "moving knee" - the player moves up like an elevator. If I replace c_trace with a fixes value (63) the script works, but only for one hight of course. Do you know what is wrong?