Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AbrahamR, 7th_zorro, dr_panther, 1 invisible), 702 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Physics Problem #333090
07/13/10 23:45
07/13/10 23:45
Joined: Jul 2010
Posts: 129
B
bk9iq Offline OP
Member
bk9iq  Offline OP
Member
B

Joined: Jul 2010
Posts: 129
Hello all,
I was trying to get a physics interaction between my character and a ball in the level such that when the player comes close to the ball, he pushes it in the direction it is supposed to move..
I am using this code but when I am coming close, the ball is not moving at all
Quote:

ENTITY* ball;

function physics_ball()
{

ball = ent_create ("ball.mdl", vector(-400, 0, 100), NULL); // create the ball
c_setminmax(ball);
pXent_settype (ball, PH_RIGID, PH_SPHERE); // set the physics entity type
pXent_setfriction (ball,50); // set the friction on the ground
pXent_setdamping (ball,10,10); // set the damping
pXent_setelasticity (ball,50); // set the elasticity
pXent_setmass(my,1);
while(1)
{

//Pushs the ball if the character is 100 quants nearby
if(vec_dist(player.x,ball.x)<100){
VECTOR temp;
vec_set(temp,ball.x);
vec_sub(temp,player.x);
vec_normalize(temp,4);
pXent_addvelcentral(ball,vector(temp.x,temp.y,temp.z));
}
wait(1);
}
}


I added the #include <ackphysx.h>
and physX_open();

So please what is the problem here

Last edited by bk9iq; 07/13/10 23:46.
Help Please [Re: bk9iq] #333094
07/14/10 00:30
07/14/10 00:30
Joined: Jul 2010
Posts: 129
B
bk9iq Offline OP
Member
bk9iq  Offline OP
Member
B

Joined: Jul 2010
Posts: 129
Any Help please....

Re: Help Please [Re: bk9iq] #333095
07/14/10 00:32
07/14/10 00:32
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Have patience...


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Help Please [Re: Superku] #333128
07/14/10 08:06
07/14/10 08:06
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline
Serious User
Liamissimo  Offline
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Ahhhh good. I also have this problem, take a look at my thread. I am so happy not to be the only one laugh


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Help Please [Re: Liamissimo] #333181
07/14/10 16:57
07/14/10 16:57
Joined: Jul 2010
Posts: 129
B
bk9iq Offline OP
Member
bk9iq  Offline OP
Member
B

Joined: Jul 2010
Posts: 129
@ TheLiam
That's almost the same problem here and there...
I used to use a similar code with the old engine and it was working fine ... And the problem is that this code is given as an example in one of the physics functions in the manual..

So please somebody help us...

Re: Help Please [Re: bk9iq] #333189
07/14/10 17:14
07/14/10 17:14
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline
Serious User
Liamissimo  Offline
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Yes, exactly my problem. When suing the same code as in the manual is also don't work. Not good in a physic based game grin


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Help Please [Re: Liamissimo] #333190
07/14/10 17:15
07/14/10 17:15
Joined: Jul 2010
Posts: 129
B
bk9iq Offline OP
Member
bk9iq  Offline OP
Member
B

Joined: Jul 2010
Posts: 129
Oh yeah me too.. I just don't get physics grin

Re: Physics Problem [Re: bk9iq] #333353
07/15/10 21:30
07/15/10 21:30
Joined: Jul 2010
Posts: 129
B
bk9iq Offline OP
Member
bk9iq  Offline OP
Member
B

Joined: Jul 2010
Posts: 129
If I move the player using pXent_movechar() everything works fine...
however When I use c_move and use the if statement:
if(vec_dist(player.x,ball.x)<100)
The ball doesn't move at all....

In A7 I used to use the same if statement and everything was just fine....
What should I do now?

Re: Physics Problem [Re: bk9iq] #333355
07/15/10 21:37
07/15/10 21:37
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Don`t move a physic object with c_move! Read the manual for this...

Re: Physics Problem [Re: Widi] #333356
07/15/10 21:40
07/15/10 21:40
Joined: Jul 2010
Posts: 129
B
bk9iq Offline OP
Member
bk9iq  Offline OP
Member
B

Joined: Jul 2010
Posts: 129
I am not moving a physics object with c_move .... I did not attach physics to my player therefore I am moving it with c_move ... I just attached physics to the ball.. but What I want is that...
when the player comes close to the ball , the ball moves by adding velocity (as simple as that) ...

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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