Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Joey, flink, AndrewAMD), 1,226 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_move odd behaviour #269129
06/01/09 22:19
06/01/09 22:19
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline OP
Junior Member
wolodo87  Offline 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" smile
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.

Code:
#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: wolodo87] #269139
06/01/09 23:13
06/01/09 23:13
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Probably an unusual reaction to an unusual code.
You mixed up ent_create and c_move, IGNORE_ME has no place in ent_create and in c_move at least me, I wouldn't expect a NULL.^^

Re: c_move odd behaviour [Re: Pappenheimer] #269181
06/02/09 07:13
06/02/09 07:13
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline OP
Junior Member
wolodo87  Offline OP
Junior Member

Joined: Jan 2009
Posts: 57
Slovakia
nope, this is not the reason. That IGNORE_ME is just mistake. I made many atempts to fix this and finally I forgot to remove this. It is not included in my original code. Other source is same...
Any oyher ideas?

Re: c_move odd behaviour [Re: wolodo87] #269370
06/02/09 20:55
06/02/09 20:55
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
perhaps if we seen the actual code your trying to use, it would benefit you too.


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
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 Offline OP
Junior Member
wolodo87  Offline 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.rar
It 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 smile
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 Offline
Serious User
DLively  Offline
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.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: c_move odd behaviour [Re: DLively] #269394
06/02/09 22:58
06/02/09 22:58
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline OP
Junior Member
wolodo87  Offline OP
Junior Member

Joined: Jan 2009
Posts: 57
Slovakia
So I have tryied some experiments. Then I realized that c_move-s trace_hit is crap. I used classic c_trace for colision detection and finally everything works. Thanks all for advice.


Gamestudio download | chip programmers | 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