Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 635 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
help needed ...Kickin a ball to an upper corner #47840
06/14/05 13:22
06/14/05 13:22
Joined: Jun 2005
Posts: 9
T
therage1 Offline OP
Newbie
therage1  Offline OP
Newbie
T

Joined: Jun 2005
Posts: 9
I have a player, and a soccer ball...
I kick the ball with phent_addcentralforce, but the ball never go to an upper direction (in z axis), any suggestions?

Re: help needed ...Kickin a ball to an upper corne [Re: therage1] #47841
06/14/05 13:54
06/14/05 13:54
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
maybe a lil more info about what force you add. if you dont apply a force in z-direction then the ball wont move there (if it doent hit something)


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: help needed ...Kickin a ball to an upper corne [Re: ello] #47842
06/14/05 16:48
06/14/05 16:48
Joined: Jun 2005
Posts: 9
T
therage1 Offline OP
Newbie
therage1  Offline OP
Newbie
T

Joined: Jun 2005
Posts: 9
I'm following a template,
I know that the z is part of my_pos1, this is the code:

Var m;
Var m_1;
Var my_pos1;

action soccer_ball
{
soc_ball = my;
my.skill1 = 10000;
my.skill2 = 1000;
phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setmass(my, 0.2, PH_SPHERE);
phent_setfriction(my, 75);
phent_setelasticity(my, 75, 25);
phent_setdamping(my, 50, 75 );
ph_setgravity( vector(0,0,-200) );
}

action my_player
{
person_3rd = 1;
player_walk();

while(1)
{
while(soc_ball == null){wait(1);}
if(key_space == 1 && vec_dist(my.x,soc_ball.x) < 75)
{
while(key_space == 1 && m < soc_ball.skill1)
{
m += soc_ball.skill2;
m_1 = m/soc_ball.skill2;
wait(1);
}
vec_set(temp,nullvector);
temp.X = cos(my.PAN);
temp.Y = sin(my.PAN);
temp.Z = m*cos(0);
MY_POS1.X = my.X + temp.Z*temp.X;
MY_POS1.Y = my.Y + temp.Z*temp.Y;
MY_POS1.Z = my.Z + m*sin(0);
phent_addcentralforce(soc_ball,MY_POS1);

m = 0;m_1 = 0;
}
wait(1);
}
}

thanks

al

Re: help needed ...Kickin a ball to an upper corne [Re: therage1] #47843
06/14/05 17:12
06/14/05 17:12
Joined: Jun 2005
Posts: 9
T
therage1 Offline OP
Newbie
therage1  Offline OP
Newbie
T

Joined: Jun 2005
Posts: 9
ok...i found the answer, is somethig about the cos and sin, in My_pos

oh god bless arithmetics.....thank you

Re: help needed ...Kickin a ball to an upper corne [Re: therage1] #47844
01/18/06 03:03
01/18/06 03:03
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
You might be able to use vec_rotate rather than doing the trig calculations yourself.

Re: help needed ...Kickin a ball to an upper corne [Re: Marco_Grubert] #47845
01/24/06 02:43
01/24/06 02:43
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
hmm....
just check "phent_addforcelocal(entity, vecforce, vecpoint );"

If you want to program the physics of a ball seriously and realistic you need to handle/understand this function.
You can exactly say where a force is applyed to an entity/ball. give it a negative z-value(on vecpoint) and it will hopp like a grasshopper like it should,
you also can make a spinshot when you change vecpoint.x and/or vecpoint.y while performing a shot/pass

I would recommand you to explore
"phent_addforcelocal(entity, vecforce, vecpoint );"
it will helps you out thats for sure ^^

cheers

Zwecklos


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