3 registered members (Joey, flink, AndrewAMD),
1,226
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
c_move odd behaviour
#269129
06/01/09 22:19
06/01/09 22:19
|
Joined: Jan 2009
Posts: 57 Slovakia
wolodo87
OP
Junior Member
|
OP
Junior Member
Joined: Jan 2009
Posts: 57
Slovakia
|
Hello again. So my simulations are done and now I am trying to work on "real game" I use c_move firs time. As I found in manual, it should detect colisions, but... This code should be bouncing ball. It simply falls down, when it hits ground it bounces up and so on. Every time it colides with obstacle, the system beeps. I found out that the system beeps also when the ball is in its top position even there are no obstacles there. But when the camera doesnt look at it, the function works as I expect. I do not understand it...is it normall? Can someone help? (I do not want to use physics engine if it is not absolutely necessary) Thanx in advance. #include <acknex.h>
#include <default.c>
#include <litec.h>
#include <d3d9.h>
#include <opengl.h>
ENTITY* drop;
var x=0;
function main()
{
level_load ("levels/level1.wmb");
wait(2);
drop=ent_create("models/drop.mdl", vector(camera.x,camera.y+800,camera.z+200), IGNORE_ME);
while(1)
{x-=0.1*time_step;
camera.x=drop.x;
camera.y=drop.y-200;
camera.z=drop.z;
c_move(drop,vector(0,0,x),nullvector,NULL);
if(trace_hit)
{
x=-x-0.2;
beep();
}
wait(1);
}
}
|
|
|
Re: c_move odd behaviour
[Re: DLively]
#269381
06/02/09 21:58
06/02/09 21:58
|
Joined: Jan 2009
Posts: 57 Slovakia
wolodo87
OP
Junior Member
|
OP
Junior Member
Joined: Jan 2009
Posts: 57
Slovakia
|
There is no more source yet. This is all (except that mistake in ent_create). Here is whole project to download: http://wolodo.yweb.sk/DROPS.rarIt is small..just about 180kB So...it behaves like this: ball bounces with some energy loss. It beeps only when ball really hits the floor. Some time later it begins to beep also when the ball doesnt hit the floor, but just, when the camera looks at it. Id the camera looks away from ball, it beeps only when the ball hits the floor...strange Maybe someone could test it. If you will not notice this bug, than the problem can be probably in my system. I will be gratefull if someone try to run this script and write me a repport.
|
|
|
Re: c_move odd behaviour
[Re: wolodo87]
#269385
06/02/09 22:20
06/02/09 22:20
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
I tried it,
I cant script with lite-C!!!!!
But my results were:
1st run: beeped three times, then on the way up beeped and then only when it hit the ground. 2nd: it didnt beep unless it hit the ground. 3rd time: same as the first run.
Im sorry I cant help you, Since its in C.
But in the last second ive had an idea.
Try and see if its hitting the cameras.x again or something. in c-script I can use trace_mode = ignore_me; or in c_move instead of null, ignore_me; but that doesnt work with lite-C.
Last edited by DevoN; 06/02/09 22:20.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|