Hey all.

Again probably a lame question but im gonna pop it in here anyway.
I am spawning some prop_physics_multiplayer into an explosion, so I cannot
use TempEnts->PhysicsProp as it gets destroyed in the blast it is spawned
in.
My problem is making them interacable to other explosions etc or being shot
or anything other than being pushed by player movement.
If I change COLLISION_GROUP_PUSHAWAY to COLLISION_GROUP_NONE then they push
players away instead of vice-versa.

Any help would be gratefully appreciated.

[CODE]
CPhysicsProp *pBase = (CPhysicsProp *)CreateEntity(
"prop_physics_multiplayer", -1 );
if ( !pBase )
  {
      HUD_printAll( "No pBase for prop_physics !" );
      return;
  }
}
pBase->SetModel( ModelName );

Vector vTeleport;
Vector VecDir;
VecDir.x = m_Random->RandomFloat( -500, 500 );
VecDir.y = m_Random->RandomFloat( -500, 500 );
VecDir.z = m_Random->RandomFloat( -10, 500 );

vOrigin= (Explosion Origin);
vOrigin.z += m_Random->RandomInt( 30, 70 );
vOrigin.x += m_Random->RandomInt( -10, 10 );
vOrigin.y += m_Random->RandomInt( -10, 10 );
ang = QAngle( m_Random->RandomInt( -10, 10 ), m_Random->RandomInt( -10,
10 ), m_Random->RandomInt( -10, 10 ) );

pBase->SetCollisionGroup( COLLISION_GROUP_PUSHAWAY );
pBase->SetMoveType( MOVETYPE_VPHYSICS, MOVECOLLIDE_DEFAULT );
pBase->SetMaxHealth( 20 );
pBase->SetHealth( 20 );
if ( pBase->CreateVPhysics() )
{
  pBase->SetCollisionBounds( -Vector(15,15,15), Vector(15,15,15) );
  pBase->SetMoveType( MOVETYPE_VPHYSICS, MOVECOLLIDE_DEFAULT );
  pBase->SetCollisionGroup( COLLISION_GROUP_PUSHAWAY );
  pBase->SetMaxHealth( 20 );
  pBase->SetHealth( 20 );
  IPhysicsObject *IPhys = pBase->VPhysicsGetObject();
  if ( IPhys )
  {
      IPhys->SetMass( 10 );
      IPhys->EnableCollisions( true );
      IPhys->EnableGravity( true );
      IPhys->EnableMotion( true );
      IPhys->Wake();
  }
  pBase->Teleport( &vOrigin, &ang, &VecDir);
}
[/CODE]


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to