|
|
teletransporting a car problems.
#45609
05/12/05 18:33
05/12/05 18:33
|
Joined: Dec 2001
Posts: 2,172 Portugal - Brazil
XNASorcerer
OP
Expert
|
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: Marco_Grubert]
#45616
05/14/05 01:28
05/14/05 01:28
|
Joined: Dec 2001
Posts: 2,172 Portugal - Brazil
XNASorcerer
OP
Expert
|
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
Marco_Grubert
Expert
|
Expert
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
Member
|
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
|
|
|
|