Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 04/29/26 18:09
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (Quad), 5,729 guests, and 19 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ukgamer, valino, juergenwue, VladMak, Geir
19210 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_trace problem #190230
03/25/08 15:41
03/25/08 15:41
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
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?

Re: c_trace problem [Re: Rondidon] #190231
03/25/08 16:14
03/25/08 16:14
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
Hello,

have you already checked where the trace hits?
You could do this by using draw_point3d.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1