Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
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
6 registered members (3run, AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip), 605 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
teletransporting a car problems. #45609
05/12/05 18:33
05/12/05 18:33
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
I am using this code to change the location of a car with the template car system. Why is the car exploding to far away? This is for make the car to get back to the road at the coordenates.

Code:
 Function GetBackToRoad()
{
phent_enable( plCar01_entity, 0);
vec_set(plCar01_entity.x, checkpoint_pos);
vec_set(plCar01_entity.pan, checkpoint_pan );
phent_enable( plCar01_entity, 1);
}



Last edited by Sorcerer; 05/12/05 18:38.
Re: teletransporting a car problems. [Re: XNASorcerer] #45610
05/13/05 16:54
05/13/05 16:54
Joined: Sep 2002
Posts: 758
Sunny Scotland
xoNoid Offline
Developer
xoNoid  Offline
Developer

Joined: Sep 2002
Posts: 758
Sunny Scotland
Try these changes:

Code:
 
Function GetBackToRoad()
{
phent_enable(plCar01_entity, 0);
wait(1);
vec_set(plCar01_entity.x, checkpoint_pos);
vec_set(plCar01_entity.pan, checkpoint_pan );
phent_enable( plCar01_entity, 1);
wait(1);
}

I remember having a problem like this. If I remember correctly this fixed it.



Re: teletransporting a car problems. [Re: xoNoid] #45611
05/13/05 18:29
05/13/05 18:29
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
With this the car disappers and reappers at the same place.
But thanks anyway.

Re: teletransporting a car problems. [Re: XNASorcerer] #45612
05/13/05 19:01
05/13/05 19:01
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
Peharps, I have to stop all forces or something. Any ideas?

Re: teletransporting a car problems. [Re: XNASorcerer] #45613
05/13/05 21:15
05/13/05 21:15
Joined: Sep 2002
Posts: 758
Sunny Scotland
xoNoid Offline
Developer
xoNoid  Offline
Developer

Joined: Sep 2002
Posts: 758
Sunny Scotland
Oh yes try doing that. Add a phent_clearvelocity(my);

Re: teletransporting a car problems. [Re: xoNoid] #45614
05/13/05 22:00
05/13/05 22:00
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
No, not yet. Perhaps it has something to be with the group, because the car has 5 physics objects, the chassis and 4 tyres.

Re: teletransporting a car problems. [Re: XNASorcerer] #45615
05/14/05 01:22
05/14/05 01:22
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'll have to make sure that all objects in the group get moved- just putting the car body in a new place will cause problems. clearvelocity should not be necessary as long as you do have an enable call after changing the position.

Re: teletransporting a car problems. [Re: Marco_Grubert] #45616
05/14/05 01:28
05/14/05 01:28
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
Ok. It is working now. But the manual says : "If more than one entity is to be changed, it's more efficient to use ph_selectgroup instead. " How can I use the ph_selectgroup function to do that?
Thanks.
Code:
 
Function GetBackToRoad()
{
phent_clearvelocity(plCar01_entity);
phent_clearvelocity(plCar01_FL);
phent_clearvelocity(plCar01_FR);
phent_clearvelocity(plCar01_RL);
phent_clearvelocity(plCar01_RR);
phent_enable( plCar01_entity, 0);
phent_enable( plCar01_FL, 0);
phent_enable( plCar01_FR, 0);
phent_enable( plCar01_RL, 0);
phent_enable( plCar01_RR, 0);
//wait(1);
vec_set(plCar01_entity.x, checkpoint_pos);
vec_set(plCar01_FL.x, checkpoint_pos);
vec_set(plCar01_FR.x, checkpoint_pos);
vec_set(plCar01_RL.x, checkpoint_pos);
vec_set(plCar01_RR.x, checkpoint_pos);
vec_set(plCar01_entity.pan, checkpoint_pan );
phent_enable( plCar01_entity, 1);
phent_enable( plCar01_FL, 1);
phent_enable( plCar01_FR, 1);
phent_enable( plCar01_RL, 1);
phent_enable( plCar01_RR, 1);
}



Last edited by Sorcerer; 05/14/05 03:42.
Re: teletransporting a car problems. [Re: XNASorcerer] #45617
05/16/05 21:34
05/16/05 21:34
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
Quote:

Ok. It is working now. But the manual says : "If more than one entity is to be changed, it's more efficient to use ph_selectgroup instead. " How can I use the ph_selectgroup function to do that?


Ph_selectgroup is not going to help in this case since you want GameStudio to individually enable each object so that the new coordinates get copied over. ph_selectgroup doesn't check the coordinates.

Re: teletransporting a car problems. [Re: Marco_Grubert] #45618
03/21/06 06:32
03/21/06 06:32
Joined: Sep 2003
Posts: 281
Arkansas\USA
raiden Offline
Member
raiden  Offline
Member

Joined: Sep 2003
Posts: 281
Arkansas\USA
I found this old post, but it's right on for what I'm needing to ask. Basically I have had no luck with ph_selectgroup. What I have done is set my physics objects phent_setgroups ID with a skill, using powers of 2(2,4,8,16, etc.) Like this in the action: phent_setgroup(me,my.groupID);

Now I did have several objects that shared the same group ID because they were in the same area, but they would never collide with each other.

So after that, I tried calling ph_selectgroup(2); to enable physics with the groupID of 2, and dis-able the rest, but it didn't work, I collided with objects of a group 2 id and they behaved like a physics ent. I tried it with ph_selectgroup(14) // 2+4+8, and bumped into objects with a groupid of 16, and they behaved normally.

I don't get it, the manual says this turns them on and off.

Thanks

-raiden


"It doesn't matter if we win or lose, it's how we make the game."
--------------------
Links: 3DGS for Dummies

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